/* Configuración Base */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #050a05; /* El mismo bgDark que pusimos arriba */
    color: #f0fdf4;
    overflow: hidden; /* Evita scroll doble en el body */
}

/* Sistema de SPA y Scroll */
.spa-section {
    display: none;
    width: 100%;
    /* Permitir que el contenido respire */
    padding-bottom: 5rem !important; 
}

.spa-section.active {
    display: block;
}

/* Contenedor principal de scroll */
#content-area {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Scrollbar Personalizada */
#content-area::-webkit-scrollbar,
nav::-webkit-scrollbar {
    width: 6px;
}

#content-area::-webkit-scrollbar-track,
nav::-webkit-scrollbar-track {
    background: transparent;
}

#content-area::-webkit-scrollbar-thumb,
nav::-webkit-scrollbar-thumb {
    background: #1a2e1a; /* Bordes verdes */
    border-radius: 10px;
}

#content-area::-webkit-scrollbar-thumb:hover,
nav::-webkit-scrollbar-thumb:hover {
    background: #10b981; /* Tu nuevo color accent (Esmeralda) */
}

/* Efectos Visuales */
.glow-card:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15); /* Sombra verde */
    border-color: #10b981;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* Fixes para Inputs y Selects */
select option {
    background-color: #121214;
    color: #f4f4f5;
}

/* Ranking oscuro y responsive */
.bg-ranking-card {
    background: linear-gradient(180deg, #082c19 0%, #09361f 100%);
    border-color: rgba(16, 185, 129, 0.2);
}

#ranking .ranking-table-wrapper {
    overflow-x: auto;
}

#ranking table {
    min-width: 560px;
}

/* Ajustes de Details/Summary */
summary::-webkit-details-marker {
    display: none;
}
summary {
    list-style: none;
}
summary:focus {
    outline: none;
}

/* Mobile First Responsive Fixes */
@media (max-width: 768px) {
    .spa-section {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: 1.5rem !important;
        padding-bottom: 6rem !important; /* Más espacio para el final en móviles */
    }

    #sidebar {
        height: 100vh;
        height: -webkit-fill-available;
    }

    /* Asegurar que las grids no se desborden */
    .grid {
        width: 100%;
        max-width: 100%;
    }
}

/* Evitar que elementos fixed bloqueen eventos */
#sidebar-overlay {
    pointer-events: auto;
}

#sidebar-overlay.hidden {
    pointer-events: none;
}


/* ========================================= */
/* SISTEMA DE CARPETAS INTERACTIVAS (JS + CSS Grid) */
/* ========================================= */

.folder-content-wrapper {
    display: grid;
    /* Arranca cerrado */
    grid-template-rows: 0fr; 
    transition: grid-template-rows 0.4s ease-in-out;
}

.folder-content-wrapper.open {
    /* Se abre de forma nativa calculando el contenido interior */
    grid-template-rows: 1fr;
}

.folder-content-inner {
    overflow: hidden;
}

/* Rotar flecha al activar */
.folder-toggle.active .chevron {
    transform: rotate(180deg);
}

/* Cambiar el ícono de carpeta cerrada a abierta */
.folder-toggle.active .icon-closed {
    display: none;
}

.folder-toggle.active .icon-open {
    display: block;
}