/* =========================================
   Project: MeritBoard Universal
   File: css/style.css
   Version: 16.0 (Desktop Cards Resize & Spacing Fixed)
   ========================================= */

/* --- 1. GLOBAL VARIABLES --- */
:root {
    --primary-color: #1A237E;
    --accent-color: #03A9F4;
    --text-main: #212121;
    --text-muted: #757575;
    
    --bg-body: #F4F6F8;
    --bg-card: #FFFFFF;
    --bg-header: rgba(255, 255, 255, 0.98);
    
    --border-color: #E0E0E0;
    --shadow-sm: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.1);
    
    --header-height: 60px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Badges */
    --color-quiz: #3f51b5;
    --color-video: #c0392b;
    --color-pdf: #009688;
    --color-blog: #f39c12;
}

/* --- 2. RESET & BASE --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    padding-top: var(--header-height);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
button { font-family: inherit; border: none; cursor: pointer; background: none; outline: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.hidden { display: none !important; }

/* Global Container */
.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- 3. HEADER --- */
.site-header {
    background-color: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-height);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 1000;
    display: flex; align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 15px;
}

/* LOGO */
.brand-area { flex-shrink: 0; z-index: 1002; }
.logo-link { display: flex; align-items: center; gap: 8px; }
.logo-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    white-space: nowrap;
}
.logo-text span { color: var(--accent-color); }

/* DESKTOP NAV */
.desktop-nav { display: flex; gap: 25px; align-items: center; }
.nav-item {
    font-weight: 500; font-size: 0.95rem; color: var(--text-main);
    position: relative; padding: 5px 0;
}
.nav-item:hover, .nav-item.active { color: var(--accent-color); }

/* HEADER ACTIONS */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.btn-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #f1f3f4;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main);
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--accent-color); color: white; }
.mobile-only { display: none; }

/* --- 4. SEARCH BAR --- */
.search-wrapper { position: relative; margin-right: 5px; }

/* Desktop Input */
.search-input-box {
    display: flex; align-items: center;
    background: #f1f3f4;
    border-radius: 50px;
    height: 38px;
    padding: 0 15px;
    width: 240px; /* Desktop width */
    transition: var(--transition);
    border: 1px solid transparent;
}
.search-input-box.focused {
    background: var(--bg-card);
    border-color: var(--accent-color);
    width: 280px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#headerSearchInput {
    border: none; background: transparent; outline: none;
    width: 100%; font-size: 0.9rem; color: var(--text-main);
}
.search-icon { color: #757575; font-size: 1rem; margin-right: 8px; }
.clear-btn { font-size: 1.2rem; color: #999; padding: 0 5px; display: none; }
.clear-btn.active { display: block; }

/* Desktop Dropdown */
.search-dropdown {
    position: absolute; top: 115%; right: 0;
    width: 320px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    z-index: 2000;
    display: none; padding: 10px 0;
    max-height: 400px; overflow-y: auto;
}
.search-dropdown.active { display: block; animation: slideDown 0.2s ease; }

.search-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 15px;
    text-decoration: none; border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;
}
.search-item:hover { background: #f0f7ff; }
.s-thumb { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; background: #eee; }
.s-info { flex: 1; overflow: hidden; }
.s-title { font-size: 0.9rem; font-weight: 600; line-height: 1.3; color: var(--text-main); }
.badge { font-size: 0.65rem; padding: 2px 6px; border-radius: 4px; color: white; font-weight: 600; }
.badge.quiz { background: var(--color-quiz); }
.badge.book, .badge.pdf { background: var(--color-pdf); }
.badge.video { background: var(--color-video); }

.search-status { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }

/* --- 5. HERO & SECTIONS --- */
.hero-wrapper {
    background: linear-gradient(135deg, var(--primary-color) 0%, #283593 100%);
    color: white; 
    padding: 60px 0 60px; 
    text-align: center;
    border-radius: 0 0 40px 40px; 
    margin-bottom: 10px;
}
.hero-title { 
    font-family: 'Poppins', sans-serif; 
    font-size: 2.5rem; 
    font-weight: 700; 
    margin-bottom: 15px; 
    line-height: 1.2; 
}
.hero-title span { color: var(--accent-color); }
.hero-subtitle { font-size: 1.1rem; opacity: 0.9; max-width: 600px; margin: 0 auto 30px; }

.hero-cta { display: flex; justify-content: center; gap: 15px; }
.btn { 
    padding: 12px 28px; 
    border-radius: 50px; 
    font-weight: 600; 
    display: inline-block; 
    transition: transform 0.2s; 
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-color); color: white; box-shadow: 0 4px 15px rgba(3,169,244,0.4); }
.btn-outline { border: 2px solid rgba(255,255,255,0.3); color: white; }

/* --- 6. SECTION HEADER & CONTENT --- */
.content-section { margin-bottom: 50px; }

.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px;
    border-left: 5px solid var(--accent-color);
    padding-left: 15px; padding-right: 5px;
}

.section-title { font-family: 'Poppins', sans-serif; font-size: 1.4rem; font-weight: 700; color: var(--text-main); }
.view-all-link {
    font-size: 0.9rem; font-weight: 600;
    color: var(--accent-color);
    background: rgba(3, 169, 244, 0.08);
    padding: 8px 16px; border-radius: 30px;
    white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.view-all-link:hover { background: var(--accent-color); color: white; }

/* --- 7. SLIDER (Desktop Fixes) --- */
.slider-wrapper { width: 100%; overflow: hidden; }

.card-slider {
    display: flex; 
    gap: 15px; /* ✅ Reduced from 20px (Desktop Spacing) */
    overflow-x: auto; 
    padding-bottom: 20px; 
    padding-left: 5px; 
    scroll-snap-type: x mandatory; 
    -webkit-overflow-scrolling: touch;
}
.card-slider::-webkit-scrollbar { display: none; }

.content-card {
    min-width: 280px; /* ✅ Increased from 260px (Bigger Desktop Cards) */
    max-width: 280px;
    background: var(--bg-card); border-radius: 12px;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border-color);
    display: flex; flex-direction: column; overflow: hidden;
    scroll-snap-align: start; flex-shrink: 0;
    transition: transform 0.2s;
}
.content-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }

.card-thumbnail-wrapper { height: 160px; /* Increased Height */ background: #eee; position: relative; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-badge { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.7); color: white; font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; font-weight: 600; }
.card-body { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; color: var(--text-main); }
.card-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 12px; }
.card-btn { margin-top: auto; display: block; text-align: center; padding: 10px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; color: white; }

/* Colors for Card Buttons */
.btn-quiz { background-color: var(--color-quiz); }
.btn-video { background-color: var(--color-video); }
.btn-pdf { background-color: var(--color-pdf); }
.btn-blog { background-color: var(--color-blog); }

/* --- 8. FOOTER --- */
.site-footer { 
    background-color: var(--primary-color); color: white; 
    padding: 50px 0 30px; text-align: center; margin-top: 60px; 
}
.footer-social { display: flex; justify-content: center; gap: 15px; margin: 20px 0; }
.social-icon { width: 36px; height: 36px; border: 1px solid rgba(255,255,255,0.3); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; transition: 0.2s; }
.social-icon:hover { background: white; color: var(--primary-color); }

/* --- 9. DARK MODE --- */
body.dark-mode { 
    --bg-body: #121212; --bg-card: #1E1E1E; --bg-header: rgba(18, 18, 18, 0.95);
    --text-main: #E0E0E0; --text-muted: #B0B0B0; --border-color: #333; 
}
body.dark-mode .btn-icon, body.dark-mode .search-input-box { background: #2d2d2d; color: white; }
body.dark-mode .search-item { border-bottom: 1px solid #333; }
body.dark-mode .search-item:hover { background: rgba(255,255,255,0.05); }

/* --- 10. MOBILE RESPONSIVE (Remains PERFECT) --- */
@media (max-width: 768px) {
    /* Basics */
    .desktop-nav { display: none !important; }
    .mobile-only { display: flex !important; }
    .header-container { padding: 0 10px; position: relative; }
    .logo-text { font-size: 1.25rem; }

    /* Fix Empty Space */
    .container { width: 96% !important; max-width: 100%; padding: 0 5px; }

    /* Icons Alignment */
    .header-actions {
        width: auto !important; justify-content: flex-end;
        display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important;
        align-items: center !important; gap: 10px !important;
    }

    /* Search Bar Logic (Logo Cover) */
    .search-wrapper { position: static !important; margin-right: 0; }
    
    .search-input-box {
        width: 38px !important; height: 38px !important;
        padding: 0; justify-content: center;
        border-radius: 50%; cursor: pointer;
        flex-shrink: 0 !important; background: #f1f3f4; position: relative;
    }
    #headerSearchInput { display: none; } 
    .search-icon { margin: 0; font-size: 1.2rem; }

    .search-input-box.focused {
        position: absolute; top: 11px; left: 10px; right: 60px;
        width: auto !important; max-width: none;
        background: var(--bg-card); justify-content: flex-start;
        padding: 0 15px; border-radius: 30px; z-index: 2005;
        border: 1px solid var(--accent-color);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }
    .search-input-box.focused #headerSearchInput { display: block; width: 100%; }

    .search-dropdown {
        position: fixed !important; top: 65px !important;
        left: 50% !important; transform: translateX(-50%) !important;
        width: 95% !important; max-width: 400px;
        border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    }

    /* Hero */
    .hero-wrapper { padding: 30px 10px 40px; }
    .hero-title { font-size: 1.6rem; }
    .hero-cta { flex-direction: column; align-items: center; gap: 10px; }
    .hero-cta .btn { width: 100%; max-width: 250px; }

    /* ✅ CARD SLIDER FIX (2 Cards Mobile) */
    .card-slider { gap: 10px; padding-bottom: 15px; padding-left: 0; }

    .content-card {
        min-width: 165px !important; max-width: 165px !important;
        border-radius: 10px;
    }
    .card-thumbnail-wrapper { height: 100px; }
    .card-body { padding: 10px; }
    .card-title { font-size: 0.9rem; line-height: 1.3; margin-bottom: 5px; }
    .card-meta { font-size: 0.7rem; margin-bottom: 8px; }
    .card-btn { padding: 6px; font-size: 0.8rem; }
    .card-badge { font-size: 0.6rem; padding: 2px 6px; }

    /* Section Header */
    .section-header { margin-bottom: 15px; padding-left: 10px; }
    .section-title { font-size: 1.1rem; }
    .view-all-link { font-size: 0.75rem; padding: 5px 10px; }
    
    /* Mobile Menu */
    .btn-icon { width: 38px; height: 38px; flex-shrink: 0; }
    .desktop-nav.active {
        display: flex !important; flex-direction: column;
        position: fixed; top: var(--header-height); left: 0; width: 100%;
        background: var(--bg-card); padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        border-bottom: 1px solid var(--border-color); z-index: 999;
        animation: slideDown 0.3s ease;
    }
    .desktop-nav.active .nav-item { padding: 12px 5px; font-size: 1.1rem; border-bottom: 1px solid rgba(0,0,0,0.05); width: 100%; }
    @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
}

/* --- 8. FOOTER --- */
.site-footer { 
    background-color: var(--primary-color); color: white; 
    padding: 50px 0 30px; text-align: center; margin-top: 60px; 
}

/* --- Footer Social Icons Fix --- */

/* 1. Container ko Center aur Row me laayein */
.footer-social-icons {
    display: flex !important;       /* Flexbox on karein */
    justify-content: center !important; /* Horizontal Center */
    align-items: center !important;
    gap: 20px;                      /* Icons ke beech gap */
    margin: 25px 0 !important;      /* Upar-Niche thoda space */
}

/* 2. Icons ka Design (Gol Circle) */
.social-icon {
    display: flex !important;       /* Icon ko box ke center me laye */
    justify-content: center;
    align-items: center;
    width: 45px;                    /* Chaudaai */
    height: 45px;                   /* Unchaai */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Halka border */
    border-radius: 50%;             /* Pura Gol (Circle) */
    color: #ffffff !important;      /* Icon ka rang White */
    text-decoration: none !important;
    transition: all 0.3s ease;      /* Smooth Animation */
    margin: 0 !important;           /* Inline margin hatayein */
}

/* 3. Hover Effect (Mouse le jaane par) */
.social-icon:hover {
    background-color: #ffffff;      /* Background White */
    color: #1e3a8a !important;      /* Icon Blue */
    transform: translateY(-3px);    /* Thoda upar uthe */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); /* Glow Effect */
}

/* Icon size adjustment inside circle */
.social-icon i {
    font-size: 1.2rem;
}


/* --- MERITBOARD LABS SECTION (NO CONFLICT) --- */
.mlabs-wrapper {
    padding: 60px 0;
    background-color: var(--bg-body); /* Using your existing variable */
}

.mlabs-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 35px;
    padding: 0 5px;
}

.mlabs-badge {
    background: rgba(26, 35, 126, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.mlabs-main-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    color: var(--text-main);
    margin: 8px 0;
}

.mlabs-highlight { color: var(--accent-color); }

.mlabs-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 500px;
}

.mlabs-view-btn {
    background: var(--primary-color);
    color: white !important;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
}

.mlabs-view-btn:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

/* Grid & Cards */
.mlabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.mlabs-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.mlabs-card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.mlabs-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.mlabs-blue { background: #e8eaf6; color: #1a237e; }
.mlabs-purple { background: #f3e5f5; color: #7b1fa2; }
.mlabs-teal { background: #e0f2f1; color: #00796b; }

.mlabs-info { margin-left: 15px; }
.mlabs-info h3 {
    font-size: 1.05rem;
    color: var(--text-main);
    margin: 0;
}
.mlabs-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.mlabs-arrow {
    margin-left: auto;
    color: #cbd5e1;
    transition: 0.3s;
}

.mlabs-card:hover .mlabs-arrow {
    color: var(--accent-color);
    transform: translateX(3px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mlabs-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .mlabs-main-title { font-size: 1.5rem; }
    .mlabs-grid { grid-template-columns: 1fr; }
    .mlabs-view-btn { width: 100%; text-align: center; }
}

/* MeritBoard Tools Section Styling end */