/* ================= 1. VARIABLES Y CONFIGURACIÓN BASE ================= */
:root {
    --primary-color: #1B396A; /* Azul institucional */
    --accent-color: #ffd700;  /* Dorado */
    --secondary-color: #f8f9fa;
    --text-dark: #333;
    --text-light: #666;
    --white: #fff;
    --whatsapp-color: #25d366;
    --bg-light: #f1f5f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-padding {
    padding: 80px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 40px;
}

/* ================= 2. LOGOS SUPERIORES ================= */
.header-logos {
    background-color: var(--white);
    padding: 25px 0;
    border-bottom: 1px solid #eee;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.logo-img {
    height: 100px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* ================= 3. NAVBAR ================= */
.navbar {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    height: 60px;
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 10px;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 5px;
    transition: 0.3s;
    font-size: 0.95rem;
    text-transform: uppercase;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

/* ================= 4. HERO SECTION (PORTADA PRINCIPAL) ================= */
.hero {
    /* CORREGIDO: Agregué de nuevo la URL de la imagen que faltaba */
    background: linear-gradient(rgba(27, 57, 106, 0.7), rgba(27, 57, 106, 0.7));
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
}

/* AQUÍ ESTÁ EL AJUSTE DE ALTURA DEL TEXTO */
.hero-content {
    /* Ajustado a 150px. Si quieres que suba más, pon 200px o 250px. NO uses 5000px */
    margin-bottom: 150px; 
    position: relative;
    z-index: 2;
}

.hero-content h1 { 
    font-size: 3.5rem; 
    margin-bottom: 20px; 
    line-height: 1.2; 
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}
.hero-content p { 
    font-size: 1.5rem; 
    margin-bottom: 30px; 
    text-shadow: 1px 1px 5px rgba(27, 57, 106, 0.8);
}
.btn {
    display: inline-block;
    padding: 12px 35px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn:hover { background: #ac9de3; transform: translateY(-2px); }

/* ================= SECCIÓN TEXTO INICIO (.tex-inicio) ================= */
.tex-inicio {
    background: linear-gradient(rgba(27, 57, 106, 0.7), rgba(27, 57, 106, 0.7)), url('Imagenes/INFORMÁTICA.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    min-height: 70vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 0 20px;
    position: relative;
}
.Dcontent {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    z-index: 2;
}

.tex-inicio h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    text-transform: uppercase;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}

.tex-inicio p {
    font-size: 1.3rem;
    margin-bottom: 35px;
    line-height: 1.6;
    font-weight: 300;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.8);
}

.tex-inicio .btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #ffd700;
    color: #1B396A;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.tex-inicio .btn:hover {
    transform: translateY(-3px);
    background-color: #ffffff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* ================= HEADERS DE PÁGINAS INTERNAS (HISTORIA Y ACTIVIDADES) ================= */

/* --- Configuración Base para Headers Internos --- */
.page-header, .page-header-a {
    background-size: cover;
    background-position: center;
    height: 50vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
    margin-bottom: 50px;
    z-index: 1; /* Nivel base */
}

/* --- Fondo Específico para HISTORIA --- */
.page-header {
    background-image: linear-gradient(rgba(27, 57, 106, 0.8), rgba(27, 57, 106, 0.8)), url('Imagenes/informa2.jpeg');
}

/* --- Fondo Específico para ACTIVIDADES ACADÉMICAS --- */
.page-header-a {
    background-image: linear-gradient(rgba(27, 57, 106, 0.8), rgba(27, 57, 106, 0.8)), url('Imagenes/INFORMÁTICA3.png.jpeg'); 
}

/* --- Estilos del Texto en Headers Internos (Asegura visibilidad) --- */
.page-header .container, .page-header-a .container {
    position: relative;
    z-index: 10; /* Texto siempre arriba del fondo */
}

.page-header h1, .page-header-a h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.9);
    margin: 0;
}

/* ================= 5. SECCIÓN DE IMPACTO (CONTEO) ================= */
.counter-section {
    background-color: var(--primary-color);
}

.counter-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 20px 0;
}

.counter-item {
    text-align: center;
    color: var(--white);
    flex: 1;
    min-width: 250px;
}

.counter-item i {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 25px;
    display: block;
}

.counter-item h3 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 10px 0;
}

.counter-item p {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
}

/* ================= 6. TESTIMONIOS Y CARRUSEL ================= */
.testimonials-section {
    background-color: #f8fafc;
}

.carousel-wrapper {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 70px;
    display: flex;
    align-items: center;
    min-height: 550px;
}

.carousel-track-container {
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    list-style: none;
    padding: 0;
}

.testimonial-card {
    min-width: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    text-align: center;
}

.testimonial-card.current-slide {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.gallery-img-full {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}

.image-container {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 10px;
}

.image-caption {
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--white);
    color: var(--primary-color);
    border: none;
    width: 50px; height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 10;
    display: flex; justify-content: center; align-items: center;
    transition: 0.3s;
}

.carousel-btn:hover { background: var(--primary-color); color: var(--white); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

/* ================= 7. MODAL DE ADMIN ================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active { display: flex; }

.admin-icon-trigger {
    position: absolute;
    top: 20px; 
    left: 20px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--white);
    width: 50px; 
    height: 50px;
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.admin-icon-trigger:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.login-card {
    background: #fff;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 420px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    text-align: center;
}

.login-header i { font-size: 3rem; color: var(--primary-color); margin-bottom: 10px; }
.login-header h2 { font-size: 1.8rem; color: var(--text-dark); margin-bottom: 5px; }
.login-header p { font-size: 0.9rem; color: var(--text-light); margin-bottom: 25px; }

.input-group {
    text-align: left; 
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.input-group label i { margin-right: 5px; color: var(--primary-color); }

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(27, 57, 106, 0.1);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
}

.btn-login:hover {
    background-color: #142d54;
}

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

/* ================= 8. WHATSAPP Y FOOTER ================= */
.whatsapp-container { position: fixed; bottom: 30px; right: 30px; z-index: 1000; }
.whatsapp-float {
    width: 60px; height: 60px;
    background-color: var(--whatsapp-color);
    color: white;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
}

.whatsapp-options {
    display: none;
    position: absolute; bottom: 75px; right: 0;
    width: 260px; background: white;
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.whatsapp-options.show { display: block; }
.wa-item { display: block; padding: 15px; color: var(--text-dark); text-decoration: none; transition: 0.3s; }
.wa-item:hover { background: #f0f0f0; }

footer {
    background: #111;
    color: white;
    text-align: center;
    padding: 40px 0;
}

/* ================= 9. ACERCA DE Y HISTORIA ================= */
.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 30px;
}
.about-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.timeline { position: relative; max-width: 1200px; margin: 0 auto; padding: 40px 0; }
.timeline::after {
    content: ''; position: absolute; width: 4px;
    background-color: var(--primary-color);
    top: 0; bottom: 0; left: 50%; margin-left: -2px;
}
.timeline-item { padding: 10px 40px; position: relative; width: 50%; }
.timeline-item.left { left: 0; text-align: right; }
.timeline-item.right { left: 50%; text-align: left; }
.timeline-content {
    padding: 25px; background-color: var(--white);
    border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary-color);
}

/* ================= 10. MEDIA QUERIES (RESPONSIVE - CELULARES) ================= */
@media screen and (max-width: 768px) {
    /* Navbar Móvil */
    .nav-menu {
        position: fixed; left: -100%; top: 0;
        flex-direction: column; background-color: var(--primary-color);
        width: 80%; height: 100vh; padding-top: 100px; transition: 0.4s;
    }
    .nav-menu.active { left: 0; }
    .menu-toggle { display: block; color: white; font-size: 1.5rem; }
    
    /* Hero */
    .hero-content h1 { font-size: 2.2rem; }
    
    /* Tex Inicio */
    .tex-inicio { min-height: 60vh; }
    .tex-inicio h1 { font-size: 2rem; }
    .tex-inicio p { font-size: 1rem; padding: 0 10px; }
    .tex-inicio .btn { padding: 12px 30px; }
    
    /* Headers Internos */
    .page-header, .page-header-a { height: 40vh; padding: 0 20px; }
    .page-header h1, .page-header-a h1 { font-size: 2.2rem; }

    /* Timeline */
    .timeline::after { left: 31px; }
    .timeline-item { width: 100%; padding-left: 70px; text-align: left !important; }
    .timeline-item.right { left: 0; }
    
    /* Carrusel */
    .image-container { height: 250px; }
    .carousel-wrapper { padding: 10px 45px; }
}

/* ================= 11. ESTILOS DE TEMARIO Y EXTRAS ================= */
/* ================= ESTILOS CORREGIDOS PARA SEMESTRES (COMPACTO) ================= */

/* --- 1. Título de Sección --- */
.section-title-small {
    text-align: center; 
    font-size: 1.8rem; 
    color: var(--primary-color); 
    margin-bottom: 30px;
}

/* --- 2. Grid de 4 Columnas (La estructura principal) --- */
.curriculum-grid-compact {
    display: grid;
    gap: 20px; /* Espacio entre tarjetas */
    width: 100%;
    grid-template-columns: 1fr; /* Por defecto (celular): 1 columna */
    align-items: start; /* Evita que las tarjetas se estiren a lo alto */
}

/* En PC (Pantallas grandes): 4 Columnas exactas */
@media screen and (min-width: 1200px) {
    .curriculum-grid-compact {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* En Tablets: 2 Columnas */
@media screen and (min-width: 768px) and (max-width: 1199px) {
    .curriculum-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- 3. Tarjeta del Semestre --- */
.sem-card-mini {
    background: #fff; 
    border: 1px solid #eef2f6; 
    border-radius: 10px; 
    transition: all 0.3s ease; 
    overflow: hidden;
    height: fit-content; /* Se ajusta al contenido */
}

.sem-card-mini:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08); 
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

/* Cabecera de la Tarjeta */
.sem-header-mini {
    background: var(--bg-light); 
    padding: 10px 15px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    border-bottom: 2px solid var(--primary-color);
}
.sem-header-mini i { color: var(--primary-color); font-size: 1.1rem; }
.sem-header-mini span { font-weight: 700; font-size: 0.95rem; }

/* Cuerpo de la Tarjeta */
.sem-body-mini { 
    padding: 5px 0; /* Menos relleno para ser más compacto */
}

/* --- 4. Items (Materias) --- */
.subj-item { 
    padding: 0; 
    border-bottom: 1px solid #f1f5f9; 
    cursor: pointer; 
    transition: background-color 0.2s;
}

.subj-item:hover { 
    background-color: #f8f9fa; 
}

/* Texto de la materia (flecha y nombre) */
.subj-item p { 
    font-size: 0.85rem; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin: 0; 
    padding: 12px 15px; /* Espacio para el clic */
    font-weight: 600;
    color: #333;
}

.subj-item i { 
    font-size: 0.8rem; 
    color: var(--text-light); 
    transition: transform 0.3s ease;
}

/* Rotación de flecha al activar */
.subj-item.active p i {
    transform: rotate(180deg);
    color: var(--primary-color);
}
.subj-item.active p {
    color: var(--primary-color);
}

/* --- 5. Contenido Desplegable (Temario) --- */
.syll-content {
    display: none; 
    font-size: 0.8rem; 
    color: #555; 
    background: #fafbfc; 
    padding: 15px; 
    border-top: 1px solid #eee;
    /* Eliminamos el margin-top gigante que tenías */
    margin-top: 0; 
}

.syll-content.active { 
    display: block; 
    animation: fadeInDown 0.3s ease;
}

/* --- 6. Botones dentro del Temario --- */
.resource-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-resource {
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: 0.3s;
    /* Opcional: para que ocupen todo el ancho disponible en la tarjeta */
    flex: 1; 
    justify-content: center;
    min-width: 100px; 
}

/* Colores de Botones */
.btn-resource.pdf { background-color: #dc3545; color: white; }
.btn-resource.pdf:hover { background-color: #bb2d3b; }

.btn-resource.link { background-color: #0d6efd; color: white; }
.btn-resource.link:hover { background-color: #0b5ed7; }

/* --- Animación --- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}