/* ============================================
   GLOBAL STYLES & THEME VARIABLES
============================================ */
:root {
    /* Style A: Modern Blue Professional Palette */
    --color-primary-dark: #0057D9; /* Dark Blue */
    --color-primary: #0A64FF; /* Accent Blue */
    --color-accent: #FFC000; /* Gold/Yellow Accent */
    --color-dark: #1A1D3A;
    --color-light: #ffffff;
    --color-muted: #6b7280;

    /* Backgrounds */
    --bg-light-tint: #F7F8FF; /* Soft light blue for section separation */
    --bg-white: #ffffff;

    /* Typography */
    --font-primary: 'Poppins', sans-serif, 'Noto Sans Tamil';
    --font-secondary: 'Noto Sans Tamil', 'Poppins', sans-serif;

    /* Design */
    --radius: 16px;
    --shadow-soft: 0 8px 25px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 12px 35px rgba(0, 0, 0, 0.2);
    --ease: cubic-bezier(.2, .9, .3, 1);
}

/* Global Reset/Base */
body {
    font-family: var(--font-primary);
    background-color: var(--bg-white);
    line-height: 1.6;
}

/* Tamil Font Styling for Translation */
.goog-text-gothic, .goog-te-spinner-pos {
    font-family: var(--font-secondary) !important;
}
.goog-text-gothic * {
    font-family: var(--font-secondary) !important;
    line-height: 1.8; /* Increased line height for better Tamil readability */
}

/* GLOBAL REUSABLES */
.section-title {
    text-align: center;
    font-size: clamp(24px, 4vw, 38px);
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--color-dark);
    text-transform: uppercase;
}

.section-title span {
    color: var(--color-primary);
}

.center-btn {
    text-align: center;
    margin-top: 40px;
}

/* Redesigned Enroll Button */
.enroll-btn {
    display: inline-block;
    padding: 14px 40px;
    background: var(--color-primary);
    color: var(--color-light) !important;
    text-decoration: none;
    border-radius: 999px; /* Pill shape */
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(10, 100, 255, 0.3);
    transition: all 0.3s var(--ease);
}
.enroll-btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(10, 100, 255, 0.45);
}

/* ============================================
   CSS ANIMATIONS
============================================ */

/* Fade-In Scroll Animation */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s var(--ease) forwards;
}
@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply staggered animation delays using data attributes in index.php */
.fade-up:nth-child(1) { animation-delay: 0.1s; }
.fade-up:nth-child(2) { animation-delay: 0.2s; }
.fade-up:nth-child(3) { animation-delay: 0.3s; }
.fade-up:nth-child(4) { animation-delay: 0.4s; }
.fade-up:nth-child(5) { animation-delay: 0.5s; }
.fade-up:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   HERO SECTION
============================================ */
.hero-section {
    width: 100%;
    padding: 120px 20px 80px;
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, rgba(10, 100, 255, 0.8) 100%), url("assets/img/background1.avif") center/cover no-repeat;
    color: var(--color-light);
}

.hero-container {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 400px;
    align-items: center;
    gap: 40px;
}

.hero-text h1 {
    font-size: clamp(30px, 5vw, 50px);
    margin-bottom: 5px;
    font-weight: 900;
    line-height: 1.1;
    text-transform: uppercase;
}
.hero-text h2 {
    font-size: clamp(20px, 3vw, 32px);
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--color-accent);
}
.hero-tagline {
    opacity: 0.9;
    margin-bottom: 25px;
    font-size: 17px;
}
.hero-badges span {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 999px;
    margin-right: 10px;
    display: inline-block;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

/* FORM CARD (Redesigned) */
.hero-form-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-strong);
}

.hero-form-card h3 {
    margin-bottom: 25px;
    color: var(--color-primary-dark);
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-form-card label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--color-dark);
    font-weight: 600;
}

.hero-form-card input,
.hero-form-card textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    font-family: var(--font-primary);
    transition: border-color 0.3s;
}

.hero-form-card input:focus,
.hero-form-card textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}

.hero-form-card button {
    width: 100%;
    padding: 14px;
    background: var(--color-primary);
    color: var(--color-light);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(10, 100, 255, 0.2);
    transition: all 0.3s var(--ease);
}
.hero-form-card button:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 100, 255, 0.4);
}

/* ============================================
   ACHIEVERS SLIDER (CSS ONLY)
============================================ */
.achievers-section {
    padding: 40px 0;
    background: var(--bg-light-tint);
}

.achievers-container {
    overflow: hidden;
    width: 100%;
    position: relative;
    margin: 20px 0;
}

.achievers-row {
    display: flex;
    width: max-content; /* Critical for infinite scroll */
    gap: 20px;
}

.achievers-row.slider-top {
    animation: slide 55s linear infinite;
}

.achievers-row.slider-bottom {
    animation: slideReverse 55s linear infinite;
}

.achiever-card {
    min-width: 320px; /* Base width for desktop card */
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 10px;
    box-shadow: var(--shadow-soft);
    flex-shrink: 0; /* Prevents shrinking on smaller screens */
}

.achiever-card img {
    width: 100%;
    height: 300px;
    border-radius: 12px;
    display: block;
}

/* Continuous sliding keyframes */
@keyframes slide {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); } /* Scrolls exactly one full set of images */
}
@keyframes slideReverse {
    0% { transform: translateX(-50%); } /* Starts half-way through the duplicated content */
    100% { transform: translateX(0); }
}

/* === GRID LAYOUT FOR 4 CHARTS === */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 40px;
}

/* Box around each chart */
.chart-box {
    background: var(--bg-light-tint);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    text-align: center;
    height: 260px;
    position: relative;
}

/* Chart canvas */
.chart-box canvas {
    width: 100% !important;
    height: 180px !important;
}

/* Title below each chart */
.chart-title {
    margin-top: 10px;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary-dark);
}

.future-msg {
    font-size: 13px;
    color: #555;
    margin-top: 5px;
    font-style: italic;
}

/* === MOBILE: 1 COLUMN === */
@media (max-width: 768px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}


/* ============================================
   ADMISSIONS (FLIP CARD REDESIGN)
============================================ */
.admission-section {
    padding: 80px 20px;
    background: #eaf1ff; /* Slightly deeper blue tint */
}

.admission-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Redesigned Card (Removing 3D transform for better stability/bilingual support) */
.flip-card {
    /* Retaining class name for content but changing structure */
    width: 100%;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.4s;
    min-height: 480px; /* Increased height for full content fit */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.flip-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Styling for the content areas */
.flip-front, .flip-back {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.4s;
}

.flip-card:hover .flip-front {
    background: var(--bg-light-tint); /* Subtle background shift on hover */
}

.flip-icon {
    font-size: 50px;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.flip-front h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-dark);
    margin-top: 10px;
    text-transform: uppercase;
}

.flip-front p {
    color: var(--color-muted);
    font-size: 16px;
    margin-top: 5px;
}

.read-more-btn {
    padding: 10px 25px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s;
}
.read-more-btn:hover {
    background: var(--color-primary-dark);
}

/* BACK CONTENT */
.flip-back {
    /* Default is hidden - to be shown on click/active */
    display: none;
    height: 100%;
}
.flip-card.active .flip-front {
    display: none;
}
.flip-card.active .flip-back {
    display: flex;
    background: var(--color-primary-dark);
    color: var(--color-light);
    border-radius: var(--radius);
}
.flip-card.active .card-points i {
    color: var(--color-accent);
}

.card-points {
    text-align: left;
    line-height: 1.8; /* Increased line height for better readability, especially Tamil */
    font-size: 18px;
    width: 100%;
    margin-bottom: 20px;
}
.card-points i {
    width: 20px;
    margin-right: 8px;
}

.enroll-btn-small {
    /* Reused global enroll-btn style, customized for card */
    display: inline-block;
    padding: 10px 25px;
    background: var(--color-accent);
    color: var(--color-dark);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(255, 192, 0, 0.4);
    transition: transform 0.3s;
}
.enroll-btn-small:hover {
    transform: translateY(-3px);
}

/* ============================================
   GALLERY SECTION
============================================ */
.gallery-section {
    padding: 60px 20px;
    background: var(--bg-white);
}

.gallery-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.gallery-item {
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

/* ============================================
   FEATURES (WHY CHOOSE)
============================================ */
.features-section {
    padding: 60px 20px;
    background: var(--bg-light-tint);
}

.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    font-size: 40px;
    color: var(--color-primary);
    margin-bottom: 15px;
}
.feature-card h3 {
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 5px;
    text-transform: uppercase;
}
.feature-card p {
    font-size: 16px;
    color: var(--color-muted);
}

/* ============================================
   VISION / MISSION + FINAL SECTION
============================================ */
.vision-mission-section {
    padding: 60px 20px;
    background: var(--bg-white);
}

.vm-container {
    max-width: 1200px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
}

.vm-box {
    background: var(--bg-light-tint);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.vm-box h2 {
    font-size: 28px;
    color: var(--color-primary-dark);
    margin-bottom: 10px;
    font-weight: 800;
    text-transform: uppercase;
}
.vm-box p {
    font-size: 17px;
}

.future-section {
    margin-top: 40px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.future-section h2 {
    font-size: 28px;
    color: var(--color-dark);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.future-img-box {
    width: 100%;
    height: 250px;
    background: #eaf1ff;
    border-radius: var(--radius);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 24px;
}

/* ============================================
   RESPONSIVE OVERRIDES
============================================ */
@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-form-card {
        max-width: 400px;
        margin: 0 auto;
    }
    .hero-text h1, .hero-text h2 {
        text-align: center;
    }
    .hero-badges {
        justify-content: center;
    }
    /* Achievers slider card width adjustment */
    .achiever-card {
        min-width: 250px;
    }
}

@media (max-width: 600px) {
    /* Mobile-First Spacing */
    .hero-section,
    .achievers-section,
    .admission-section,
    .graph-section,
    .gallery-section,
    .features-section,
    .vision-mission-section {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Small adjustments for extreme mobile */
    .section-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
    .hero-text h1 {
        font-size: 32px;
    }
    .hero-text h2 {
        font-size: 22px;
    }
    .achiever-card {
        min-width: 200px;
    }
    
    /* Ensure cards stack nicely */
    .admission-grid,
    .features-grid,
    .vm-container {
        grid-template-columns: 1fr;
    }

    .flip-card {
        min-height: auto;
    }
    .card-points {
        font-size: 16px;
    }
}