/*
 * Alternador de tema claro/escuro reutilizável nas páginas internas do GestorNotas
 * (login.php, cadastro.php, cfop.html, cst.html) que não usam notas-fiscais.css.
 *
 * Cada uma dessas páginas já define seu próprio :root com --bg-main, --primary,
 * --border etc. (mesma convenção) - este arquivo só cuida do botão em si e da
 * transição suave entre temas. As variáveis de cor de cada tema (claro/escuro)
 * continuam definidas no <style> de cada página, em :root e :root[data-theme="light"].
 *
 * Ver também includes/theme-toggle.php (markup do botão + script).
 */

html, html * {
    transition: background-color 0.45s ease, border-color 0.45s ease, color 0.3s ease, box-shadow 0.45s ease;
}

.theme-toggle {
    margin-left: auto;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    line-height: 0;
}

.theme-toggle-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 56px;
    height: 30px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: background 0.35s ease, border-color 0.35s ease;
}

:root[data-theme="light"] .theme-toggle-track {
    background: rgba(10, 10, 10, 0.05);
    box-shadow: inset 0 1px 3px rgba(20, 24, 26, 0.12);
}

.theme-toggle-thumb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transform: translateX(0);
    transition: transform 0.4s cubic-bezier(.65, -0.4, .35, 1.4), background 0.35s ease;
}

:root[data-theme="light"] .theme-toggle-thumb { transform: translateX(26px); }

.theme-toggle-thumb i {
    position: absolute;
    font-size: 0.68rem;
    color: #0A0A0A;
    transition: opacity 0.25s ease, transform 0.4s ease;
}

.theme-icon-sun { opacity: 0; transform: rotate(-90deg) scale(0.4); }
.theme-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }

:root[data-theme="light"] .theme-icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
:root[data-theme="light"] .theme-icon-moon { opacity: 0; transform: rotate(90deg) scale(0.4); }

.theme-toggle:hover .theme-toggle-track { border-color: rgba(61, 125, 224, 0.4); }

.theme-toggle.girando .theme-toggle-thumb { transform: translateX(0) rotate(360deg); }
:root[data-theme="light"] .theme-toggle.girando .theme-toggle-thumb { transform: translateX(26px) rotate(360deg); }

/* ---------- Menu hamburguer com todos os caminhos (ver includes/menu-completo.php) ---------- */

.menu-hamburguer { position: relative; }

.menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 260px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0.6rem;
    background: var(--bg-card, #0f2038);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    z-index: 60;
    animation: menu-pop-toggle 0.12s ease;
}

:root[data-theme="light"] .menu-dropdown {
    box-shadow: 0 24px 60px rgba(20, 24, 26, 0.18);
}

@keyframes menu-pop-toggle {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-dropdown.aberto { display: flex; }
.menu-dropdown .btn { justify-content: flex-start; width: 100%; }

.menu-dropdown-titulo {
    margin: 0.5rem 0 0.1rem;
    padding: 0 0.3rem;
    color: var(--text-muted);
    font-family: var(--font-titles, inherit);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.menu-dropdown-titulo:first-child { margin-top: 0; }

.menu-dropdown-separador {
    height: 1px;
    margin: 0.4rem 0;
    background: var(--border);
    border: 0;
}
