/* =========================================
   1. VARIABLES GLOBALES Y CONFIGURACIÓN BASE
   ========================================= */
:root {
   --primary: #194239; 
   --primary-light: #235347; 
   --dark: #111111; 
   --white: #ffffff; 
   --text-color: #333333;
   
   /* Fondos Estéticos */
   --bg-light-soft: #fdfdfd; 
   --bg-light-accent: #eef3f1; 
   
   /* Colores de Acento */
   --neon: #00ff88; 
   --accent-gold: #d4af37; 
   --accent-blue: #007bff; 
   --accent-purple: #6f42c1;
   
   --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); 
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;800&display=swap'); 

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; max-width: 100%; } 

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(--bg-light-accent); } 
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 5px; } 
::-webkit-scrollbar-thumb:hover { background: var(--neon); } 

.reveal { opacity: 0; transform: translateY(40px); transition: 0.8s ease-out; } 
.reveal.active { opacity: 1; transform: translateY(0); } 

.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; } 

/* =========================================
   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
   ========================================= */
.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;border-radius:0 0 20px 20px;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} 
.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,.grid-ejes,.grid-historia{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:30px} 
/* =========================================
   4. GALERÍA VITRINA (GRILLA DE FOTOS)
   ========================================= */
.galeria-vitrina { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: repeat(2, 250px); gap: 20px; max-width: 1000px; margin: 0 auto; }

.foto-item { position: relative; border-radius: 15px; overflow: hidden; box-shadow: 0 8px 25px rgba(0,0,0,0.15); cursor: pointer; }
.foto-item.principal { grid-row: span 2; }
.foto-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

.foto-overlay { 
    position: absolute; bottom: -100px; left: 0; width: 100%; 
    background: linear-gradient(transparent, rgba(25, 66, 57, 0.95)); 
    padding: 20px; color: white; transition: bottom 0.4s ease; 
}
.foto-overlay h3 { color: var(--neon); margin-bottom: 5px; font-size: 1.3rem; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.foto-overlay p { font-size: 0.9rem; color: #e8edea; }

.foto-item:hover img { transform: scale(1.1); }
.foto-item:hover .foto-overlay { bottom: 0; }

/* =========================================
   5. TARJETAS DE INFRAESTRUCTURA (LABORATORIOS)
   ========================================= */
.tarjeta-infra { 
    display: flex; flex-direction: column;
    background: var(--white); border-radius: 15px; overflow: hidden; 
    box-shadow: 0 8px 20px rgba(0,0,0,0.04); transition: transform 0.4s ease, box-shadow 0.4s ease; 
    border: 1px solid var(--border-light); 
    height: 100%;
}
.tarjeta-infra:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 123, 255, 0.15); border-color: var(--accent-blue); } 

.infra-img-box { width: 100%; height: 200px; overflow: hidden; position: relative;}
.infra-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tarjeta-infra:hover .infra-img-box img { transform: scale(1.1) rotate(2deg); }

/* Etiqueta flotante en la imagen */
.infra-badge { position: absolute; top: 15px; right: 15px; background: var(--accent-blue); color: white; padding: 5px 15px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 2;}

.infra-info { padding: 25px; text-align: center; flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.infra-info h3 { color: var(--accent-blue); margin-bottom: 10px; font-size: 1.4rem; font-weight: 700;} 
.infra-info p { color: #555; font-size: 0.95rem; line-height: 1.6; }

/* =========================================
   6. MENÚ FLOTANTE LATERAL Y FOOTER
   ========================================= */
.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 0.4s ease; opacity: 0.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(--neon); color: var(--primary); opacity: 1; transform: translateX(-15px); border-radius: 50%; box-shadow: var(--glow-shadow); }
.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 0.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); }

.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.8rem; } .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); }

    /* Ajustes Infraestructura Móvil */
    .galeria-vitrina { grid-template-columns: 1fr; grid-template-rows: auto; }
    .foto-item.principal { grid-row: auto; height: 300px; }
    .foto-item.secundaria { height: 200px; }
    .foto-overlay { bottom: 0; background: linear-gradient(transparent, rgba(13, 17, 23, 0.95)); padding: 15px; }
    .foto-overlay h3 { font-size: 1.1rem; }
    
    .boton-circulo { width: 40px; height: 40px; font-size: 18px; transform: translateX(10px); }
    .panel-info { max-width: 180px; right: 55px; font-size: 0.8rem; }
    .panel-info h4 { font-size: 14px; }
}

/* =========================================
   8. MODO OSCURO (ESPECÍFICO INFRAESTRUCTURA)
   ========================================= */
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; }

/* Parches Galería y Tarjetas en la Noche */
body.dark-mode section#campus, body.dark-mode section#tecnologia { background-color: transparent !important; border-color: rgba(255,255,255,0.05) !important; }
body.dark-mode .foto-overlay { background: linear-gradient(transparent, rgba(13, 17, 23, 0.95)) !important; }

body.dark-mode .tarjeta-infra { background: rgba(30, 35, 40, 0.5) !important; border: 1px solid rgba(255, 255, 255, 0.05) !important; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important; }
body.dark-mode .tarjeta-infra:hover { background: rgba(40, 45, 50, 0.7) !important; border-color: rgba(0, 123, 255, 0.5) !important; box-shadow: 0 15px 30px rgba(0, 123, 255, 0.2) !important; }
body.dark-mode .infra-info h3 { color: var(--accent-blue) !important; text-shadow: var(--blue-glow); }
body.dark-mode .infra-info p { color: #a3b3bc !important; }
body.dark-mode .infra-badge { background: var(--accent-blue) !important; color: #fff !important; box-shadow: 0 0 10px rgba(0, 123, 255, 0.4) !important;}
/* =========================================
   MODO OSCURO PARA INFRAESTRUCTURA
   ========================================= */
body.dark-mode .campus-gallery {
    background-color: #0d1117 !important; /* Color oscuro profundo */
}

body.dark-mode .campus-gallery .section-title {
    color: var(--accent-gold) !important;
}

body.dark-mode .campus-gallery p {
    color: #a3b3bc !important; /* Texto gris claro para mejor lectura */
}

body.dark-mode .mosaic-item {
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .mosaic-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
}