/* --- RESET BÁSICO --- */
* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* =========================================
   PALETA DE COLORES (MODO CLARO)
   ========================================= */
:root {
    --color-primario: #055220;
    --color-oscuro: #1e293b; 
    --texto-titulos: #1e293b; 
    --texto-oscuro: #334155; 
    --blanco: #ffffff; 
    --fondo-suave: #f8fafc; 
    
    --sombra-clara: #ffffff;
    --sombra-oscura: rgba(95, 157, 231, 0.48);
}

/* =========================================
   PALETA DE COLORES (MODO OSCURO - ESTILO GITHUB)
   ========================================= */
body.dark-mode {
    --color-primario: #2ea043; 
    --color-oscuro: #010409; 
    --texto-titulos: #e6edf3; 
    --texto-oscuro: #8b949e; 
    --blanco: #161b22; 
    --fondo-suave: #0d1117; 
    
    --sombra-clara: rgba(255, 255, 255, 0.01);
    --sombra-oscura: rgba(0, 0, 0, 0.6);
}

body {
    background-color: var(--fondo-suave);
    color: var(--texto-oscuro);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease; 
}

.color-primario { color: var(--color-primario); }

/* --- BARRA DE NAVEGACIÓN --- */
.navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 5%; 
    background-color: var(--fondo-suave); 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky; top: 0; z-index: 1000;
    transition: background-color 0.3s ease;
}

.logo { display: flex; align-items: center; gap: 10px; }
.img-logo { width: 40px; height: 40px; border-radius: 8px; background: #e2e8f0; object-fit: contain; }

.nav-links { list-style: none; display: flex; gap: 15px; align-items: center; }
.nav-auth { display: flex; gap: 15px; align-items: center; }

/* =========================================
   BOTONES ANIMADOS "ECO"
   ========================================= */
.nav-btn-eco {
    position: relative;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.6em 1.2em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-radius: 6em;
    transition: all 0.2s;
    border: none;
    color: var(--texto-oscuro);
    background-color: var(--blanco);
    box-shadow: -4px -2px 16px 0px var(--sombra-clara), 4px 2px 16px 0px var(--sombra-oscura);
}

.nav-btn-eco i { font-size: 1.1rem; }

.nav-btn-eco:hover {
    transform: translateY(-3px);
    box-shadow: -2px -1px 8px 0px var(--sombra-clara), 2px 1px 8px 0px var(--sombra-oscura);
    color: var(--color-primario);
}

.nav-btn-eco:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px var(--sombra-oscura);
}

.nav-btn-eco.primary {
    background-color: var(--color-primario);
    color: #ffffff;
}
.nav-btn-eco.primary:hover { color: #ffffff; }

/* =========================================
   BOTÓN HAMBURGUESA ANIMADO (ESTILO UIVERSE + CRISTAL)
   ========================================= */
.menuButton {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 6px; /* Distancia fija entre líneas */
    width: 45px; /* Tamaño fijo del botón */
    height: 45px;
    border-radius: 8px; /* Esquinas cuadradas de Uiverse */
    cursor: pointer;
    
    /* Efecto Glassmorphism */
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    transition: all .3s;
}

body.dark-mode .menuButton {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.menuButton:hover {
    border: 1px solid white;
}

body.dark-mode .menuButton:hover {
    border-color: #60a5fa;
}

.menuButton:active {
    transform: scale(0.95);
}

.menuButton input[type="checkbox"] {
    -webkit-appearance: none;
    display: none;
    visibility: hidden;
}

/* Las rayitas del menú */
.menuButton span {
    width: 24px; /* Ancho de las líneas */
    height: 3px; /* Grosor de las líneas */
    background: var(--texto-oscuro);
    border-radius: 100px;
    transition: 0.3s ease;
}

/* Animación a la "X" al estar clickeado (Valores exactos en px para evitar deformación) */
.menuButton input[type="checkbox"]:checked ~ span.top {
    transform: translateY(9px) rotate(45deg); /* Baja exactamente al centro y gira */
    width: 28px; /* Se alarga un poco la "X" para verse mejor */
}

.menuButton input[type="checkbox"]:checked ~ span.bot {
    transform: translateY(-9px) rotate(-45deg); /* Sube exactamente al centro y gira */
    width: 28px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.menuButton input[type="checkbox"]:checked ~ span.mid {
    transform: translateX(-20px);
    opacity: 0;
}
/* =========================================
   MENÚ DESPLEGABLE (CRISTAL ADAPTABLE)
   ========================================= */
.menu-container {
    position: relative;
    display: inline-block;
    margin-left: 10px;
}

.menu-dropdown {
    display: none; 
    position: absolute;
    right: 0;
    top: calc(100% + 15px);
    min-width: 240px;
    border-radius: 16px;
    z-index: 1000;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    
    /* Efecto Cristal */
    background: rgba(217, 217, 217, 0.4) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.3s ease;
}

body.dark-mode .menu-dropdown {
    background: rgba(22, 27, 34, 0.68) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55), 0 10px 20px rgba(0, 0, 0, 0.35) !important;
}

.menu-dropdown.show {
    display: flex;
    animation: fadeInDown 0.3s ease forwards;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-header {
    color: var(--texto-secundario);
    font-size: 0.85rem;
    padding: 5px 10px 10px 10px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 5px;
}
body.dark-mode .menu-header { border-bottom-color: rgba(255,255,255,0.1); color: #8b949e; }

.menu-header strong { color: var(--texto-titulos); }

/* Ítems del menú */
.menu-item {
    background-color: transparent;
    border: none;
    padding: 10px 12px;
    color: var(--texto-titulos);
    display: flex;
    align-items: center;
    position: relative;
    gap: 12px;
    cursor: pointer;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.menu-item i {
    width: 20px;
    text-align: center;
    color: var(--texto-secundario);
    font-size: 1.1rem;
}

.menu-item:not(:active):hover,
.menu-item:focus {
    background-color: rgba(255, 255, 255, 0.8);
    transform: translateX(4px);
}

body.dark-mode .menu-item:not(:active):hover,
body.dark-mode .menu-item:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu-item:focus, .menu-item:active { outline: none; }

/* Barra azul lateral en hover */
.menu-item::before {
    content: "";
    position: absolute;
    top: 10%; left: -12px; 
    width: 4px; height: 80%;
    background-color: #3b82f6;
    border-radius: 0 5px 5px 0;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.menu-item:hover::before { opacity: 1; }

/* Efecto Uiverse: Desenfocar los otros ítems */
.menu-dropdown:hover > :not(.menu-item:hover):not(.menu-header) {
    transition: 300ms;
    filter: blur(1px);
    transform: scale(0.96, 0.96);
    opacity: 0.7;
}

/* Botón Salir */
.menu-item.logout {
    margin-top: 5px;
    border-top: 1px solid rgba(0,0,0,0.1);
    border-radius: 10px;
}
body.dark-mode .menu-item.logout { border-top-color: rgba(255,255,255,0.1); }

.menu-item.logout:hover { background-color: rgba(239, 68, 68, 0.15); }
.menu-item.logout i { color: #ef4444; }
.menu-item.logout:hover::before { background-color: #ef4444; }

/* =========================================
   TOGGLE MODO OSCURO (CORREGIDO)
   ========================================= */
.theme-toggle-container {
    justify-content: space-between;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    --light: #d8dbe0;
    --dark: #28292c;
    margin-right: 5px;
    pointer-events: none; 
}

.switch-label {
    position: absolute;
    width: 100%; height: 100%;
    background-color: var(--light); 
    border-radius: 13px;
    cursor: pointer;
    border: 2px solid var(--dark);
    overflow: hidden;
}

.checkbox { position: absolute; display: none; }

.slider {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 13px;
    transition: 0.3s;
    background-color: var(--light); 
}

.checkbox:checked ~ .slider { background-color: var(--dark); }

.slider::before {
    content: "";
    position: absolute;
    top: 3px; left: 4px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background-color: var(--dark); 
    box-shadow: none; 
    transition: 0.3s;
}

.checkbox:checked ~ .slider::before {
    transform: translateX(24px);
    background-color: transparent; 
    box-shadow: inset 6px -2px 0px 0px var(--light); 
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .navbar { flex-direction: column; padding: 15px; }
    .nav-links { margin-top: 15px; gap: 10px; flex-wrap: wrap; justify-content: center; }
}