/* ============================================
   APAL 2026 - Diseño Moderno y Responsivo
   Version 5.0 - Optimizado para todos los dispositivos
   ============================================ */

:root {
    /* Paleta de Colores Azul y Amarillo */
    --primary: #0056b3;
    --primary-dark: #003d82;
    --primary-light: #3380d4;
    --secondary: #1e88e5;
    --accent: #f4cd06;
    --accent-dark: #d4b005;
    --accent-light: #ffd93d;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #212529;
    --gray-900: #0d1117;
    
    /* Tipografía */
    --font-main: 'Poppins', sans-serif;
    --font-display: 'Playfair Display', serif;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);
    
    /* Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    
    /* Transiciones */
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body { font-family: var(--font-main); font-size: 16px; line-height: 1.7; color: var(--gray-700); background: var(--white); }
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 40px;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 0 60px;
    }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ============================================
   PRELOADER
   ============================================ */
.preloader {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.preloader-brain {
    font-size: clamp(3rem, 8vw, 5rem);
    color: var(--accent);
    animation: pulse 1.5s infinite, float 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.preloader-text {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: var(--white);
    margin-top: 20px;
    letter-spacing: 0.2em;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preloader-bar {
    width: min(200px, 80vw);
    height: 3px;
    background: rgba(255,255,255,0.2);
    margin: 20px auto 0;
    border-radius: 3px;
    overflow: hidden;
}

.preloader-bar span {
    display: block;
    height: 100%;
    background: var(--accent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 0; margin-left: 100%; }
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: transparent;
    transition: var(--transition);
    padding: 8px 0;
}

.header.scrolled {
    background: var(--white);
    box-shadow: var(--shadow-md);
    padding: 4px 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

@media (min-width: 768px) {
    .header-container {
        padding: 15px 40px;
    }
}

/* Logo */
.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-main {
    font-family: var(--font-main);
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.header.scrolled .logo-main {
    color: var(--primary);
}

.logo-sub {
    font-size: clamp(0.6rem, 1.5vw, 0.75rem);
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.1em;
}

/* Navigation */
.nav-list {
    display: flex;
    align-items: center;
    gap: clamp(15px, 3vw, 30px);
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--white);
    letter-spacing: 0.05em;
    transition: var(--transition);
    position: relative;
    padding: 8px 4px;
}

.header.scrolled .nav-link {
    color: var(--gray-700);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

/* Header CTA */
.header-cta {
    padding: 10px 24px;
    background: var(--accent);
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    letter-spacing: 0.05em;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.header-cta:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--white);
    transition: var(--transition);
    border-radius: 2px;
}

.header.scrolled .nav-toggle span {
    background: var(--primary);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   HERO VIDEO SECTION
   ============================================ */
.hero-video-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: visible; /* Cambiar de hidden a visible para que el contador se vea */
}

.video-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Evita saltos visuales y mejora el rendimiento */
    backface-visibility: hidden;
    perspective: 1000;
    transform: translateZ(0); /* Fuerza el uso de la tarjeta de video para suavizar */
    background-color: #0c2e4e; /* Color de fondo igual a tu marca para que si hay un micro-salto, no sea blanco o negro */
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
}

.hero-content-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 120px 20px 60px;
}

@media (min-width: 768px) {
    .hero-content-overlay {
        padding: 140px 40px 80px;
    }
}

/* Hero Flags */
.hero-flags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    animation: fadeInDown 1s ease-out 0.3s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-flags img {
    width: clamp(24px, 5vw, 35px);
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.hero-flags img:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(244, 205, 6, 0.5);
}

/* Hero Logo */
.hero-logo {
    text-align: center;
    margin-bottom: 5px;
    animation: fadeIn 1s ease-out 0.5s both;
    height: 142px;
    width: auto;
    object-fit: contain;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hero-logo img {
    max-width: clamp(180px, 40vw, 250px);
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}

/* Hero Main Title */
.main-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--white);
    text-align: center;
    line-height: 1.3;
    margin-bottom: 30px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out 0.7s both;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    font-weight: 800;
}

/* Hero Details */
.hero-details {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 1s ease-out 0.9s both;
}

.hero-number {
    font-family: var(--font-display);
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 700;
    color: var(--white);
    line-height: 0.9;
    margin-bottom: 15px;
    text-shadow: 0 4px 20px rgba(244, 205, 6, 0.4);
    letter-spacing: 0.02em;
}

.hero-title {
    font-family: var(--font-main);
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    font-weight: 600;
    color: var(--white);
    letter-spacing: 0.08em;
    line-height: 1.4;
    margin-bottom: 12px;
}

.hero-subtitle-italic {
    font-family: var(--font-display);
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    font-style: italic;
    color: rgba(255,255,255,0.9);
    margin-bottom: 8px;
    line-height: 1.3;
}

/* Hero Actions */
.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    animation: fadeInUp 1s ease-out 1.1s both;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary-dark);
    box-shadow: 0 4px 15px rgba(244, 205, 6, 0.3);
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(244, 205, 6, 0.4);
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-outline-light:hover {
    background: var(--white);
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* ============================================
   COUNTDOWN BAR
   ============================================ */
.countdown-bar {
    background: linear-gradient(135deg, rgba(12, 46, 78, 0.95) 0%, rgba(0, 0, 0, 0.8) 100%);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    border-top: 2px solid var(--accent); /* Línea dorada superior */
}

.countdown-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(15px, 4vw, 40px);
}

.countdown-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--accent);
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.countdown-label i {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    animation: pulse 2s infinite;
}

.countdown {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 15px);
}

.countdown-item {
    text-align: center;
    min-width: clamp(50px, 12vw, 70px);
}

/* Color de los números: Oro/Amarillo y Negrita */
.countdown-number {
    display: block;
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800; /* Extra negrita */
    color: var(--accent) !important; /* Forzamos el color amarillo APAL */
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Sombra para que no se pierda con el video */
}
/* Color de las etiquetas (días, horas, etc.) */
.countdown-text {
    display: block;
    font-size: 0.75rem;
    color: var(--white); /* El blanco aquí ayuda a que el número amarillo resalte más */
    font-weight: 600;
    text-transform: uppercase;
}

/* Color de los separadores (:) */
.countdown-separator {
    font-size: 2rem;
    color: var(--accent) !important;
    font-weight: 800;
}

.countdown-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--accent);
    color: var(--primary-dark);
    font-weight: 700;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    border-radius: var(--radius-md);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(244, 205, 6, 0.3);
}

.countdown-cta {
    padding: 8px 20px; /* Botón más compacto */
}

/* Texto "Faltan:" */
.countdown-label span {
    color: var(--white);
    font-weight: 700;
    text-transform: uppercase;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats {
    padding: 60px 0;
    background: var(--gray-50);
}

@media (min-width: 768px) {
    .stats {
        padding: 80px 0;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
        margin: 0 auto;
    }
}

.stat-card {
    background: var(--white);
    padding: clamp(25px, 5vw, 35px);
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.stat-icon {
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--primary);
    margin-bottom: 15px;
    transition: var(--transition);
}

.stat-card:hover .stat-icon {
    color: var(--accent);
    transform: scale(1.1);
}

.stat-number {
    font-size: clamp(2rem, 6vw, 3rem);
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    display: inline-block;
}

.stat-plus {
    font-size: clamp(1.5rem, 4vw, 2rem);
    color: var(--accent);
    font-weight: 700;
    display: inline-block;
    margin-left: 5px;
}

.stat-label {
    font-size: clamp(0.85rem, 2vw, 1rem);
    color: var(--gray-600);
    margin-top: 10px;
    font-weight: 500;
}

/* ============================================
   SECTION HEADER
   ============================================ */
.section-header {
    text-align: center;
    margin-bottom: clamp(40px, 8vw, 60px);
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    color: var(--primary-dark);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 15px;
    line-height: 1.2;
}

.section-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--gray-600);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   BACK TO TOP BUTTON
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: var(--primary-dark);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
    .countdown-bar {
        padding: 15px 0;
    }
    
    .countdown-content {
        gap: 15px;
    }
    
    .countdown-label {
        display: none; /* Ocultamos el texto "Faltan:" para ganar espacio */
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
[data-aos] {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos].aos-animate {
    opacity: 1;
}

[data-aos="fade-up"] {
    transform: translateY(30px);
}

[data-aos="fade-up"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-down"] {
    transform: translateY(-30px);
}

[data-aos="fade-down"].aos-animate {
    transform: translateY(0);
}

[data-aos="fade-right"] {
    transform: translateX(-30px);
}

[data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

[data-aos="fade-left"] {
    transform: translateX(30px);
}

[data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

[data-aos="zoom-in"] {
    transform: scale(0.9);
}

[data-aos="zoom-in"].aos-animate {
    transform: scale(1);
}

/* ============================================
   RESPONSIVE MOBILE MENU
   ============================================ */
@media (max-width: 991px) {
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 80vw);
        height: 100vh;
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
        transition: var(--transition-slow);
        padding: 100px 30px 30px;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -5px 0 25px rgba(0,0,0,0.3);
    }
    
    .nav.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }
    
    .nav-link {
        display: block;
        width: 100%;
        padding: 16px 0;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        color: var(--white) !important;
        font-size: 1rem;
    }
    
    .nav-link::after {
        bottom: 8px;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .header-cta {
        display: none;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
    text-align: center;
}

.text-primary {
    color: var(--primary);
}

.text-accent {
    color: var(--accent);
}

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }

.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .header,
    .nav-toggle,
    .back-to-top,
    .preloader {
        display: none !important;
    }
}


.president-welcome {
    overflow: hidden;
}

.president-card {
    transition: transform .4s ease, box-shadow .4s ease;
}

.president-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0,0,0,.18);
}

.president-img {
    transition: transform .6s ease;
}

.president-img:hover {
    transform: scale(1.04);
}

/* Responsive */
@media (max-width: 992px) {
    .president-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    .president-img-wrapper {
        max-width: 280px;
        margin: 0 auto;
    }

    .president-img {
        height: 360px !important;
    }

    .president-badge {
        bottom: -15px !important;
    }
}

@media (max-width: 576px) {
    .president-welcome {
        padding: 70px 0 !important;
    }

    .president-text h3 {
        font-size: 1.6rem !important;
    }

    .president-text p,
    .president-text blockquote {
        font-size: .95rem;
    }
}
