/**
 * DIVULGA+ SaaS — Custom CSS
 * Complementa TailwindCSS com estilos que Tailwind não cobre
 */

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR CUSTOMIZADA
   ═══════════════════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #111827;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Firefox */
* {
    scrollbar-color: #374151 #111827;
    scrollbar-width: thin;
}

html.light ::-webkit-scrollbar-track {
    background: #f3f4f6;
}

html.light ::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

html.light ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

html.light * {
    scrollbar-color: #d1d5db #f3f4f6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   INPUT & TEXTAREA
   ═══════════════════════════════════════════════════════════════════════════ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', ui-monospace, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOGGLE SWITCH (CHECKBOX)
   ═══════════════════════════════════════════════════════════════════════════ */

input[type="checkbox"].toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    background-color: #4b5563;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
    border: none;
    flex-shrink: 0;
}

input[type="checkbox"].toggle:checked {
    background-color: #10b981;
}

input[type="checkbox"].toggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: white;
    top: 3px;
    left: 3px;
    transition: left 0.3s ease;
}

input[type="checkbox"].toggle:checked::before {
    left: 23px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BOTÕES — MICRO-ANIMAÇÕES
   ═══════════════════════════════════════════════════════════════════════════ */

button,
a.btn {
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:hover:not(:disabled),
a.btn:hover {
    transform: translateY(-1px);
}

button:active:not(:disabled),
a.btn:active {
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.flash-msg {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

#sidebar {
    transition: transform 0.3s ease;
}

#sidebarOverlay {
    transition: opacity 0.3s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TABELAS
   ═══════════════════════════════════════════════════════════════════════════ */

tbody tr {
    transition: background-color 0.15s ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DETAILS / SUMMARY
   ═══════════════════════════════════════════════════════════════════════════ */

details summary {
    cursor: pointer;
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

details[open] summary::before {
    transform: rotate(90deg);
}

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px !important; /* Previne zoom em iOS */
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK / LIGHT
   ═══════════════════════════════════════════════════════════════════════════ */

html.dark {
    color-scheme: dark;
}

html.light {
    color-scheme: light;
}
