/* =========================================
   VARIABLES - NUEVA PALETA AZUL Y PLOMO
========================================= */
:root {
    --fondo-oscuro: #111827; /* Plomo muy oscuro (casi negro) */
    --tarjeta-bg: #1f2937;   /* Plomo medio para tarjetas */
    --acento: #3b82f6;       /* Azul ingeniería vibrante */
    --acento-glow: rgba(59, 130, 246, 0.4);
    --texto-principal: #f3f4f6; /* Blanco humo */
    --texto-secundario: #9ca3af; /* Gris plomo claro */
    --transicion: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--fondo-oscuro);
    color: var(--texto-principal);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   CORRECCIÓN GLOBAL DE ENLACES (Adiós morado)
========================================= */
a {
    color: var(--acento);
    text-decoration: none;
    transition: var(--transicion);
}

a:visited {
    color: var(--acento); /* Fuerza a que los visitados sigan siendo azules */
}

/* =========================================
   BARRA DE NAVEGACIÓN
========================================= */
nav {
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1.2rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transicion);
}

nav.scrolled {
    padding: 0.8rem 10%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(59, 130, 246, 0.3);
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--texto-principal);
}

.logo span { color: var(--acento); }

nav ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

nav a {
    color: var(--texto-secundario);
    font-weight: 500;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--acento);
    transition: var(--transicion);
}

nav a:hover, nav a.active { color: var(--texto-principal); }
nav a:hover::after, nav a.active::after { width: 100%; }

/* =========================================
   HERO SECTION Y CONTENEDORES
========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10%;
    text-align: center;
    background: radial-gradient(circle at 50% 30%, rgba(59, 130, 246, 0.1), transparent 60%);
}

.hero h1 {
    font-size: clamp(3rem, 5vw, 5rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero span {
    color: var(--acento);
    text-shadow: 0 0 20px var(--acento-glow);
}

.container { padding: 120px 10% 80px 10%; } /* Ajuste de padding superior para que el nav no tape el contenido */

/* =========================================
   BOTONES
========================================= */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: var(--acento);
    color: #ffffff !important; /* Texto siempre blanco en el botón */
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: var(--transicion);
    border: 2px solid var(--acento);
}

.btn:visited { color: #ffffff !important; } /* Evita que el botón se ponga morado */

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--acento-glow);
    background: #2563eb; /* Un azul un poco más oscuro al pasar el mouse */
    border-color: #2563eb;
}

/* =========================================
   TABLAS (Arreglo para que no se vea pegado)
========================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: var(--tarjeta-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

th, td {
    padding: 1.5rem; /* Aquí le damos mucho espacio para que respire */
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    background: rgba(59, 130, 246, 0.15); /* Fondo azul claro plomizo */
    color: var(--acento);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Ajuste específico para botones dentro de tablas */
td .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    margin-top: 0;
}

/* =========================================
   CARPETAS DESPLEGABLES (Resistencia)
========================================= */
details {
    background: var(--tarjeta-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: var(--transicion);
}

details:hover { border-color: rgba(59, 130, 246, 0.3); }

summary {
    padding: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--texto-principal);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

summary::after {
    content: '▼';
    font-size: 1rem;
    color: var(--texto-secundario);
    transition: transform 0.3s ease;
}

details[open] summary::after {
    transform: rotate(180deg);
    color: var(--acento);
}

/* =========================================
   LISTAS Y ENLACES DENTRO DE LAS CARPETAS
========================================= */
.contenido-desplegable {
    padding: 0 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.contenido-desplegable ul {
    list-style-type: none;
    margin-top: 1rem;
}

.contenido-desplegable ul li {
    margin-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.contenido-desplegable ul li a {
    color: var(--texto-secundario) !important; /* Gris plomo claro */
    text-decoration: none;
    display: block;
    position: relative;
    padding-left: 1.5rem;
    transition: var(--transicion);
}

.contenido-desplegable ul li a:visited {
    color: var(--texto-secundario) !important; /* Adiós al morado en enlaces visitados */
}

.contenido-desplegable ul li a::before {
    content: "📄";
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

.contenido-desplegable ul li a:hover {
    color: var(--texto-principal) !important; /* Blanco al pasar el mouse */
    padding-left: 2rem;
}

.contenido-desplegable ul li a strong {
    color: var(--texto-principal);
    transition: var(--transicion);
}

.contenido-desplegable ul li a:hover strong {
    color: var(--acento); /* El título se pone azul al pasar el mouse */
}

/* =========================================
   BUSCADOR
========================================= */
.search-container {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.search-input {
    width: 100%;
    max-width: 600px;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    background: var(--tarjeta-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--texto-principal);
    font-size: 1rem;
    transition: var(--transicion);
}

.search-input:focus {
    outline: none;
    border-color: var(--acento);
    box-shadow: 0 0 15px var(--acento-glow);
}
/* =========================================
   DISEÑO RESPONSIVO (MÓVILES)
========================================= */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--texto-principal);
    border-radius: 2px;
    transition: var(--transicion);
}

/* Cuando la pantalla es menor a 768px (Teléfonos y Tablets) */
@media (max-width: 768px) {
    .hamburger {
        display: flex; /* Mostramos el icono de 3 rayitas */
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: -100%; /* Escondemos el menú a la izquierda de la pantalla */
        width: 100%;
        background: rgba(17, 24, 39, 0.95); /* Fondo plomo oscuro con cristal */
        backdrop-filter: blur(10px);
        flex-direction: column;
        text-align: center;
        padding: 2rem 0;
        transition: 0.4s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    /* Esta clase la activará el JavaScript para que el menú aparezca */
    .nav-links.active {
        left: 0; 
    }

    nav ul {
        gap: 2rem;
    }

    /* Achicamos el título en celulares para que no ocupe toda la pantalla */
    .hero h1 {
        font-size: 2.5rem;
    }
}