/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --primary-color: #1a237e; /* Deep Blue */
    --secondary-color: #ffd700; /* Gold */
    --text-color: #333;
    --light-bg: #f4f6f8;
    --white: #ffffff;
    --nav-height: 70px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    padding-top: var(--nav-height); /* Space for Fixed Navbar */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* =========================================
   2. NAVBAR (Common for All Pages)
   ========================================= */
.navbar {
    background-color: var(--primary-color);
    height: var(--nav-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    position: fixed;
    top: 0; left: 0; width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo { font-size: 1.6rem; font-weight: 700; color: var(--white); letter-spacing: 1px; }
.nav-links { list-style: none; display: flex; gap: 20px; align-items: center; }
.nav-links a { color: var(--white); text-decoration: none; font-weight: 500; transition: 0.3s; font-size: 0.95rem; }
.nav-links a:hover { color: var(--secondary-color); }

/* Admin/Logout Button in Nav */
.admin-btn, #logoutBtn {
    border: 1px solid var(--secondary-color);
    padding: 6px 18px;
    border-radius: 20px;
    color: var(--secondary-color) !important;
    font-size: 0.9rem;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    transition: 0.3s;
}
.admin-btn:hover, #logoutBtn:hover {
    background: var(--secondary-color);
    color: var(--primary-color) !important;
}

/* =========================================
   3. HOME PAGE STYLES
   ========================================= */
.hero {
    min-height: 90vh;
    background: linear-gradient(135deg, var(--primary-color), #3949ab);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10%;
    color: var(--white);
}
.hero-content { max-width: 600px; }
.hero-content h1 { font-size: 3.2rem; margin-bottom: 20px; line-height: 1.2; }
.hero-content p { font-size: 1.2rem; margin-bottom: 30px; opacity: 0.9; }
.hero-image i { font-size: 12rem; color: rgba(255,255,255,0.15); }

/* Buttons */
.btn-primary { background: var(--secondary-color); color: var(--primary-color); padding: 12px 30px; border-radius: 30px; font-weight: bold; border: none; cursor: pointer; transition: 0.3s; font-size: 1rem; }
.btn-primary:hover { transform: scale(1.05); box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3); }
.btn-secondary { border: 2px solid var(--secondary-color); color: var(--secondary-color); padding: 10px 25px; border-radius: 30px; font-weight: bold; background: transparent; cursor: pointer; }
.btn-secondary:hover { background: var(--secondary-color); color: var(--primary-color); }

/* Sections */
.section { padding: 80px 10%; text-align: center; }
.bg-white { background: var(--white); }
.section-title { font-size: 2.2rem; color: var(--primary-color); margin-bottom: 50px; position: relative; display: inline-block; }
.section-title::after { content: ''; width: 60px; height: 4px; background: var(--secondary-color); position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); border-radius: 2px; }

/* Feature Cards */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; }
.card { background: var(--white); padding: 30px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); transition: 0.3s; border: 1px solid #eee; cursor: pointer; }
.card:hover { transform: translateY(-10px); border-color: var(--primary-color); }
.card i { font-size: 3rem; color: var(--primary-color); margin-bottom: 20px; }

/* Stats Section */
.stats-section { background: var(--primary-color); color: var(--white); padding: 60px 10%; display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center; }
.stat-item h3 { font-size: 2.5rem; color: var(--secondary-color); }

/* FAQ & Testimonials */
.testimonial-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
.testimonial-card { background: #f9f9f9; padding: 25px; border-left: 5px solid var(--secondary-color); text-align: left; border-radius: 5px; }
.faq-container { max-width: 800px; margin: 0 auto; text-align: left; }
.faq-item { margin-bottom: 15px; border: 1px solid #ddd; border-radius: 5px; padding: 15px; background: white; }
.faq-item h4 { color: var(--primary-color); cursor: pointer; margin-bottom: 5px; }

/* =========================================
   4. LOGIN MODAL (POPUP) - FIXED
   ========================================= */
.login-modal, .modal-overlay {
    position: fixed; /* Screen ke upar chipka rahega */
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.7); /* Dark transparent bg */
    z-index: 2000; /* Navbar se upar */
    display: flex;
    justify-content: center; /* Center Horizontal */
    align-items: center; /* Center Vertical */
    backdrop-filter: blur(3px);
}

.login-box, .modal-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }

.login-box input, .modal-box input { 
    width: 100%; 
    padding: 12px; 
    margin-bottom: 15px; 
    border: 1px solid #ddd; 
    border-radius: 5px; 
    font-size: 1rem; 
}
.full-width { width: 100%; }
.close-btn { 
    position: absolute; 
    top: 15px; 
    right: 20px; 
    font-size: 28px; 
    cursor: pointer; 
    color: #888; 
}
.close-btn:hover { color: red; }

/* =========================================
   5. DASHBOARD (Horizontal Layout Update)
   ========================================= */

/* Wrapper ab column banega (upar bar, niche content) */
/* Dashboard Wrapper: Column Layout (Upar-Niche) */
.dashboard-wrapper {
    display: flex !important;
    flex-direction: column !important; /* Ye line sabse jaruri hai */
    min-height: calc(100vh - var(--nav-height));
    width: 100%;
}
/* Class Navigation Bar (Horizontal) */
/* Class Navigation Bar (Horizontal) */
.class-nav-bar {
    width: 100%;
    background: #fff;
    border-bottom: 2px solid #eee;
    padding: 15px 0;
    position: sticky;
    top: var(--nav-height);
    z-index: 900;
    overflow-x: auto; /* Horizontal Scroll enable */
    white-space: nowrap;
}

/* Scrollbar ko sundar banayein */
.class-nav-bar::-webkit-scrollbar { height: 4px; }
.class-nav-bar::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* List ko Horizontal karein */
.class-nav-bar ul {
    display: flex !important; /* Side-by-side laane ke liye */
    flex-direction: row !important;
    list-style: none;
    padding: 0 20px;
    margin: 0;
    gap: 15px; /* Items ke beech gap */
}

/* Individual Class Item Style */
.class-nav-bar ul li {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 25px; /* Round pill shape */
    background: #f0f0f0;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: 0.3s;
    flex-shrink: 0; /* Item chipke nahi */
}

/* Hover & Active State */
.class-nav-bar ul li:hover {
    background: #e8eaf6;
    border-color: var(--primary-color);
}

.class-nav-bar ul li.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 10px rgba(26, 35, 126, 0.3);
}
/* Main Content (Ab Full Width Hai) */
.main-content {
    margin-left: 0 !important; /* Sidebar margin hata diya */
    width: 100%;
    padding: 30px 5%;
}
/* Grid Adjustments for Full Width */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Thoda bada card */
    gap: 25px;
}

.subject-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-align: center;
    cursor: pointer;
    border: 1px solid #eee;
    transition: 0.3s;
}
.subject-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

/* Baki purana style same rahega */
.chapter-list { display: flex; flex-direction: column; gap: 15px; }
.chapter-item { background: white; padding: 15px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.chapter-item:hover { background: #e8eaf6; }

.reading-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 2px solid #ddd; padding-bottom: 10px; }
.content-tabs { display: flex; gap: 10px; margin-bottom: 20px; overflow-x: auto; }
.tab-btn { padding: 8px 20px; border: none; background: #ddd; border-radius: 20px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.tab-btn.active { background: var(--primary-color); color: white; }

.content-box { background: white; padding: 40px; border-radius: 8px; line-height: 1.8; box-shadow: 0 2px 10px rgba(0,0,0,0.05); min-height: 400px; font-size: 1.05rem; }
.content-box img { max-width: 100%; height: auto; border-radius: 5px; }
mjx-container { overflow-x: auto !important; padding: 10px 0; }

/* =========================================
   6. ADMIN PANEL STYLES
   ========================================= */
.admin-card { background: white; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); padding: 30px; border-top: 5px solid #ffd700; margin-bottom: 30px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.form-group label { font-weight: 600; color: #444; }
.form-group select, .form-group input { padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; background: #f9f9f9; }
#editor-container { height: 300px; background: white; }

/* =========================================
   7. FOOTER
   ========================================= */
footer { background: #111; color: #fff; padding: 50px 5% 20px; margin-top: auto; }
.footer-content { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; margin-bottom: 30px; }
.footer-section h3 { color: var(--secondary-color); margin-bottom: 15px; }
.footer-section ul { list-style: none; }
.footer-section ul li a { color: #bbb; text-decoration: none; margin-bottom: 8px; display: block; }
.footer-section ul li a:hover { color: var(--secondary-color); }
.copyright { text-align: center; border-top: 1px solid #333; padding-top: 20px; color: #777; font-size: 0.9rem; }

/* =========================================
   8. MOBILE RESPONSIVE
   ========================================= */
@media screen and (max-width: 768px) {
    .navbar { padding: 0 15px; }
    .nav-links { display: none; } /* Mobile Menu Hide */
    .hero { flex-direction: column-reverse; text-align: center; padding-top: 100px; }
    .hero-image i { font-size: 8rem; margin-bottom: 20px; }
    .hero-content h1 { font-size: 2.5rem; }
    
    .dashboard-wrapper { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; top: 0; padding: 10px; display: flex; overflow-x: auto; white-space: nowrap; border-bottom: 2px solid #ddd; }
    .main-content { margin-left: 0; padding: 15px; }
    
    .form-grid-3, .form-grid-2 { grid-template-columns: 1fr; }
    
    .login-box, .modal-box { width: 95%; padding: 25px; }
}

/* =========================================
   FOOTER FIXES (Paste at bottom of style.css)
   ========================================= */

/* Footer ka background aur layout */
footer {
    background: #111 !important; /* Black Background */
    color: #ddd !important;
    padding-top: 60px;
    padding-bottom: 20px;
    margin-top: auto;
}

/* Flexbox taaki columns bagal-bagal aayein */
.footer-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 5% 40px;
    gap: 30px;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

/* Headings ko sunder banana */
.footer-col h3 {
    color: #fff !important;
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
}

/* Heading ke niche gold line */
.footer-col h3::after {
    content: '';
    width: 40px;
    height: 3px;
    background: #ffd700; /* Gold */
    position: absolute;
    bottom: -8px;
    left: 0;
}

/* List ki bullets hatana aur links ko color dena */
.footer-col ul {
    list-style: none !important; /* Bullets Gayab */
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #bbb !important; /* Grey text */
    text-decoration: none !important; /* Blue line gayab */
    transition: 0.3s;
    display: block;
}

.footer-col ul li a:hover {
    color: #ffd700 !important; /* Hover pe Gold */
    padding-left: 5px;
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 35px;
    height: 35px;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: white !important;
    text-decoration: none;
}

/* Copyright Area */
.copyright-area {
    background: #000;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #222;
    font-size: 0.9rem;
    color: #777;
}

/* Admin Link (Chupke se footer me) */
.admin-link {
    color: #333 !important;
    text-decoration: none;
    margin-left: 10px;
    font-size: 0.8rem;
    cursor: pointer;
}
.admin-link:hover { color: #555 !important; }

/* =========================================
   FAQ FIXES (+ Icon wapas laane ke liye)
   ========================================= */

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden; /* Box ke bahar na jaye */
}

/* Question Bar */
.faq-item summary {
    padding: 20px;
    font-weight: 600;
    cursor: pointer;
    list-style: none; /* Default arrow hatana */
    position: relative;
    padding-right: 50px; /* Icon ke liye jagah */
    color: #1a237e; /* Blue Color */
}

/* Chrome/Safari se default arrow hatana */
.faq-item summary::-webkit-details-marker {
    display: none;
}

/* (+) Plus Icon Banana */
.faq-item summary::after {
    content: '+'; 
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: #1a237e;
    font-weight: bold;
}

/* (-) Jab open ho to Minus ban jaye */
.faq-item details[open] summary::after {
    content: '-';
    color: #ffd700; /* Gold */
}

/* Answer Text */
.faq-item p {
    padding: 0 20px 20px;
    color: #555;
    line-height: 1.6;
    border-top: 1px solid #eee;
    margin: 0;
    text-align: left;
}  
