/* ==========================================
   1. Root Variables & Base
   ========================================== */
:root {
    --primary: #4F46E5;       /* Indigo */
    --secondary: #10B981;     /* Emerald Green */
    --dark: #0F172A;          /* Slate 900 */
    --light: #F8FAFC;         /* Slate 50 */
    --text-gray: #64748B;     /* Slate 500 */
    --blue: #3B82F6;          /* Services Blue */
    --orange: #F59E0B;        /* Services Orange */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

body { 
    background-color: var(--light); 
    color: var(--dark); 
    line-height: 1.6; 
    overflow-x: hidden;
}

a { 
    text-decoration: none; 
    color: inherit; 
}

/* ==========================================
   2. Navigation, Top Bar & Sticky Header
   ========================================== */
.top-bar { 
    background: var(--dark); 
    color: #fff; 
    font-size: 0.85rem; 
    padding: 0.6rem 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

header { 
    background: #fff; 
    padding: 1rem 5%; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    transition: padding 0.3s ease, box-shadow 0.3s ease; 
}

/* Brand Logo Layout */
.brand-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    text-decoration: none;
    transition: var(--transition);
}
.brand-logo-container:hover { opacity: 0.8; }

.header-logo {
    height: 45px; 
    width: auto;
    object-fit: contain;
    margin-bottom: 4px; 
    transition: height 0.3s ease, margin-bottom 0.3s ease;
}

.header-brand-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: 0.5px;
    text-transform: uppercase; 
    transition: font-size 0.3s ease;
}

/* Header Scrolled State (Shrink Effect) */
header.scrolled {
    padding: 0.4rem 5%;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
header.scrolled .header-logo { height: 28px; margin-bottom: 0px; }
header.scrolled .header-brand-name { font-size: 0.75rem; }

nav ul { display: flex; gap: 2rem; list-style: none; align-items: center; }
nav a { font-weight: 600; color: var(--text-gray); transition: var(--transition); }
nav a:hover, nav a.active { color: var(--primary); }

.btn { padding: 0.6rem 1.5rem; border-radius: 50px; font-weight: 600; cursor: pointer; border: none; transition: var(--transition); display: inline-block; text-align: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #4338CA; box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4); }

.mobile-menu-btn { display: none; font-size: 1.5rem; background: none; border: none; cursor: pointer; color: var(--dark); }

/* ==========================================
   3. Home Hero Section (Typing Effect)
   ========================================== */
.hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(79, 70, 229, 0.85)), url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') center/cover;
    color: #fff;
    padding: 8rem 5%;
    text-align: center;
}
.hero h1 { font-size: 3.5rem; margin-bottom: 1rem; line-height: 1.2; font-weight: 700; }
.hero-subtitle { font-size: 1.4rem; margin-bottom: 2.5rem; font-weight: 300; }

.typed-text { color: var(--secondary); font-weight: 700; }
.cursor { display: inline-block; width: 3px; background-color: #fff; animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.hero-btn { font-size: 1.2rem; padding: 1rem 3rem; margin-top: 1rem; }

/* ==========================================
   4. Global Grid & Section Headers
   ========================================== */
.section-header { text-align: center; margin: 5rem 0 3rem; }
.section-header h2 { font-size: 2.5rem; color: var(--dark); margin-bottom: 1rem; }
.section-subtitle { color: var(--text-gray); }

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2rem; 
    padding: 0 5%; 
    max-width: 1400px; 
    margin: 0 auto; 
}

/* ==========================================
   5. Services Section
   ========================================== */
.services-section { padding-bottom: 2rem; }
.service-card {
    background: #fff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: var(--transition);
}
.service-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }

.border-blue { border-left: 4px solid var(--blue); }
.border-green { border-left: 4px solid var(--secondary); }
.border-orange { border-left: 4px solid var(--orange); }
.icon-blue { color: var(--blue); }
.icon-green { color: var(--secondary); }
.icon-orange { color: var(--orange); }

.service-title { font-size: 1.25rem; color: var(--dark); margin-bottom: 1rem; display: flex; align-items: center; }
.service-title i { margin-right: 12px; font-size: 1.4rem; }
.service-desc { color: var(--text-gray); font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.6; }
.service-list { list-style: none; color: var(--text-gray); font-size: 0.95rem; line-height: 2; }
.service-list li { display: flex; align-items: center; }
.service-list i { margin-right: 10px; font-size: 0.9rem; }

/* ==========================================
   6. Course Cards (Home Grid)
   ========================================== */
.course-card { 
    background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.03); 
    transition: var(--transition); border: 1px solid #E2E8F0; display: flex; flex-direction: column; 
}
.course-card:hover { transform: translateY(-8px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); border-color: var(--primary); }
.course-img { width: 100%; height: 220px; object-fit: cover; }
.course-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }

.tags { margin-bottom: 1rem; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { background: #E0E7FF; color: var(--primary); padding: 0.4rem 1rem; border-radius: 20px; font-size: 0.8rem; font-weight: 600; }

.course-title { font-size: 1.25rem; margin-bottom: 0.5rem; color: var(--dark); }
.course-desc { color: var(--text-gray); margin-bottom: 1rem; font-size: 0.95rem; }

.course-meta {
    margin-top: auto; padding-top: 1rem; border-top: 1px solid #F1F5F9; 
    display: flex; justify-content: space-between; align-items: center; 
    color: var(--text-gray); font-size: 0.9rem; flex-wrap: wrap; gap: 10px;
}
.course-actions { display: flex; gap: 10px; }
.action-link { padding: 0.4rem 0.8rem; border-radius: 6px; font-weight: 600; font-size: 0.85rem; transition: var(--transition); }
.action-link.outline { border: 1px solid var(--primary); color: var(--primary); }
.action-link.outline:hover { background: var(--primary); color: #fff; }
.action-link.fill { background: var(--primary); color: #fff; }
.action-link.fill:hover { background: #4338CA; }

/* ==========================================
   7. Testimonials (Infinite Marquee)
   ========================================== */
.testimonials-section { background-color: #F1F5F9; padding-bottom: 5rem; margin-top: 5rem; padding-top: 1px; overflow: hidden; }
.testimonials-wrapper { width: 100%; padding: 1rem 0; position: relative; overflow: hidden; }
.testimonials-track { display: flex; gap: 2rem; width: max-content; }
.slide-group { display: flex; gap: 2rem; flex-shrink: 0; animation: scrollTestimonials 35s linear infinite; }
.testimonials-track:hover .slide-group { animation-play-state: paused; }

.testimonial-card { 
    width: 400px; flex-shrink: 0; background: #fff; padding: 2rem; border-radius: 16px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column; border: 1px solid #E2E8F0; 
}
.stars { color: #F59E0B; margin-bottom: 1rem; font-size: 0.9rem; }
.review-text { color: var(--dark); font-style: italic; margin-bottom: 1.5rem; flex: 1; line-height: 1.7; }
.student-info { display: flex; align-items: center; gap: 1rem; border-top: 1px solid #E2E8F0; padding-top: 1rem; }
.avatar { width: 45px; height: 45px; background: var(--primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.2rem; }
.student-info h4 { font-size: 1rem; color: var(--dark); }
.student-info p { font-size: 0.85rem; color: var(--text-gray); }

@keyframes scrollTestimonials {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100% - 2rem)); }
}

/* ==========================================
   8. Expanded SEO Mega Footer
   ========================================== */
.site-footer { background: var(--dark); color: #fff; padding: 4rem 5% 2rem; border-top: 4px solid var(--primary); }

.footer-grid { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; }
.footer-brand h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.footer-brand span { color: var(--primary); }
.footer-brand p { color: var(--text-gray); font-size: 0.95rem; margin-bottom: 1.5rem; padding-right: 2rem;}

.social-links { display: flex; gap: 1rem; }
.social-links a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: rgba(255,255,255,0.1); border-radius: 50%; color: #fff; transition: var(--transition); }
.social-links a:hover { background: var(--primary); transform: translateY(-3px); }

.footer-links h3 { font-size: 1.2rem; margin-bottom: 1.2rem; color: #fff; }
.footer-links ul { list-style: none; color: var(--text-gray); font-size: 0.95rem; }
.footer-links li { margin-bottom: 0.8rem; }
.footer-links a { transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-left: 5px;}

.footer-bottom { 
    max-width: 1400px; margin: 3rem auto 0; padding-top: 1.5rem; 
    border-top: 1px solid rgba(255,255,255,0.1); display: flex; 
    justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; 
}
.copyright { color: var(--text-gray); font-size: 0.85rem; }
.legal-links { display: flex; gap: 1.5rem; font-size: 0.85rem; color: var(--text-gray); }
.legal-links a:hover { color: #fff; }

/* ==========================================
   9. Floating WhatsApp Button
   ========================================== */
.whatsapp-float { 
    position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; 
    background-color: #25D366; color: #FFF; border-radius: 50px; text-align: center; 
    font-size: 35px; box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.15); z-index: 1000; 
    display: flex; align-items: center; justify-content: center; transition: var(--transition); 
    animation: pulse-whatsapp 2s infinite; 
}
.whatsapp-float:hover { transform: scale(1.1); background-color: #128C7E; color: #fff; box-shadow: 2px 2px 20px rgba(0, 0, 0, 0.25); animation: none; }
@keyframes pulse-whatsapp { 0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); } 70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); } 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } }

/* ==========================================
   10. Course Landing Page Specifics
   ========================================== */
.course-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(16, 185, 129, 0.85)), url('https://images.unsplash.com/photo-1551288049-bebda4e38f71?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') center/cover;
    color: #fff; padding: 6rem 5%; text-align: center;
}
.course-hero-content { max-width: 800px; margin: 0 auto; }
.course-hero h1 { font-size: 3rem; margin-bottom: 1rem; line-height: 1.2; font-weight: 700; }
.course-hero p { font-size: 1.1rem; opacity: 0.9; }

.course-stats-container { background: #fff; padding: 2rem 5%; border-bottom: 1px solid #E2E8F0; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; max-width: 1400px; margin: 0 auto; text-align: center; }
.stat-box i { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; }
.stat-box h4 { color: var(--text-gray); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; }
.stat-box p { color: var(--dark); font-weight: 600; font-size: 1.1rem; }

/* Interactive Accordion */
.accordion { display: flex; flex-direction: column; gap: 1rem; }
.accordion-item { border: 1px solid #E2E8F0; border-radius: 8px; background: #fff; overflow: hidden; }
.accordion-header { width: 100%; padding: 1.2rem 1.5rem; display: flex; justify-content: space-between; align-items: center; background: #F8FAFC; border: none; cursor: pointer; font-size: 1.05rem; font-weight: 600; color: var(--dark); text-align: left; transition: var(--transition); }
.accordion-header:hover { background: #F1F5F9; }
.accordion-header i { transition: transform 0.3s ease; color: var(--primary); }
.accordion-header.active i { transform: rotate(180deg); }
.accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; background: #fff; }
.accordion-body ul { padding: 1.5rem 1.5rem 1.5rem 3rem; color: var(--text-gray); line-height: 1.8; }
.accordion-body li { margin-bottom: 0.5rem; }

/* Enrollment Form */
.enroll-form-card { background: #fff; padding: 2.5rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); border-top: 5px solid var(--secondary); position: sticky; top: 100px; }
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--dark); }
.form-group input, .form-group select { width: 100%; padding: 0.9rem 1.2rem; border: 1px solid #CBD5E1; border-radius: 8px; font-size: 1rem; font-family: inherit; transition: border-color 0.3s ease; background: #F8FAFC; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--primary); background: #fff; }

/* ==========================================
   11. Courses Catalog Page Specifics
   ========================================== */
.courses-catalog-hero { background: var(--dark); color: #fff; padding: 6rem 5% 4rem; text-align: center; }
.courses-catalog-hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.courses-catalog-hero p { color: var(--text-gray); margin-bottom: 2.5rem; font-size: 1.1rem; }

.course-dropdown-container { position: relative; max-width: 600px; margin: 0 auto; }
.dropdown-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--primary); font-size: 1.2rem; pointer-events: none; }
.dropdown-arrow { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); color: var(--dark); pointer-events: none; }
#courseJumpDropdown { width: 100%; padding: 1.2rem 3rem 1.2rem 3.5rem; font-size: 1.1rem; border: none; border-radius: 50px; background: #fff; color: var(--dark); font-family: inherit; font-weight: 600; cursor: pointer; appearance: none; -webkit-appearance: none; box-shadow: 0 10px 25px rgba(0,0,0,0.2); transition: var(--transition); }
#courseJumpDropdown:focus { outline: none; box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.3); }

.course-catalog-wrapper { max-width: 1200px; margin: 4rem auto; padding: 0 5%; }
.catalog-section { display: flex; align-items: center; gap: 4rem; padding: 4rem 0; border-bottom: 1px solid #E2E8F0; }
.catalog-section.reverse { flex-direction: row-reverse; }
.catalog-section:last-child { border-bottom: none; }
.catalog-content { flex: 1; }
.catalog-content h2 { font-size: 2rem; color: var(--dark); margin-bottom: 1rem; }
.catalog-content p { color: var(--text-gray); margin-bottom: 1.5rem; font-size: 1.05rem; }
.catalog-highlights { list-style: none; color: var(--dark); }
.catalog-highlights li { margin-bottom: 0.5rem; display: flex; align-items: center; }
.catalog-highlights i { color: var(--secondary); margin-right: 10px; }
.catalog-image { flex: 1; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
.catalog-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: var(--transition); }
.catalog-image:hover img { transform: scale(1.05); }

/* ==========================================
   12. Responsive Media Queries
   ========================================== */
@media (max-width: 992px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: span 2; }
    .footer-brand p { padding-right: 0; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.1rem; }
    
    /* Mobile Navigation */
    nav ul { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; width: 100%; background: #fff; padding: 1rem 5%; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
    nav ul.active { display: flex; }
    .mobile-menu-btn { display: block; }
    
    /* Header shrink adjustments for mobile */
    header.scrolled { padding: 0.8rem 5%; }
    
    /* Responsive Course Meta */
    .course-meta { flex-direction: column; align-items: flex-start; }
    .course-actions { width: 100%; justify-content: space-between; margin-top: 10px; }
    
    /* Testimonials Mobile Adjustment */
    .testimonial-card { width: 320px; padding: 1.5rem; }
    .slide-group { gap: 1.5rem; }
    .testimonials-track { gap: 1.5rem; }
    @keyframes scrollTestimonials {
        0% { transform: translateX(0); }
        100% { transform: translateX(calc(-100% - 1.5rem)); }
    }
    
    /* Footer Mobile Adjustment */
    .footer-grid { grid-template-columns: 1fr; }
    .footer-brand { grid-column: span 1; }
    .footer-bottom { flex-direction: column; text-align: center; justify-content: center; }
    
    /* Course Landing Pages Mobile */
    .course-hero h1 { font-size: 2.2rem; }
    .enroll-form-card { padding: 1.5rem; position: static; }
    
    /* Course Catalog Layout Mobile */
    .catalog-section, .catalog-section.reverse { flex-direction: column-reverse; gap: 2rem; padding: 3rem 0; text-align: center; }
    .catalog-highlights li { justify-content: center; }
    .course-actions { justify-content: center; }

    /* Floating Chat */
    .whatsapp-float { bottom: 20px; right: 20px; width: 50px; height: 50px; font-size: 28px; }
}


/* =========================================
   RESPONSIVE HEADER & NAVIGATION
   ========================================= */

/* Main Header Container */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Logo Branding */
.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #0F172A; /* Dark text */
}

.header-logo {
    height: 40px;
    width: auto;
}

.header-brand-name {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Desktop Navigation */
nav ul {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

    nav ul li a {
        text-decoration: none;
        color: #475569;
        font-weight: 500;
        font-size: 1rem;
        transition: color 0.3s ease;
    }

        nav ul li a:hover {
            color: #3B82F6; /* Escon Blue */
        }

/* Mobile Menu Button - Hidden on Desktop */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #0F172A;
    cursor: pointer;
}

/* =========================================
   MOBILE RESPONSIVE RULES (Max Width: 768px)
   ========================================= */
@media (max-width: 768px) {
    /* Show the hamburger menu icon */
    .mobile-menu-btn {
        display: block;
    }

    /* Hide the horizontal menu and prepare for vertical dropdown */
    nav ul {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%; /* Push right below the header */
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        padding: 1.5rem 5%;
        gap: 1.5rem;
        box-sizing: border-box;
    }

        /* This class is added via JavaScript when the button is clicked */
        nav ul.active {
            display: flex;
        }

        /* Make the Sign In button span the full width on mobile */
        nav ul li .btn {
            width: 100%;
            text-align: center;
            display: block;
        }
}


/* =========================================
   BLOG POST HEADER (STICKY & MINIMIZE)
   ========================================= */

.blog-post-header {
    background: rgba(248, 250, 252, 0.95); /* Slightly transparent background */
    backdrop-filter: blur(10px); /* Blurs the text sliding under it */
    padding: 4rem 5% 3rem;
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 72px; /* Sits exactly under your main navigation bar */
    z-index: 900;
    transition: all 0.4s ease;
}

.blog-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    transition: all 0.4s ease;
}

/* Base Styles for Header Elements */
.blog-post-header .category-tag {
    background: #E0E7FF;
    color: #4F46E5;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    opacity: 1;
    max-height: 50px;
    overflow: hidden;
}

.blog-post-header .post-title {
    font-size: 2.8rem;
    color: #0F172A;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    transition: all 0.4s ease;
}

.blog-post-header .meta-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    color: #64748B;
    font-size: 0.95rem;
    transition: all 0.4s ease;
    opacity: 1;
    max-height: 50px;
    overflow: hidden;
}

/* =========================================
   THE MINIMIZED STATE (Triggered by JS)
   ========================================= */
.blog-post-header.minimized {
    padding: 1rem 5%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

    /* Hide the Tag and Meta Info completely */
    .blog-post-header.minimized .category-tag,
    .blog-post-header.minimized .meta-info {
        opacity: 0;
        max-height: 0;
        margin-bottom: 0;
    }

    /* Shrink the Title and keep it on one line */
    .blog-post-header.minimized .post-title {
        font-size: 1.2rem;
        margin-bottom: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis; /* Adds "..." if the title is too long */
    }