/* ================================== */
/* 1. VARIABLES Y CONFIGURACIÓN BASE */
/* ================================== */
:root {
    --color-bg: #05070a;
   
    /* Colores Neon Vibrantes */
    --color-cian: #00F5D4;
    --color-violeta: #9D4EDD;
    --color-magenta: #F72585;
   
    --color-texto-claro: #ffffff;
    --color-texto-suave: #d1d5db;
    /* Configuración Smooth Global */
    --transition-duration: 0.4s;
    --transition-easing: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all var(--transition-duration) var(--transition-easing);
}

/* ================================== */
/* 2. FONDO NEBULOSA "VIVA" (ANIMADO) */
/* ================================== */
body {
    background-color: var(--color-bg);
    color: var(--color-texto-claro);
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Fondo animado usando ::before */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: -1;
    background:
        radial-gradient(circle at 50% 50%, rgba(157, 78, 221, 0.35), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 245, 212, 0.25), transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(247, 37, 133, 0.25), transparent 40%);
    filter: blur(80px);
    animation: nebulaMove 20s infinite alternate ease-in-out;
}

@keyframes nebulaMove {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-20px, -20px) scale(1.05); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-cian); }

/* ================================== */
/* 3. TIPOGRAFÍA Y TEXTOS MÁGICOS */
/* ================================== */
h1, h2, h3, h4 {
    font-family: 'Anton', sans-serif;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

h1 {
    font-size: 5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 0 5px 30px rgba(0,0,0,0.5);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Animación de Texto Gradiente para "Dem" y títulos */
.logo-dem, .title-cian {
    background: linear-gradient(90deg, var(--color-cian), #00b4d8, var(--color-cian));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shineText 5s linear infinite;
    text-shadow: none;
    filter: drop-shadow(0 0 10px rgba(0, 245, 212, 0.3));
}

.title-purpura {
    background: linear-gradient(90deg, var(--color-violeta), var(--color-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes shineText {
    to { background-position: 200% center; }
}

.subtitle, .lead-text {
    color: var(--color-texto-suave);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.subtitle { font-size: 1.5rem; margin-bottom: 2rem; }
.lead-text { font-size: 1.25rem; margin-bottom: 2rem; }
.text-center { text-align: center; }

/* ================================== */
/* 4. GLASSMORPHISM AVANZADO */
/* ================================== */
.main-nav, .curso-card, .enfoque-card, .content-container, .status-alert, .footer {
    background: rgba(18, 22, 36, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

/* Nav Bar */
.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-radius: 0 0 20px 20px;
    margin-bottom: 2rem;
}
.nav-logo { font-size: 2rem; text-decoration: none; color: white; }

/* Status Alert */
.status-alert {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(90deg, rgba(157,78,221,0.8), rgba(247,37,133,0.8));
    color: white;
    font-weight: 700;
    border: none;
    margin-bottom: 0;
}

/* ================================== */
/* 5. TARJETAS (CARDS) ANIMADAS */
/* ================================== */
.section { padding: 6rem 1rem; max-width: 1200px; margin: 0 auto; }

.cursos-grid, .enfoque-grid, .detalles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.curso-card, .enfoque-card {
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

/* HOVER PRO */
.curso-card:hover, .enfoque-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--color-cian);
    box-shadow: 0 20px 50px rgba(0, 245, 212, 0.2);
    background: rgba(255, 255, 255, 0.07);
}

/* ================================== */
/* 6. BOTONES CON EFECTO "SHIMMER" (Brillo) */
/* ================================== */
.btn {
    display: inline-block;
    padding: 0.8rem 2.5rem;
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-cian) 0%, #0096c7 100%);
    color: #05070a;
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.4);
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: 0.5s;
    z-index: 2;
}

.btn-primary:hover::after { left: 100%; }
.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 245, 212, 0.7);
    color: #000;
}

.btn-secondary {
    background: transparent;
    color: var(--color-texto-claro);
    border: 2px solid rgba(255, 255, 255, 0.2);
}
.btn-secondary:hover {
    border-color: var(--color-violeta);
    color: var(--color-violeta);
    background: rgba(157, 78, 221, 0.1);
}

.card-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }

/* ================================== */
/* 7. FOOTER CORREGIDO Y CENTRADO */
/* ================================== */
.footer {
    padding: 3rem 1rem;
    margin-top: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-content { max-width: 600px; width: 100%; }
.footer-logo { font-size: 2rem; margin-bottom: 1rem; display: block; font-family: 'Anton', sans-serif; }
.credit { color: var(--color-texto-suave); font-size: 0.9rem; }

/* ================================== */
/* 8. LISTAS DE DETALLES */
/* ================================== */
.content-container { 
    padding: 3rem; 
    border-radius: 20px; 
    max-width: 900px; 
    margin: 0 auto; 
}

.meta-list-horizontal {
    list-style: none; 
    padding: 0; 
    margin-top: 2rem;
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 3rem;
}

.meta-list-horizontal li { 
    display: flex; 
    align-items: center; 
    color: var(--color-cian); 
    font-size: 1.1rem; 
}

.meta-list-horizontal li strong { 
    color: white; 
    margin-right: 0.5rem; 
    text-transform: uppercase; 
}

/* ================================== */
/* 9. SCROLL REVEAL (JS) - CORREGIDO */
/* ================================== */
.reveal-element { 
    opacity: 0; 
    transform: translateY(40px); 
    will-change: opacity, transform; 
    transition: all 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Añadido para que tenga transición */
}

.revealed { 
    opacity: 1; 
    transform: translateY(0); 
}

/* FIX PARA LECCIONES: Que siempre se vean aunque el JS no active la clase revealed */
.content-container.reveal-element {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.9s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================== */
/* 10. HERO Y RESPONSIVE */
/* ================================== */
.hero { 
    min-height: 85vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
    padding: 4rem 1rem; 
}

.hero.mini-hero { min-height: 50vh; }
.hero.curso-header { min-height: 60vh; }
.hero-content { z-index: 2; max-width: 900px; }

@media (max-width: 768px) {
    h1 { font-size: 3.5rem; }
    .main-nav { 
        padding: 1rem; 
        flex-direction: column; 
        gap: 1rem; 
        border-radius: 0 0 15px 15px; 
    }
    .meta-list-horizontal { flex-direction: column; gap: 1rem; }
    .hero { min-height: 70vh; }
}

/* ================================== */
/* 11. ESTILOS PARA LECCIONES Y CÓDIGO */
/* ================================== */
pre {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    color: #d4d4d4;
    font-size: 0.95rem;
}

/* Colores de sintaxis simulados */
.tag { color: #569cd6; }
.attr { color: #9cdcfe; }
.val { color: #ce9178; }
.comment { color: #6a9955; font-style: italic; }

/* Navegación de Lecciones */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* ================================== */
/* 12. SIDEBAR PLEGABLE (LAYOUT PRO) */
/* ================================== */
.course-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    padding: 2rem 1.5rem;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-title {
    font-size: 1.2rem;
    color: var(--color-cian);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--color-texto-suave);
    font-size: 1.5rem;
    cursor: pointer;
}

.lesson-list {
    list-style: none;
    padding: 0;
}

.lesson-list li {
    margin-bottom: 0.8rem;
}

.lesson-list a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--color-texto-suave);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.lesson-list a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    padding-left: 1.5rem;
}

.lesson-list a.current {
    background: rgba(0, 245, 212, 0.1);
    color: var(--color-cian);
    border-left-color: var(--color-cian);
    font-weight: 700;
}

.toggle-sidebar-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-cian);
    color: #000;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 245, 212, 0.4);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.toggle-sidebar-btn:hover {
    transform: scale(1.1) rotate(90deg);
}

.toggle-sidebar-btn.hidden {
    opacity: 0;
    transform: scale(0) rotate(180deg);
    pointer-events: none;
}

/* ================================== */
/* 13. PRELOADER (SOLO PÁGINAS PRINCIPALES) */
/* ================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}

.preloader.hidden {
    transform: translateY(-100%);
}

.equalizer {
    display: flex;
    gap: 10px;
    height: 60px;
    align-items: flex-end;
}

.bar {
    width: 15px;
    background: var(--color-cian);
    border-radius: 10px;
    animation: bounce 0.8s infinite ease-in-out alternate;
}

.bar-1 { 
    height: 40%; 
    background: var(--color-cian); 
    box-shadow: 0 0 15px var(--color-cian);
    animation-delay: -0.2s; 
}

.bar-2 { 
    height: 100%; 
    background: var(--color-violeta); 
    box-shadow: 0 0 15px var(--color-violeta);
    animation-delay: -0.4s; 
}

.bar-3 { 
    height: 60%; 
    background: var(--color-magenta); 
    box-shadow: 0 0 15px var(--color-magenta);
    animation-delay: 0s; 
}

@keyframes bounce {
    0% { height: 20%; opacity: 0.6; }
    100% { height: 100%; opacity: 1; }
}
/* ── hero corto para páginas internas ── */
.hero--short {
    min-height: 40vh;
    padding: 6rem 2rem 4rem;
}

/* ── layout de contacto ── */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

/* ── info lateral ── */
.contact-info h2 {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.8rem;
}

.contact-icon {
    font-size: 1.4rem;
    margin-top: 0.1rem;
}

.contact-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.5;
    margin-bottom: 0.2rem;
}

.contact-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.contact-link:hover { opacity: 1; }

.contact-value {
    opacity: 0.85;
}

/* ── formulario ── */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.form-group label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

.form-group input,
.form-group select,
.form-group textarea {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    color: inherit;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    resize: vertical;
}

.form-group select option {
    background: #111;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.5);
}

.btn--full { width: 100%; justify-content: center; }

.form-note {
    font-size: 0.85rem;
    min-height: 1.2rem;
    text-align: center;
}

.footer-link {
    color: inherit;
    opacity: 0.5;
    font-size: 0.85rem;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}

.footer-link:hover { opacity: 1; }