/* =========================================
   1. VARIABLES GLOBALES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
   --primary: #194239; --primary-light: #235347; --dark: #111111; --white: #ffffff; --text-color: #333333;
   
   /* Fondo estético Premium para Modo Claro */
   --bg-light-soft: #fdfdfd; --bg-light-accent: #eef3f1; 
   --bg-light: #e8edea; /* Respaldo */

   --neon: #00ff88; --accent-gold: #d4af37; --accent-blue: #007bff; --accent-purple: #6f42c1;
   --gray: #f4f7f6; --border-light: rgba(25, 66, 57, 0.15); 
   --glow-shadow: 0 8px 30px rgba(0, 255, 136, 0.2); --gold-glow: 0 0 15px rgba(212, 175, 55, 0.5);
   --blue-glow: 0 0 15px rgba(0, 123, 255, 0.4); --purple-glow: 0 0 15px rgba(111, 66, 193, 0.4);
}
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap'); 
*{margin:0;padding:0;box-sizing:border-box;font-family:'Poppins',sans-serif;max-width:100%} 

/* Aplicamos el fondo Premium de Día */
body { 
    scroll-behavior: smooth; color: var(--text-color); 
    background: linear-gradient(135deg, var(--bg-light-soft) 0%, var(--bg-light-accent) 100%);
    background-attachment: fixed; overflow-x: hidden; 
} 
::-webkit-scrollbar{width:10px} ::-webkit-scrollbar-track{background:var(--gray)} ::-webkit-scrollbar-thumb{background:var(--primary);border-radius:5px} ::-webkit-scrollbar-thumb:hover{background:var(--neon)} 
.reveal{opacity:0;transform:translateY(40px);transition:.8s ease-out} .reveal.active{opacity:1;transform:translateY(0)} 

/* =========================================
   2. NAVEGACIÓN DUAL (PC Y MÓVIL DECORADO)
   ========================================= */

/* --- ESTILO PARA COMPUTADORAS (Escritorio) --- */
.main-header {
    background: rgba(25, 66, 57, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Logo adaptable */
.logo-small {
    height: 55px;
    width: auto;
    transition: all 0.3s ease;
}

.menu-toggle, .sidebar-lateral, .overlay-dark {
    display: none; 
}

.navbar {
    width: 100%;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.2);
}
.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 10px;
    padding: 10px;
}
.navbar li a {
    color: var(--white);
    text-decoration: none;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 25px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.navbar li a:hover, .navbar li a.activo {
    background: rgba(0, 255, 136, 0.15);
    color: var(--neon);
    border-color: var(--neon);
    box-shadow: var(--glow-shadow);
}

/* --- ESTILO PARA MÓVIL (Menú Lateral Decorado) --- */
@media screen and (max-width: 768px) {
    .navbar { display: none !important; } 

    .logo-small {
        height: 42px; /* Se adapta al tamaño del teléfono */
    }

    .menu-toggle {
        display: flex !important;
        flex-direction: column;
        cursor: pointer;
        padding: 5px;
        z-index: 5001;
    }
    .menu-toggle .bar {
        height: 3px;
        width: 25px;
        background-color: var(--neon);
        margin: 3px 0;
        border-radius: 5px;
        transition: 0.4s;
    }

    /* Sidebar Decorado */
    .sidebar-lateral {
        display: flex;
        position: fixed;
        right: -100%; 
        top: 0;
        width: 280px; 
        height: 100vh;
        background: linear-gradient(135deg, rgba(11, 34, 24, 0.98), rgba(0, 0, 0, 0.98));
        backdrop-filter: blur(15px);
        z-index: 5000;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 2px solid var(--neon);
        flex-direction: column;
        padding-top: 20px;
    }

    .sidebar-lateral.active {
        right: 0;
    }

    /* Capa oscura para cerrar al tocar fuera */
    .overlay-dark {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        z-index: 4500;
        display: none; /* Se activa con JS */
    }
    
    .overlay-dark.active {
        display: block;
    }

    .nav-links-sidebar {
        list-style: none;
        padding: 40px 20px;
    }
    .nav-links-sidebar li {
        margin-bottom: 25px;
        opacity: 0;
        transform: translateX(20px);
        transition: 0.4s;
    }
    .sidebar-lateral.active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    .nav-links-sidebar a {
        color: white;
        text-decoration: none;
        font-size: 1.1rem;
        display: block;
        border-bottom: 1px solid rgba(0,255,136,0.1);
        padding-bottom: 10px;
    }
}
@media screen and (max-width: 768px) {
    .timeline-vertical::after { left: 20px !important; transform: none !important; }
    .timeline-item { width: 100% !important; padding: 10px 10px 10px 45px !important; }
    .timeline-item.izquierda, .timeline-item.derecha { left: 0 !important; }
    .timeline-icon { left: 20px !important; transform: translateX(-50%) !important; }
}

/* =========================================
   3. SECCIONES GENERALES Y HERO
   ========================================= */
.container{width:95%;max-width:1200px;margin:0 auto;padding:20px 0} .section-padding{padding:40px 0} 
.section-title{text-align:center;color:var(--accent-gold) !important;margin-bottom:40px;font-size:2.2rem;text-transform:uppercase;font-weight:bold;text-shadow:0 2px 5px rgba(0,0,0,0.1)} 
.grid-layout{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:30px} 
.hero-section{background:linear-gradient(rgba(0,0,0,0.75),rgba(0,0,0,0.85)),url('imagenes/inicio');background-size:cover;background-position:center;background-attachment:fixed;background-repeat:no-repeat;padding:100px 20px;text-align:center;margin-bottom:40px} 
.hero-container{max-width:900px;margin:0 auto} .texto-destacado{font-size:2.5rem;font-weight:700;color:var(--neon);text-transform:uppercase;letter-spacing:1px;margin-bottom:15px} .subtexto-hero{font-size:1.1rem;color:var(--white);font-weight:300} 

/* =========================================
   4. TARJETAS DE DOCENTES (ANIMACIONES PREMIUM)
   ========================================= */
.docente-card { background: var(--white); border-radius: 15px; padding: 40px 20px; text-align: center; border: 1px solid var(--border-light); box-shadow: 0 10px 30px rgba(25, 66, 57, 0.05); position: relative; animation: flotarDocente 6s ease-in-out infinite alternate; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1; }
.docente-card:nth-child(2) { animation-delay: -2s; }
.docente-card:nth-child(3) { animation-delay: -4s; }
@keyframes flotarDocente { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } }

.docente-card:hover { animation-play-state: paused; transform: translateY(-15px) scale(1.03); box-shadow: 0 25px 50px rgba(25, 66, 57, 0.15); border-color: var(--neon); z-index: 10; }
.docente-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px; background: var(--neon); transform: scaleX(0); transition: transform 0.5s ease; transform-origin: left; border-top-left-radius: 15px; border-top-right-radius: 15px; }
.docente-card:hover::before { transform: scaleX(1); }
.docente-card.gold::before { background: var(--accent-gold); }
.docente-card.blue::before { background: var(--accent-blue); }
.docente-card.purple::before { background: var(--accent-purple); }

.avatar-tech { width: 90px; height: 90px; background: var(--primary); border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 2.8rem; color: var(--white); border: 4px solid rgba(25, 66, 57, 0.15); box-shadow: 0 10px 20px rgba(0,0,0,0.1); transition: all 0.5s ease; position: relative; overflow: hidden; }
.avatar-tech::after { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 20%; background: rgba(255,255,255,0.5); box-shadow: 0 0 15px rgba(255,255,255,0.9); transform: rotate(45deg); animation: scanHolo 3s ease-in-out infinite; opacity: 0; }
@keyframes scanHolo { 0% { top: -50%; opacity: 0; } 50% { opacity: 1; } 100% { top: 150%; opacity: 0; } }

.docente-card:hover .avatar-tech { transform: scale(1.15) rotateY(15deg); border-color: var(--neon); background: var(--primary-light); color: var(--neon);}
.docente-card.gold:hover .avatar-tech { border-color: var(--accent-gold); box-shadow: var(--gold-glow); background: var(--accent-gold); color: #111; }
.docente-card.blue:hover .avatar-tech { border-color: var(--accent-blue); box-shadow: var(--blue-glow); background: var(--accent-blue); color: #fff; }
.docente-card.purple:hover .avatar-tech { border-color: var(--accent-purple); box-shadow: var(--purple-glow); background: var(--accent-purple); color: #fff; }

.docente-card h3 { color: var(--primary) !important; margin-bottom: 12px; font-weight: 700; position: relative; z-index: 2;}
.docente-titulo { font-size: 0.95rem; font-style: italic; margin-bottom: 20px; color: var(--primary-light) !important; font-weight: 600; position: relative; z-index: 2;}

.materias-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; position: relative; z-index: 2; }
.materias-tags span { background: rgba(25, 66, 57, 0.05); color: var(--primary); padding: 6px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: bold; border: 1px solid rgba(25, 66, 57, 0.3); transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.materias-tags span:nth-child(2n) { background: rgba(0, 123, 255, 0.05); color: var(--accent-blue); border-color: rgba(0, 123, 255, 0.3); }
.materias-tags span:nth-child(3n) { background: rgba(111, 66, 193, 0.05); color: var(--accent-purple); border-color: rgba(111, 66, 193, 0.3); }

.docente-card:hover .materias-tags span { transform: translateY(-5px) scale(1.1); box-shadow: 0 5px 15px rgba(0,0,0,0.1); background: var(--primary); color: var(--white); border-color: var(--primary); }
.docente-card:hover .materias-tags span:nth-child(1) { transition-delay: 0.1s; }
.docente-card:hover .materias-tags span:nth-child(2) { transition-delay: 0.2s; }
.docente-card:hover .materias-tags span:nth-child(3) { transition-delay: 0.3s; }
.docente-card.gold:hover .materias-tags span { background: var(--accent-gold); border-color: var(--accent-gold); color: #111111 !important; box-shadow: var(--gold-glow); }
.docente-card.blue:hover .materias-tags span { background: var(--accent-blue); border-color: var(--accent-blue); color: #ffffff !important; box-shadow: var(--blue-glow); }
.docente-card.purple:hover .materias-tags span { background: var(--accent-purple); border-color: var(--accent-purple); color: #ffffff !important; box-shadow: var(--purple-glow); }

/* =========================================
   5. MENÚ FLOTANTE LATERAL
   ========================================= */
.menu-flotante-lateral { position: fixed; right: 0; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 10px; z-index: 1000; }
.item-flotante { display: flex; align-items: center; flex-direction: row-reverse; position: relative; }
.boton-circulo { width: 45px; height: 45px; background-color: var(--primary); color: var(--white); border-radius: 50px 0 0 50px; display: flex; justify-content: center; align-items: center; font-size: 20px; cursor: pointer; transition: all .4s ease; opacity: .3; transform: translateX(25px); text-decoration: none;}
.item-flotante:nth-child(1):hover .boton-circulo { background-color: var(--accent-blue); color: white; opacity: 1; transform: translateX(-15px); border-radius: 50%; box-shadow: var(--blue-glow); }
.item-flotante:nth-child(2):hover .boton-circulo { background-color: var(--accent-purple); color: white; opacity: 1; transform: translateX(-15px); border-radius: 50%; box-shadow: var(--purple-glow); }
.panel-info { background-color: rgba(255,255,255,0.95); color: #333; padding: 12px 18px; border-radius: 8px; border-left: 4px solid var(--primary); box-shadow: 0 5px 15px rgba(0,0,0,0.2); width: max-content; max-width: 250px; position: absolute; right: 70px; opacity: 0; visibility: hidden; transform: translateX(20px) scale(0.9); transition: all .3s ease; border: 1px solid var(--border-light); }
.panel-info h4 { color: var(--primary); margin-top: 0; margin-bottom: 5px; font-size: 16px; font-weight: bold; }
.item-flotante:hover .panel-info { opacity: 1; visibility: visible; transform: translateX(0) scale(1); }

/* =========================================
   6. FOOTER (PIE DE PÁGINA)
   ========================================= */
.footer-main { background: var(--dark); color: #ccc; padding: 60px 20px 20px; margin-top: auto; border-top: 4px solid var(--accent-gold); }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; }
.footer-col h4 { color: var(--accent-gold) !important; border-bottom: 2px solid var(--neon); display: inline-block; margin-bottom: 20px; padding-bottom: 5px; text-transform: uppercase;}
.footer-col ul { list-style: none; }
.footer-col a { color: #ccc; text-decoration: none; transition: 0.3s; }
.footer-col a:hover { color: var(--neon); }
.footer-bottom { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid #333; font-size: 0.85rem; }

/* =========================================
   7. MEDIA QUERIES (RESPONSIVE MÓVIL)
   ========================================= */
@media screen and (max-width: 768px) {
    html, body { overflow-x: hidden !important; width: 100%; position: relative; }
    .header-text h1 { font-size: 1rem; } .header-text p { font-size: .7rem; }
    .hero-section { padding: 60px 15px; background-attachment: scroll; }
    .texto-destacado { font-size: 1.5rem; } .section-title { font-size: 1.6rem; margin-bottom: 25px; }
    
    .menu-toggle { display: flex; }
    .navbar ul { flex-direction: column; background-color: var(--primary); max-height: 0; overflow: hidden; transition: max-height .4s ease-out; padding: 0; gap: 0; }
    .navbar ul.active { max-height: 500px; padding: 10px 0; }
    .navbar li { width: 100%; text-align: center; border-top: 1px solid rgba(0,255,136,0.1); }
    .navbar li a { padding: 15px; display: block; border-radius: 0; }
    .navbar .dropdown-content { position: static; transform: none; box-shadow: none; background: rgba(0,0,0,0.2); min-width: 100%; border-top: none; }
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .docente-card::before { transform: scaleX(1); animation: mobilePulseLine 3s infinite alternate ease-in-out; }
    @keyframes mobilePulseLine { 0% { transform: scaleX(0.7); opacity: 0.6; } 100% { transform: scaleX(1); opacity: 1; } }
    .avatar-tech { animation: mobileRotateAvatar 4s infinite alternate ease-in-out; }
    @keyframes mobileRotateAvatar { 0% { transform: rotateY(0deg) scale(1); } 100% { transform: rotateY(15deg) scale(1.05); } }
    .materias-tags span { animation: mobilePopTags 5s infinite; }
    .materias-tags span:nth-child(1) { animation-delay: 0s; }
    .materias-tags span:nth-child(2) { animation-delay: 0.2s; }
    .materias-tags span:nth-child(3) { animation-delay: 0.4s; }
    @keyframes mobilePopTags { 0%, 15%, 100% { transform: translateY(0) scale(1); } 7% { transform: translateY(-5px) scale(1.1); box-shadow: 0 5px 15px rgba(0,0,0,0.1); } }

    .boton-circulo { width: 40px; height: 40px; font-size: 18px; transform: translateX(10px); }
    .panel-info { max-width: 180px; right: 55px; font-size: .8rem; }
    .panel-info h4 { font-size: 14px; }
}

/* =========================================
   8. MODO OSCURO (CORRECCIÓN FONDO BLANCO)
   ========================================= */
body.dark-mode { background: #0d1117 !important; color: #e6edf3 !important; }
body.dark-mode .main-header { background: rgba(13, 17, 23, 0.7) !important; border-bottom: 1px solid rgba(0, 255, 136, 0.15) !important; box-shadow: none !important; }
body.dark-mode .navbar ul { background: transparent !important; }
body.dark-mode .section-title { color: var(--accent-gold) !important; text-shadow: var(--gold-glow); }
body.dark-mode .hero-section { background: linear-gradient(rgba(0, 0, 0, 0.692), rgba(0, 0, 0, 0.582)), url('imagenes/inicio') !important; background-size: cover !important; background-position: center !important; background-attachment: fixed !important; background-repeat: no-repeat !important; }

/* ¡AQUÍ ESTÁ EL PARCHE! Esto fuerza a la sección rebelde a oscurecerse */
body.dark-mode section#area-ciencias, 
body.dark-mode section#area-tecnica { 
    background-color: transparent !important; 
    border-top-color: rgba(0, 255, 136, 0.15) !important; 
}

body.dark-mode .docente-card { background: rgba(30, 35, 40, 0.5) !important; border-color: rgba(255,255,255,0.05) !important; box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important; }
body.dark-mode .docente-card:hover { background: rgba(40, 45, 50, 0.7) !important; box-shadow: 0 20px 40px rgba(0, 255, 136, 0.15) !important; border-color: var(--neon) !important; }
body.dark-mode .docente-card.gold:hover { box-shadow: 0 20px 40px rgba(212, 175, 55, 0.15) !important; border-color: var(--accent-gold) !important; }
body.dark-mode .docente-card.blue:hover { box-shadow: 0 20px 40px rgba(0, 123, 255, 0.15) !important; border-color: var(--accent-blue) !important; }
body.dark-mode .docente-card.purple:hover { box-shadow: 0 20px 40px rgba(111, 66, 193, 0.15) !important; border-color: var(--accent-purple) !important; }

body.dark-mode .docente-card h3 { color: var(--white) !important; }
body.dark-mode .docente-titulo { color: #a3b3bc !important; }
body.dark-mode .avatar-tech { border-color: rgba(255,255,255,0.05) !important; box-shadow: 0 10px 20px rgba(0,0,0,0.5) !important; background: transparent !important; color: var(--white) !important;}
body.dark-mode .avatar-tech::after { background: rgba(0, 255, 136, 0.4) !important; box-shadow: 0 0 15px var(--neon) !important; }

body.dark-mode .docente-card:hover .avatar-tech { border-color: var(--neon) !important; color: var(--neon) !important; }
body.dark-mode .docente-card.gold:hover .avatar-tech { border-color: var(--accent-gold) !important; color: var(--accent-gold) !important;}
body.dark-mode .docente-card.blue:hover .avatar-tech { border-color: var(--accent-blue) !important; color: var(--accent-blue) !important;}
body.dark-mode .docente-card.purple:hover .avatar-tech { border-color: var(--accent-purple) !important; color: var(--accent-purple) !important;}

body.dark-mode .materias-tags span { background: #111111 !important; color: var(--neon) !important; border-color: rgba(0,255,136,0.3) !important; }
body.dark-mode .materias-tags span:nth-child(2n) { color: var(--accent-blue) !important; border-color: rgba(0,123,255,0.3) !important; }
body.dark-mode .materias-tags span:nth-child(3n) { color: var(--accent-purple) !important; border-color: rgba(111,66,193,0.3) !important; }

body.dark-mode .docente-card:hover .materias-tags span { color: #111 !important; }
body.dark-mode .docente-card.gold:hover .materias-tags span { background: var(--accent-gold) !important; border-color: var(--accent-gold) !important; box-shadow: var(--gold-glow) !important; color: #111 !important;}
body.dark-mode .docente-card.blue:hover .materias-tags span { background: var(--accent-blue) !important; border-color: var(--accent-blue) !important; box-shadow: var(--blue-glow) !important; color: #fff !important;}
body.dark-mode .docente-card.purple:hover .materias-tags span { background: var(--accent-purple) !important; border-color: var(--accent-purple) !important; box-shadow: var(--purple-glow) !important; color: #fff !important;}
/* =========================================
   CUADRÍCULA HORIZONTAL PARA DOCENTES
   ========================================= */
.grid-layout {
    display: grid;
    /* Esta línea es la magia: crea columnas horizontales automáticas */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; /* Espacio entre las tarjetas */
    align-items: stretch; /* Hace que todas las tarjetas tengan la misma altura */
    width: 100%;
}

.docente-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-light);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Colores de las tarjetas para que coincidan con tu diseño */
.docente-card.blue { border-bottom: 4px solid var(--accent-blue); }
.docente-card.green { border-bottom: 4px solid var(--neon); }
.docente-card.purple { border-bottom: 4px solid var(--accent-purple); }
.docente-card.gold { border-bottom: 4px solid var(--accent-gold); }

.docente-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* Modo oscuro para las tarjetas de docentes */
body.dark-mode .docente-card {
    background: rgba(30, 35, 40, 0.8);
    border-color: rgba(255,255,255,0.05);
}