/* ======== 1. VARIABLES Y ESTILOS GLOBALES ======== */
:root {
    /* Nueva paleta de colores basada en #1916F5 */
    --brand-color: #1916F5;      /* Azul Flippers vibrante */
    --primary-color: #38bdf8;   /* Turquesa para acentos y highlights */
    --dark-blue: #0c0a3e;       /* Azul marino profundo para fondos */
    --mid-blue: #1e293b;        /* Azul grisáceo para tarjetas y secciones */
    --light-color: #e2e8f0;     /* Blanco hueso / Gris muy claro */
    --text-color: #cbd5e1;      /* Color de texto principal */
    
    /* Variables para TheCodeCrack Solutions */
    --color-accent: #61DAFB;    /* Accent color for the new design */
    --color-primary-dark: hsl(217, 91%, 35%); /* Dark blue from Tailwind config */
    --color-text-darck: #000000; /* Dark gray for text */
    
    /* Fuentes y Transiciones */
    --font-family: 'Poppins', sans-serif;
    --transition-speed: 400ms;
    --logo-animation-duration: 1.2s;
    --preloader-duration: 4s; /* Duración extendida del preloader */

    /* Sombras */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 25px -5px rgba(56, 189, 248, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--dark-blue);
    color: var(--text-color);
    overflow-x: hidden;
}
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 100px 0; position: relative; overflow: hidden; }
.section__title { font-size: 2.5rem; font-weight: 700; color: var(--primary-color); margin-bottom: 20px; line-height: 1.2; }
.section__subtitle { font-size: 1.1rem; max-width: 600px; margin: 0 auto 40px auto; line-height: 1.7; }
.text-center { text-align: center; }

/* ======== 2. PRELOADER MEJORADO ======== */
.preloader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100vh;
    background-color: var(--dark-blue);
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    z-index: 1000;
    transition: opacity 0.8s ease-in-out;
}
.preloader__logo {
    width: 150px;
    margin-bottom: 30px;
    animation: pulse 2s infinite ease-in-out;
    transition: all var(--logo-animation-duration) cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.preloader__logo img {
    width: 100%;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.preloader__progress {
    width: 200px;
    height: 4px;
    background-color: var(--mid-blue);
    border-radius: 2px;
    overflow: hidden;
}
.preloader__progress-bar {
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    animation: load var(--preloader-duration) ease-out forwards;
}
@keyframes load { to { transform: scaleX(1); } }

body.loading-complete .preloader { opacity: 0; pointer-events: none; }

/* ======== 3. HEADER Y NAVBAR ======== */
.site-header { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; padding: 20px 5%; transition: background-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease; }
.site-header.scrolled { background-color: rgba(12, 10, 62, 0.8); backdrop-filter: blur(10px); box-shadow: var(--shadow-md); }
.navbar { display: flex; justify-content: space-between; align-items: center; max-width: 1200px; margin: 0 auto; }
.navbar__logo-placeholder { height: 80px; opacity: 0; transition: opacity var(--transition-speed) ease; }
body.loading-complete .navbar__logo-placeholder { opacity: 1; transition-delay: var(--logo-animation-duration); }
.navbar__logo-placeholder img { height: 100%; width: auto; }
.navbar__links { display: none; }
.navbar__link { color: var(--light-color); text-decoration: none; font-weight: 600; position: relative; padding: 8px 0; }
.navbar__link::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--primary-color); transition: width var(--transition-speed) ease; }
.navbar__link:hover::after { width: 100%; }
.navbar__link--admin { 
    background: linear-gradient(45deg, var(--brand-color), var(--primary-color)); 
    color: #fff !important; 
    padding: 8px 15px; 
    border-radius: 20px; 
    transition: all var(--transition-speed) ease;
}
.navbar__link--admin:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(25, 22, 245, 0.4); }
.mobile-menu__link--admin { 
    background: linear-gradient(45deg, var(--brand-color), var(--primary-color)); 
    color: #fff !important; 
    padding: 10px 20px; 
    border-radius: 25px; 
    transition: all var(--transition-speed) ease;
}
.navbar__toggle { display: block; background: transparent; border: none; cursor: pointer; z-index: 200; padding: 10px; }
.hamburger { display: block; position: relative; width: 25px; height: 3px; background-color: var(--light-color); border-radius: 3px; transition: all var(--transition-speed) ease; }
.hamburger::before, .hamburger::after { content: ''; position: absolute; width: 25px; height: 3px; background-color: var(--light-color); border-radius: 3px; transition: all var(--transition-speed) ease; }
.hamburger::before { transform: translateY(-8px); }
.hamburger::after { transform: translateY(8px); }
.navbar__toggle.active .hamburger { background: transparent; }
.navbar__toggle.active .hamburger::before { transform: rotate(45deg); }
.navbar__toggle.active .hamburger::after { transform: rotate(-45deg); }
.mobile-menu { position: fixed; top: 0; right: 0; width: 70%; max-width: 300px; height: 100vh; background-color: var(--mid-blue); z-index: 99; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2rem; transform: translateX(100%); transition: transform var(--transition-speed) ease; }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu__link { color: var(--light-color); text-decoration: none; font-size: 1.2rem; font-weight: 600; }

/* ======== 4. HERO Y BOTONES CTA ======== */
.hero { height: 100vh; display: flex; justify-content: center; align-items: center; text-align: center; color: #fff; }
.hero__video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; filter: brightness(0.8); }
.hero__overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to top, rgba(12, 10, 62, 0.9) 0%, rgba(12, 10, 62, 0.4) 100%); z-index: -1; }
.hero__title { font-size: 3rem; font-weight: 700; margin-bottom: 1rem; text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.hero__subtitle { font-size: 1.3rem; max-width: 600px; margin: 0 auto 2rem auto; font-weight: 300; text-shadow: 0 2px 5px rgba(0,0,0,0.5); }

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
}
.btn--primary {
    background-color: var(--brand-color);
    color: #fff;
    box-shadow: 0 5px 15px rgba(25, 22, 245, 0.4);
}
.btn--primary:hover {
    background-color: #fff;
    color: var(--brand-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(25, 22, 245, 0.5);
}
.btn--secondary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    margin-top: 20px;
}
.btn--secondary:hover {
    background-color: var(--primary-color);
    color: var(--dark-blue);
}

/* ======== 5. SECCIONES ======== */

/* Familia Flippers Section */
.about { background: linear-gradient(180deg, var(--dark-blue) 0%, #120f54 100%); }
.about__container { display: grid; grid-template-columns: 1fr; gap: 50px; align-items: center; }
.about__text p { line-height: 1.8; margin-bottom: 1.5rem; }
.about__highlight { font-weight: 600; color: var(--light-color); border-left: 3px solid var(--primary-color); padding-left: 15px; }
.about__image img { width: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* CTA Section */
.cta { background-image: url('seccion.jpg'); background-size: cover; background-position: center; background-attachment: fixed; padding: 120px 0; text-align: center; color: #fff; }
.cta__overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(12, 10, 62, 0.8); }
.cta__content { position: relative; z-index: 1; }
.cta__title { font-size: 2.8rem; color: #fff; }
.cta__text { max-width: 700px; margin: 0 auto; font-size: 1.2rem; line-height: 1.7; }

/* Programs Section */
.programs__grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-top: 50px; }
.program-card { background-color: var(--mid-blue); padding: 40px; border-radius: 10px; text-align: center; border: 1px solid transparent; transition: all var(--transition-speed) ease; }
.program-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-glow); border-color: var(--primary-color); }
.program-card__icon { width: 60px; height: 60px; margin: 0 auto 20px auto; background-color: rgba(56, 189, 248, 0.1); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.8rem; color: var(--primary-color); }
.program-card__title { font-size: 1.5rem; color: var(--light-color); margin-bottom: 15px; }
.program-card__description { line-height: 1.7; }

/* Schedule Section */
.schedule { background-color: var(--mid-blue); padding-top: 150px; }
.section__wave-divider { position: absolute; top: 0; left: 0; width: 100%; overflow: hidden; line-height: 0; transform: rotate(180deg); }
.section__wave-divider svg { position: relative; display: block; width: calc(100% + 1.3px); height: 80px; }
.section__wave-divider .shape-fill { fill: var(--dark-blue); }
.schedule__container { display: grid; grid-template-columns: 1fr; gap: 50px; align-items: center; }
.schedule__steps { list-style: none; }
.schedule__steps li { display: flex; align-items: flex-start; margin-bottom: 25px; font-size: 1.1rem; line-height: 1.6; }
.schedule__steps li span { display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background-color: var(--primary-color); color: var(--dark-blue); font-weight: 700; font-size: 1.2rem; margin-right: 20px; }
.schedule__image img { width: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* Contact Section */
.contact__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-top: 50px; }
.contact-card { background-color: var(--mid-blue); padding: 30px 20px; border-radius: 10px; text-decoration: none; color: var(--light-color); font-weight: 600; font-size: 1.1rem; display: flex; flex-direction: column; align-items: center; gap: 15px; transition: all var(--transition-speed) ease; }
.contact-card:hover { background-color: var(--brand-color); color: #fff; transform: translateY(-5px); }
.contact-card i { font-size: 2.5rem; color: var(--primary-color); transition: color var(--transition-speed) ease; }
.contact-card:hover i { color: #fff; }

/* ======== 6. FOOTER ======== */
.site-footer-main { background-color: var(--mid-blue); padding: 30px 0; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.9rem; }

/* ======== 7. ANIMACIONES Y RESPONSIVE ======== */
.fade-in, .slide-in-left, .slide-in-right { opacity: 0; transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in { transform: translateY(30px); }
.slide-in-left { transform: translateX(-50px); }
.slide-in-right { transform: translateX(50px); }
.fade-in.visible, .slide-in-left.visible, .slide-in-right.visible { opacity: 1; transform: translate(0, 0); }

/* Media Queries (Mobile First) */
@media (min-width: 768px) {
    .section__title { font-size: 3rem; }
    .hero__title { font-size: 4.5rem; }
    .hero__subtitle { font-size: 1.5rem; }

    .navbar__toggle { display: none; }
    .navbar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; }
    .navbar__links { display: flex; gap: 30px; align-items: center; }
    .navbar__links--left { justify-content: flex-end; }
    .navbar__links--right { justify-content: flex-start; }
    .navbar__logo-placeholder { grid-column: 2; }

    .about__container { grid-template-columns: 1fr 1fr; }
    .schedule__container { grid-template-columns: 1.2fr 1fr; }
    .schedule__image { order: 2; }
    .schedule__content { order: 1; }

    .programs__grid { grid-template-columns: 1fr 1fr; }
}

/* ======== BOTÓN SCROLL TO TOP ======== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-speed) ease;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--gradient-secondary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

.scroll-to-top svg {
    transition: transform var(--transition-speed) ease;
}

.scroll-to-top:hover svg {
    transform: translateY(-2px);
}

/* Responsive para móvil */
@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* ======== ESTILOS PARA THECODECRAK SOLUTIONS ======== */
/* Glow effect for TheCodeCrack Solutions */
.credit-link {
    color: var(--color-primary-dark);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background-color: var(--color-accent);
    box-shadow: 0 8px 25px rgba(255, 165, 0, 0.3);
    transform: translateY(-3px);
}

.credit-link:hover {
    color: var(--color-text-darck);
    background-color: transparent;
    box-shadow: none;
    transform: translateY(0px);
    border: 2px solid var(--color-accent);
}

.credit-link::after {
    content: '🚀';
    margin-left: 5px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.credit-link:hover::after {
    transform: translateX(3px) translateY(-2px);
}

.credit-text {
    margin: 20px 0 10px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.7;
}