/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --primary-color: #004d66;   /* Deep Blue */
    --secondary-color: #ffcc00; /* Gold/Yellow */
    --accent-color: #3498db;    /* Bright Blue */
    --light-bg: #f0f5f7;
    --text-color: #4a4a4a;
    --white: #ffffff;
    --danger: #e74c3c;
    --success: #27ae60;
}

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--light-bg);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
header {
    background-color: var(--white);
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 9999;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mobile Toggle Button */
.nav-toggle {
    display: none; /* Hidden on Desktop */
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Nav Menu (Desktop Default) */
.nav-menu {
    display: block;
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 25px;
    align-items: center;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
    font-weight: bold;
}

.cta-button {
    background-color: var(--secondary-color);
    color: var(--primary-color);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background-color: #e6b800;
}

/* =========================================
   3. MOBILE MENU LOGIC
   ========================================= */
@media (max-width: 768px) {
    .nav-toggle {
        display: block; /* Show button on mobile */
    }

    .nav-menu {
        display: none; /* Hide menu by default on mobile */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        padding: 20px;
        z-index: 1000;
    }

    .nav-menu.active {
        display: block; /* Show when 'active' class is added */
    }

    .nav-links {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 10px;
        font-size: 1.1rem;
    }
}

/* =========================================
   4. HOME PAGE SECTIONS
   ========================================= */
.hero {
    height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('assets/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
}

.hero-overlay { padding: 20px; }
.hero-overlay h1 { font-size: 2.5em; margin-bottom: 10px; font-weight: 700; }
.hero-overlay p { font-size: 1.2em; font-weight: 300; margin-bottom: 20px; }

/* Grids */
.teacher-grid, .resource-grid, .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

/* Cards */
.teacher-card, .teacher-resource-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s;
}
.teacher-card:hover, .teacher-resource-card:hover { transform: translateY(-5px); }

.teacher-card img, .teacher-resource-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--secondary-color);
    margin-bottom: 15px;
}

/* PDF Links */
.pdf-links a, .resource-links a {
    background-color: var(--light-bg);
    color: var(--primary-color);
    text-decoration: none;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    transition: 0.3s;
}
.pdf-links a:hover, .resource-links a:hover {
    background-color: var(--primary-color);
    color: white;
}
.pdf-links a:hover i, .resource-links a:hover i {
    color: white;
}

/* --- RESTORED: ATTRACTIVE INFO SECTION (ARMED FORCES & NEWS) --- */
.container { padding: 60px 20px; max-width: 1200px; margin: 0 auto; }

.info-section { display: flex; flex-direction: column; gap: 30px; padding: 30px 20px; }
@media (min-width: 768px) { .info-section { flex-direction: row; } }

.info-column { flex: 1; background: white; padding: 30px; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* Headers inside Info Section */
.armed-forces-offer h2, .news-events h2 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 1.8rem;
    text-align: center;
}

/* Attributes Grid (The Icons) */
.attributes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 25px;
    text-align: center;
}

.attribute-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.attribute-item i {
    font-size: 2.5em;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.attribute-item h3 {
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.info-cta-button {
    background-color: var(--accent-color);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 30px;
    transition: background-color 0.3s ease;
    display: inline-block;
    font-weight: bold;
    text-align: center;
}
.info-cta-button:hover { background-color: #2980b9; }

/* News & Events Styling */
.news-events article {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.news-events h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.news-events p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #888;
}

.news-events a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

/* --- RESTORED: TESTIMONIALS --- */
.testimonials {
    padding: 60px 20px;
    text-align: center;
    background-color: #f9f9f9;
}

.testimonials h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
}

.testimonial-card {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.student-name {
    font-weight: bold;
    font-style: normal;
    color: var(--primary-color);
    margin-top: 15px;
    display: block;
}

@media (min-width: 768px) {
    .testimonial-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Footer */
footer { background-color: var(--primary-color); color: white; padding: 40px 20px; text-align: center; }
.footer-container { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
@media (min-width: 768px) { .footer-container { flex-direction: row; justify-content: space-around; text-align: left; } }
.footer-section a { color: white; text-decoration: none; }

/* =========================================
   5. PORTAL: DASHBOARD & LOGIN
   ========================================= */
.login-body {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.input-field {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px; /* Space between inputs */
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}
.login-btn:hover { background: #003344; }

.welcome-banner {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.test-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-top: 5px solid var(--primary-color);
    text-align: center;
    transition: transform 0.3s;
}
.test-card:hover { transform: translateY(-5px); }

.btn-start {
    display: block;
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    border: none;
    cursor: pointer;
}
.btn-start:hover { background: #003344; }

/* =========================================
   6. PORTAL: TEST WINDOW (Exam Mode)
   ========================================= */
.test-wrapper {
    max-width: 900px;
    margin: 30px auto;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.timer-box {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--danger);
    background: #fff0f0;
    padding: 5px 15px;
    border-radius: 5px;
    border: 1px solid #ffcccc;
}

.question-box {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
    line-height: 1.6;
}

.image-container {
    text-align: center;
    margin: 15px 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.test-image {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

/* Exam Options */
.option-label {
    display: block;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.05rem;
}
.option-label:hover { background-color: #f9f9f9; border-color: #ddd; }
.active-option {
    border-color: var(--accent-color);
    background-color: #eef7ff;
    font-weight: bold;
    color: var(--primary-color);
}

/* Exam Buttons */
.nav-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.btn-nav {
    padding: 10px 25px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    background: #eee;
    color: #555;
    transition: 0.3s;
}
.btn-nav:hover:not(:disabled) { background: #ddd; }
.btn-nav:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-next { background: var(--primary-color); color: white; }
.btn-next:hover:not(:disabled) { background: #003344; }
.btn-submit { background: var(--success); color: white; display: none; }
.btn-submit:hover { background: #219150; }

/* =========================================
   7. RESULTS & LEADERBOARD
   ========================================= */
.score-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    min-width: 150px;
    margin: 10px;
    border: 1px solid #ddd;
    text-align: center;
}
.score-val { font-size: 2.5rem; font-weight: bold; color: var(--primary-color); }

.rank-card {
    background: white;
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-left: 5px solid transparent;
}
.rank-card.me { border-left-color: var(--primary-color); background-color: #eef6f8; }

.medal-1 { color: #FFD700; font-size: 1.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.medal-2 { color: #C0C0C0; font-size: 1.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.medal-3 { color: #CD7F32; font-size: 1.5rem; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Question Analysis */
.question-card {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 5px solid #ccc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.status-correct { border-left-color: var(--success); background: #eafaf1; }
.status-wrong { border-left-color: var(--danger); background: #fdedec; }
.ans-row { display: flex; gap: 20px; margin-top: 10px; font-weight: bold; }
.correct-ans { color: var(--success); }
.your-ans { color: #555; }

/* =========================================
   8. LIVE CLASSES (Pulse Animation)
   ========================================= */
.live-header h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.live-dot {
    height: 12px;
    width: 12px;
    background-color: var(--danger);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(231, 76, 60, 0); }
    100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

.schedule-container {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-top: 30px;
}

.class-row {
    display: flex;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid #eee;
    transition: 0.3s;
}
.class-row:hover { background: #fcfcfc; }

.time-box {
    flex: 1;
    text-align: center;
    border-right: 2px solid var(--accent-color);
}
.time { font-size: 1.2rem; font-weight: bold; color: var(--text-color); display: block; }
.date { font-size: 0.8rem; color: #7f8c8d; }

.class-details { flex: 3; padding: 0 30px; }
.class-details h3 { margin: 0; color: var(--text-color); }
.class-details p { margin: 5px 0 0; color: #7f8c8d; }

.action-box { flex: 1; text-align: right; }
.join-btn {
    background: var(--success);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}
.waiting-label { color: #f39c12; font-weight: bold; font-style: italic; }

@media (max-width: 768px) {
    .class-row { flex-direction: column; text-align: center; gap: 15px; }
    .time-box { border-right: none; border-bottom: 2px solid var(--accent-color); padding-bottom: 10px; width: 100%; }
    .action-box { text-align: center; }
}

/* =========================================
   9. TABLES & ABOUT PAGE & MISC
   ========================================= */
.table-responsive {
    overflow-x: auto;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin: 30px 0;
}

.fee-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.fee-table th {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    text-align: left;
}

.fee-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: var(--text-color);
}

.fee-table tr:hover { background-color: #f9f9f9; }
.fee-table td:last-child { font-weight: bold; color: var(--primary-color); }

.about-card {
    background: white;
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}
.about-section h2 {
    color: var(--primary-color);
    border-left: 5px solid var(--secondary-color);
    padding-left: 15px;
    margin-top: 30px;
}

/* FAQ */
.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease;
}
.faq-item:hover { transform: translateY(-3px); }
.faq-item h3 { color: var(--primary-color); margin-bottom: 15px; font-size: 1.2rem; }
.faq-item h3::before { content: "Q."; margin-right: 10px; color: var(--secondary-color); font-weight: bold; }
.faq-item p { color: var(--text-color); line-height: 1.7; margin: 0; } 

/* Video Grid (For Free Classes) */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.video-card:hover { transform: translateY(-5px); }

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info { padding: 20px; }
.video-info h3 { margin: 0 0 5px; font-size: 1.2rem; color: var(--primary-color); }
.video-info p { color: #7f8c8d; font-size: 0.9rem; margin: 0; }

/* Floating Install Button */
#pwa-install-btn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #27ae60;
    color: white;
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    border: none;
    z-index: 1000;
    cursor: pointer;
    animation: bounce 2s infinite;
}

#pwa-install-btn i { margin-right: 8px; }

/* iOS Instructions Banner */
#ios-install-banner {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1001;
    text-align: center;
    font-size: 0.9rem;
    color: #333;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}