﻿/* =========================================
   1. FONTS & GLOBAL VARIABLES
   ========================================= */
/* Font is now loaded via HTML <link> tags in the head for better performance */

:root {
    --primary: #0f172a;
    /* Midnight Navy */
    --primary-hover: #1e293b;
    --secondary: #f97316;
    /* Vibrant Orange */
    --secondary-hover: #ea580c;
    --police-navy: #0f172a;
    --brand-gold: #f97316;
    /* Unified brand accent — use this everywhere instead of raw hex */

    --bg-body: #ffffff;
    --bg-light: #f8fafc;
    /* Slate-50 */
    --surface: #ffffff;

    --text-main: #0f172a;
    /* Midnight Navy */
    --text-secondary: #475569;
    /* Slate-600 */
    --text-muted: #94a3b8;
    /* Slate-400 */

    --border: #e2e8f0;
    /* Slate-200 */
    --border-light: #f1f5f9;

    /* Status Colors */
    --green: #10b981;
    --red: #ef4444;
    --purple: #8b5cf6;
    --orange: #f59e0b;
    --blue: #3b82f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.1), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    --secondary-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --primary-glow: 0 10px 20px -5px rgba(15, 23, 42, 0.3);

    /* UI Components */
    --bg-surface: #ffffff;
    --bg-surface-2: #f8fafc;
    --radius-xl: 1.5rem;
    --radius-lg: 1rem;
    --radius-md: 0.5rem;

    /* Semantic Status */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --accent: #f97316;
    --info: #0ea5e9;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-light: #1e293b;
    --surface: #1e293b;
    --bg-surface: #1e293b;
    --bg-surface-2: #334155;

    --primary: #38bdf8;
    --primary-hover: #7dd3fc;
    --secondary: #fb923c;
    --secondary-hover: #fdba74;

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border: #334155;
    --border-light: #1e293b;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.5);

    /* Gradients */
    --primary-gradient: linear-gradient(135deg, #1e293b 0%, #38bdf8 100%);
    --secondary-gradient: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
}

/* =========================================
   2. RESETS & UTILITIES
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
    background-color: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Base Responsive Scaling */
@media (max-width: 1024px) {
    html {
        font-size: 15px;
        /* Shrinks all rem-based sizes by ~6.25% */
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
        /* Shrinks all rem-based sizes by 12.5% */
    }

    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 12px;
        /* Aggressive shrink by 25% for small Androids */
    }
}

/* Flex & Grid Utils */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.grid {
    display: grid;
}

.gap-md {
    gap: 1rem;
}

.gap-lg {
    gap: 2rem;
}

.hidden-mobile {
    display: flex !important;
}

@media (max-width: 1024px) {
    .hidden-mobile {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    /* On dashboard pages: hide the full navbar on mobile (mobile-header takes over) */
    .dashboard-page .navbar {
        display: none !important;
    }
}

/* Dashboard pages: hide only the logo from the navbar (keep nav items) */
.dashboard-page .navbar .nav-brand {
    display: none !important;
}

/* Dashboard pages: hide login/get-started buttons only (keep admin tools) */
.dashboard-page .navbar .btn-login,
.dashboard-page .navbar .nav-actions>.btn-primary {
    display: none !important;
}

.mobile-only {
    display: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -5px rgba(79, 70, 229, 0.4);
    opacity: 0.9;
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background-color: var(--bg-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-white {
    background: white;
    color: #111827;
    border: 1px solid var(--border);
}

.btn-danger {
    background: var(--danger);
    color: white !important;
}

[data-theme='dark'] .btn-white {
    background: var(--bg-surface-2);
    color: white;
    border-color: var(--border);
}


/* Navbar (Injected by Components) */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    transition: background 0.3s, border-color 0.3s;
}

[data-theme='dark'] .navbar {
    background: rgba(15, 23, 42, 0.95);
    border-bottom-color: var(--border);
}

.text-main {
    color: var(--text-main);
}

.text-secondary {
    color: var(--text-secondary);
}

.text-muted {
    color: var(--text-muted);
}

.nav-links {
    display: flex;
    gap: 2rem;
    margin-left: auto;
    margin-right: 2rem;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Mega Menu Styles */
.has-mega-menu {
    position: static;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid var(--border);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: none;
    grid-template-columns: 250px 1fr;
    height: 400px;
}

[data-theme='dark'] .mega-menu {
    background: var(--surface);
    border-top-color: var(--border);
}

.has-mega-menu:hover .mega-menu,
.has-mega-menu.is-open .mega-menu {
    display: grid;
    animation: megaFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes megaFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-sidebar {
    background: var(--bg-light);
    padding: 1.5rem 1rem;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mega-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
}

.mega-menu-item:hover {
    background: rgba(15, 23, 42, 0.05);
    color: var(--primary);
}

.mega-menu-item.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

[data-theme='dark'] .mega-menu-item.active {
    background: var(--bg-surface-2);
}

.mega-menu-content {
    padding: 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    align-content: start;
    overflow-y: auto;
}

.mega-sub-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mega-sub-item:hover {
    background: var(--surface);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

[data-theme='dark'] .mega-sub-item {
    background: var(--bg-surface-2);
}

.mega-sub-item .sub-icon {
    width: 40px;
    height: 40px;
    background: var(--surface);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 1rem;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.mega-sub-item span {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.mega-sub-item i.ph-caret-right {
    color: var(--text-muted);
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.2s;
}

.mega-sub-item:hover i.ph-caret-right {
    opacity: 1;
    transform: translateX(4px);
    color: var(--primary);
}

/* User Pill Styles */
.user-pill-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}

.user-pill-container:hover {
    background: var(--bg-light);
    border-color: var(--primary);
}

.avatar {
    width: 32px;
    height: 32px;
    background: var(--accent-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.dashboard-link {
    font-size: 0.6rem;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-pill-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: var(--danger);
}

.mega-menu-item[data-category="ssc"].active {
    color: #334155;
}

.mega-menu-item[data-category="banking"].active {
    color: #b45309;
}

.mega-menu-item[data-category="teaching"].active {
    color: #0f766e;
}

.mega-menu-item[data-category="police"].active {
    color: #b08d57;
}

.mega-menu-item[data-category="defence"].active {
    color: #4b5320;
}

.mega-menu-item[data-category="railways"].active {
    color: #1e3a8a;
}

.mega-menu-item[data-category="upsc"].active {
    color: #7f1d1d;
}

.mega-menu-item.active i {
    color: inherit;
}

/* =========================================
   3. HERO SECTION (Re-organized)
   ========================================= */
.landing-hero {
    padding: 4rem 0;
    background: linear-gradient(180deg, var(--bg-light) 0%, var(--bg-body) 100%);
    position: relative;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-content {
    order: 1;
    /* Text Left */
    max-width: 600px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-content h1 span {
    color: var(--primary);
    /* Indigo */
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-keywords {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.hero-keywords span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-keywords i {
    color: var(--secondary);
    /* Green Check */
}

.hero-image {
    order: 2;
    /* Image Right */
    position: relative;
}

.hero-image img {
    width: 100%;
    border-radius: 2rem;
    box-shadow: var(--shadow-premium);
    transform: perspective(1000px) rotateY(-2deg);
    transition: opacity 0.5s ease-in-out;
}

/* =========================================
   4. EXAM GRID (Row Style)
   ========================================= */
.exam-section {
    padding: 4rem 0;
    background: var(--bg-body);
}

.exam-filters {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.filter-pill {
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-pill:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
    box-shadow: 0 4px 12px -1px rgba(249, 115, 22, 0.4);
}

/* Profession-Specific Active Colors */
.filter-pill[data-category="ssc"].active {
    background: #334155;
    border-color: #334155;
    color: white;
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.4);
}

.filter-pill[data-category="banking"].active {
    background: #b45309;
    border-color: #b45309;
    color: white;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4);
}

.filter-pill[data-category="teaching"].active {
    background: #0f766e;
    border-color: #0f766e;
    color: white;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.4);
}

.filter-pill[data-category="police"].active {
    background: #b08d57;
    /* Khaki / Police Uniform */
    border-color: #b08d57;
    color: white;
    box-shadow: 0 4px 12px rgba(176, 141, 87, 0.5);
}

.filter-pill[data-category="defence"].active {
    background: #4b5320;
    /* Olive Drab / Army Uniform */
    border-color: #4b5320;
    color: white;
    box-shadow: 0 4px 12px rgba(75, 83, 32, 0.5);
}

.filter-pill[data-category="railways"].active {
    background: #1e3a8a;
    border-color: #1e3a8a;
    color: white;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.4);
}

.filter-pill[data-category="upsc"].active {
    background: #7f1d1d;
    border-color: #7f1d1d;
    color: white;
    box-shadow: 0 4px 12px rgba(127, 29, 29, 0.4);
}

.exam-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 Columns fixed */
    gap: 1.5rem;
}

/* Row-style Cards */
.exam-card-mini {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.exam-card-mini:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.1);
}

/* Category-Specific Hover Effects */
.exam-card-mini[data-category="ssc"]:hover {
    border-color: #334155;
    background: rgba(51, 65, 85, 0.02);
}

.exam-card-mini[data-category="banking"]:hover {
    border-color: #b45309;
    background: rgba(180, 83, 9, 0.02);
}

.exam-card-mini[data-category="teaching"]:hover {
    border-color: #0f766e;
    background: rgba(15, 118, 110, 0.02);
}

.exam-card-mini[data-category="police"]:hover {
    border-color: #b08d57;
    background: rgba(176, 141, 87, 0.02);
}

.exam-card-mini[data-category="defence"]:hover {
    border-color: #4b5320;
    background: rgba(75, 83, 32, 0.02);
}

.exam-card-mini[data-category="railways"]:hover {
    border-color: #1e3a8a;
    background: rgba(30, 58, 138, 0.02);
}

.exam-card-mini[data-category="upsc"]:hover {
    border-color: #7f1d1d;
    background: rgba(127, 29, 29, 0.02);
}

.exam-card-mini:hover h4 {
    color: var(--primary);
}

.exam-card-mini:hover .arrow {
    transform: translateX(4px);
    color: var(--primary);
}

.exam-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exam-info h4 {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1rem;
}

.icon-accent {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Icon Colors */
.icon-accent.pink {
    background: #fdf2f8;
    color: #db2777;
}

.icon-accent.green {
    background: #f0fdf4;
    color: #16a34a;
}

.icon-accent.blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-accent.yellow {
    background: #fefce8;
    color: #ca8a04;
}

.icon-accent.purple {
    background: #faf5ff;
    color: #9333ea;
}

.icon-accent.teal {
    background: #f0fdfa;
    color: #0d9488;
}

.arrow {
    color: var(--text-muted);
    font-size: 1rem;
}

/* =========================================
   5. TEST SERIES CARDS
   ========================================= */
.ts-section {
    padding: 4rem 0;
    background: var(--bg-light);
}

.ts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* 2-column compact grid */
    gap: 1.5rem;
    margin-top: 2rem;
}

.ts-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary);
}

.ts-user-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fffbeb;
    color: #b45309;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ts-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.ts-card h3 {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.4rem;
    color: var(--text-main);
    min-height: auto;
}

.ts-stats {
    font-size: 0.8rem;
    color: var(--secondary);
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.ts-langs {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ts-content-list {
    margin-bottom: 1rem;
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ts-content-list li {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0;
    padding: 0.25rem 0.6rem;
    background: var(--bg-light);
    border-radius: 100px;
    border: 1px solid var(--border-light);
    position: relative;
    white-space: nowrap;
}

.ts-content-list li::before {
    content: none;
}

.ts-card button {
    width: 100%;
    margin-top: auto;
    background: var(--primary);
    /* Button Color */
    color: white;
}

.ts-card button:hover {
    background: var(--primary-hover);
}


/* Themed Card Buttons */
.ts-card.category-police .btn-primary {
    background: #b08d57;
    box-shadow: 0 4px 12px rgba(176, 141, 87, 0.3);
}

.ts-card.category-police .btn-primary:hover {
    background: #a07d47;
}

.ts-card.category-defence .btn-primary {
    background: #4b5320;
    box-shadow: 0 4px 12px rgba(75, 83, 32, 0.3);
}

.ts-card.category-defence .btn-primary:hover {
    background: #3b431a;
}

.ts-card.category-railways .btn-primary {
    background: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

.ts-card.category-railways .btn-primary:hover {
    background: #172e6e;
}

.ts-card.category-ssc .btn-primary {
    background: #334155;
}

.ts-card.category-banking .btn-primary {
    background: #b45309;
}


/* =========================================
   6. USER PROFILE PILL (Nav)
   ========================================= */
.user-pill-container {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.4rem 0.6rem;
    padding-right: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.user-pill-container:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-pill-container .avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    border: 2px solid white;
}

[data-theme="dark"] .user-pill-container .avatar {
    border-color: var(--bg-surface);
}

.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.dashboard-link {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-pill-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.5rem;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.logout-btn:hover {
    color: var(--danger);
}

.logout-btn i {
    font-size: 1.25rem;
}

/* =========================================
   7. DASHBOARD & SHARED (Legacy Support)
   ========================================= */
/* Ensure Dashboard Sidebar still works */
.sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 70px;
    height: calc(100vh - 70px);
    z-index: 1000;
    padding-top: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.main-content {
    margin-left: 280px;
    padding: 2rem;
    min-height: calc(100vh - 70px);
    background: var(--bg-body);
}

/* Common Classes for Dashboard Elements */
.stat-card {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.folder-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.folder-img {
    height: 140px;
    background: #e0e7ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-info {
    padding: 1.25rem;
}

.folder-info h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.folder-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Mascot Character */
#mascot-container,
#mascot-main-container {
    position: fixed;
    bottom: 30px;
    right: -250px;
    width: 70px;
    z-index: 9999;
    transition: right 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#mascot-container.mascot-visible,
#mascot-main-container.mascot-visible {
    right: 30px;
}

.mascot-img {
    width: 100%;
    cursor: pointer;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
    animation: mascotFloat 3s ease-in-out infinite;
    transition: transform 0.3s;
}

.mascot-img:hover {
    transform: scale(1.1) rotate(5deg);
}

@keyframes mascotFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.mascot-bubble {
    background: var(--bg-surface);
    color: var(--text-main);
    padding: 12px 18px;
    border-radius: 18px;
    border-bottom-right-radius: 4px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
    display: none;
    position: relative;
    max-width: 220px;
    border: 2px solid var(--primary-light-10, rgba(15, 23, 42, 0.1));
    animation: bubblePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mascot-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: var(--bg-surface) transparent transparent;
}

@keyframes bubblePop {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== Mascot Chat Box ===== */
.mascot-chatbox {
    position: fixed;
    bottom: 110px;
    right: 20px;
    width: 340px;
    max-height: 460px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        opacity 0.25s ease;
}

.mascot-chatbox.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: all;
}

.mascot-chat-header {
    background: linear-gradient(135deg, #1e40af, #6366f1, #8b5cf6);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mascot-chat-header img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.mascot-chat-header-info {
    flex: 1;
}

.mascot-chat-header-info h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.mascot-chat-header-info span {
    font-size: 0.72rem;
    opacity: 0.8;
    font-weight: 500;
}

.mascot-chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.mascot-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mascot-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
    max-height: 300px;
    scroll-behavior: smooth;
}

.mascot-chat-messages::-webkit-scrollbar {
    width: 4px;
}

.mascot-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.mascot-chat-messages::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.mascot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.84rem;
    line-height: 1.5;
    word-wrap: break-word;
    animation: msgSlide 0.3s ease;
}

@keyframes msgSlide {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mascot-msg.bot {
    background: var(--bg-surface-2);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    font-weight: 500;
}

.mascot-msg.user {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
    font-weight: 600;
}

.mascot-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}

.mascot-typing span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.mascot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.mascot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.mascot-chat-inputarea {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.mascot-chat-inputarea input {
    flex: 1;
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.mascot-chat-inputarea input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.mascot-chat-inputarea input::placeholder {
    color: var(--text-muted);
    font-weight: 500;
}

.mascot-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.mascot-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.mascot-chat-send:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .mascot-chatbox {
        width: calc(100vw - 24px);
        right: 12px;
        bottom: 100px;
        max-height: 400px;
    }
}

/* Expanded Chat Box State */
.mascot-chatbox.expanded {
    width: 520px;
    max-height: 70vh;
    bottom: 20px;
    right: 20px;
}

.mascot-chatbox.expanded .mascot-chat-messages {
    max-height: 55vh;
}

@media (max-width: 560px) {
    .mascot-chatbox.expanded {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 8px;
        max-height: 85vh;
    }
}

.mascot-chat-expand {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    margin-right: 4px;
}

.mascot-chat-expand:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Bot messages: preserve formatting */
.mascot-msg.bot {
    white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }

    .hero-image {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-content {
        margin: 0 auto;
        order: 1;
    }

    .hero-keywords {
        justify-content: center;
    }

    .exam-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
        z-index: 2000;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
}

@media (max-width: 640px) {
    .exam-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .ts-grid {
        grid-template-columns: 1fr;
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    width: 90%;
    max-width: 450px;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

/* Auth Form Styles */
.input-group {
    position: relative;
    margin-bottom: 1rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border);
    background: var(--bg-surface-2);
    color: var(--text-main);
    border-radius: 0.5rem;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* UI Enhancements for Dashboard */
.badge-new {
    background: var(--secondary);
    color: white;
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 800;
    margin-left: 0.5rem;
}

.btn-login {
    background: none;
    border: none;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.btn-login:hover {
    color: var(--primary);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.75rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.auth-footer {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    margin-left: 0.25rem;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1050;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .mobile-header {
        display: flex;
    }
}

/* Compact mobile header buttons on small screens */
@media (max-width: 480px) {
    .mobile-header {
        padding: 0.6rem 0.75rem;
    }

    .mobile-header>div {
        gap: 0.4rem !important;
    }

    .mobile-header .lang-switch {
        width: 80px;
        height: 28px;
        padding: 2px;
    }

    .mobile-header .lang-switch .lang-option {
        font-size: 0.6rem;
    }

    .mobile-header .theme-switch {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.95rem !important;
    }

    .mobile-header .btn {
        padding: 0.3rem !important;
    }
}

@media (max-width: 380px) {
    .mobile-header .lang-switch {
        width: 70px;
        height: 26px;
    }

    .mobile-header .lang-switch .lang-option {
        font-size: 0.55rem;
    }

    .mobile-header .theme-switch {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.85rem !important;
    }
}

/* Sidebar Profile Section */
/* =========================================
   PREMIUM SIDEBAR DESIGN
   ========================================= */
.sidebar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 1rem;
    margin: 0.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(249, 115, 22, 0.06) 100%);
    border-radius: 1.25rem;
    border: 1px solid rgba(79, 70, 229, 0.1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    /* Prevents profile from hiding on small screens */
}

.sidebar-profile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, #4f46e5 50%, #7c3aed 100%);
    border-radius: 1.25rem 1.25rem 0 0;
    opacity: 0.9;
}

[data-theme='dark'] .sidebar-profile {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.12) 0%, rgba(249, 115, 22, 0.08) 100%);
    border-color: rgba(79, 70, 229, 0.2);
}

[data-theme='dark'] .sidebar-profile::before {
    background: linear-gradient(135deg, #1e293b 0%, #312e81 50%, #4c1d95 100%);
}

.profile-img-container {
    position: relative;
    width: 72px;
    height: 72px;
    margin-bottom: 0.75rem;
    margin-top: 24px;
    z-index: 2;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid white;
    background: var(--bg-surface);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

.profile-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.profile-upload-trigger {
    position: absolute;
    bottom: 2px;
    right: -2px;
    background: var(--secondary);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid white;
    transition: transform 0.2s, background 0.2s;
    font-size: 0.75rem;
    z-index: 3;
}

.profile-upload-trigger:hover {
    transform: scale(1.15);
    background: #ea580c;
}

/* Online Status Indicator */
.sidebar-profile .online-dot {
    width: 10px;
    height: 10px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid white;
    position: absolute;
    top: 26px;
    left: 2px;
    z-index: 3;
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

.sidebar-profile h4 {
    font-weight: 700;
    margin-bottom: 0.15rem;
    position: relative;
    z-index: 2;
    font-size: 0.95rem;
}

.sidebar-profile .member-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    position: relative;
    z-index: 2;
}

.sidebar-profile .member-badge i {
    font-size: 0.7rem;
}

/* Quick Stats Row */
.sidebar-quick-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    position: relative;
    z-index: 2;
}

.sidebar-quick-stats .qs-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.sidebar-quick-stats .qs-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.sidebar-quick-stats .qs-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Sidebar Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.75rem;
    flex: 1;
}

.sidebar-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 1rem 0.75rem 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-light);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-item i {
    font-size: 1.15rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: var(--bg-surface-2);
    color: var(--text-muted);
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--bg-surface-2);
    color: var(--text-main);
    transform: translateX(2px);
}

.nav-item:hover i {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
}

.nav-item.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item.active i {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

[data-theme='dark'] .nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme='dark'] .nav-item.active {
    background: rgba(56, 189, 248, 0.1);
}

[data-theme='dark'] .nav-item.active i {
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem;
    margin-top: auto;
    border-top: 1px solid var(--border-light);
}

.sidebar-footer .nav-item {
    color: var(--danger);
    font-weight: 600;
}

.sidebar-footer .nav-item i {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

.sidebar-footer .nav-item:hover {
    background: rgba(239, 68, 68, 0.06);
}

.sidebar-footer .nav-item:hover i {
    background: var(--danger);
    color: white;
}

.nav-item i {
    font-size: 1.25rem;
}

.badge-new {
    background: var(--red);
    color: white;
    font-size: 0.6rem;
    padding: 0.15rem 0.5rem;
    border-radius: 1rem;
    font-weight: 700;
    margin-left: auto;
    text-transform: uppercase;
}

.stat-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 480px) {
    .stat-group {
        grid-template-columns: 1fr 1fr;
        /* Force 2-column on very small screens to avoid weird stacking */
        gap: 0.75rem;
    }

    #subscription-status-container>div {
        flex-direction: column !important;
        /* Stack horizontally overflowing flex elements */
        align-items: flex-start !important;
        gap: 1rem;
    }

    #subscription-status-container .btn {
        width: 100%;
        /* Make button full width when stacked */
        text-align: center;
    }
}

.stat-card-mini {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card-mini span {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-card-mini h3 {
    font-size: 1.75rem;
    color: var(--text-main);
    font-weight: 800;
}

.progress-container {
    background: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.progress-bar-bg {
    height: 10px;
    background: var(--bg-light);
    border-radius: 1rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 1rem;
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-image: linear-gradient(45deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.folder-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.folder-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.folder-img {
    height: 160px;
    background: var(--bg-light);
    position: relative;
}

.folder-info {
    padding: 1.25rem;
}

.folder-info h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-main);
    font-size: 1.1rem;
}

.folder-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.badge {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: var(--green);
    color: white;
}

.badge-primary {
    background: var(--primary);
    color: white;
}

.dashboard-layout {
    display: flex;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
}

.main-content {
    flex-grow: 1;
    min-height: calc(100vh - 70px);
    background: var(--bg-body);
    padding: 2.5rem;
    overflow-x: hidden;
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: transform 0.3s;
        z-index: 2000;
        height: 100%;
        top: 0;
        box-shadow: none;
        border-right: 1px solid var(--border);
    }

    .sidebar.open {
        left: 0;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
        transform: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
}

.nav-utils {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: 1.5rem;
    z-index: 100 !important;
}

.theme-switch {
    background: var(--bg-surface-2);
    border: 1px solid var(--border);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.theme-switch:hover {
    background: var(--surface);
    color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--secondary);
}

.theme-switch-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: all 0.3s ease;
}

[data-theme='dark'] .theme-switch {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(4px);
    border-color: rgba(51, 65, 85, 0.8);
    color: #fbbf24;
    /* Amber for sun/moon */
}

.lang-switch {
    display: flex;
    background: var(--bg-surface-2);
    padding: 3px;
    border-radius: 50px;
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
    width: 110px;
    height: 36px;
    align-items: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.lang-switch:hover {
    border-color: var(--secondary);
    background: var(--surface);
}

.active-pill {
    position: absolute;
    top: 3px;
    left: 3px;
    bottom: 3px;
    width: calc(50% - 3px);
    background: var(--secondary-gradient);
    border-radius: 50px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
}

[data-lang="hi"] .active-pill {
    transform: translateX(100%);
}

[data-theme='dark'] .active-pill {
    background: var(--secondary);
}

.lang-option {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    z-index: 2;
    transition: color 0.3s;
    text-transform: uppercase;
}

.lang-option.active {
    color: white !important;
}

.theme-switch i {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 1.2rem;
    color: var(--text-main);
}

.theme-switch:active i {
    transform: scale(0.8);
}

/* Theme Dropdown */
.theme-menu {
    position: absolute;
    top: 120%;
    right: 0;
    width: 200px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 2000;
    transition: all 0.2s;
}

.theme-menu.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
}

.theme-menu-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.theme-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

.theme-option:hover {
    background: var(--bg-light);
}

.theme-option.active {
    background: var(--primary-light-10, rgba(79, 70, 229, 0.1));
    color: var(--primary);
}

.theme-option.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: none !important;
}

/* ========================================= 8. WHY FATEHMOCKS SECTION ========================================= */
/* .why-fm-section: styles moved to Design Polish section at end of file */

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.why-card {
    padding: 2rem;
    border-radius: 1.5rem;
    background: var(--bg-surface);
    transition: all 0.3s;
    border: 1px solid transparent;
}

.why-card:hover {
    background: var(--bg-surface-2);
    box-shadow: var(--shadow-lg);
    border-color: var(--border);
    transform: translateY(-5px);
}

.why-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.why-card.green .icon-box {
    background: #dcfce7;
}

.why-card.pink .icon-box {
    background: #ffe4e6;
}

.why-card.yellow .icon-box {
    background: #fef9c3;
}

.why-card.purple .icon-box {
    background: #f3e8ff;
}

.why-card h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.why-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========================================= 9. FATEH PASS SECTION ========================================= */
.fm-pass-section {
    padding: 6rem 0;
    background: var(--bg-surface);
    position: relative;
    overflow: hidden;
}

.pass-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.pass-image img {
    width: 100%;
    border-radius: 2rem;
    box-shadow: var(--shadow-premium);
    transform: rotate(-2deg);
}

.pass-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0 1rem;
}

.pass-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    color: white;
    font-size: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    transform: rotate(5deg);
    box-shadow: 0 4px 6px -1px rgba(180, 83, 9, 0.3);
}

.benefit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    color: var(--text-main);
}

.benefit-item i {
    width: 32px;
    height: 32px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

@media (max-width: 1024px) {

    .why-grid,
    .pass-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .why-content {
        margin: 0 auto;
        margin-bottom: 2rem;
    }

    .pass-image {
        order: -1;
        max-width: 500px;
        margin: 0 auto 2rem;
    }

    .benefit-grid {
        text-align: left;
    }
}

@media (max-width: 640px) {

    .why-features,
    .benefit-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================= 10. DASHBOARD ACTIVITY CARDS ========================================= */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.activity-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.activity-card:hover {
    transform: translateX(6px);
    border-color: var(--primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.activity-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 2;
}

.activity-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-body);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.activity-details h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}

.activity-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.activity-stats {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex: 3;
    justify-content: flex-end;
}

.activity-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 90px;
}

.activity-stat span {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.activity-stat .val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main);
}

@media (max-width: 992px) {
    .activity-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .activity-stats {
        width: 100%;
        justify-content: space-between;
        padding-top: 1rem;
        border-top: 1px solid var(--border-light);
        gap: 1rem;
    }

    .activity-stat {
        align-items: flex-start;
    }
}

/* =========================================
   11. POLICE THEME (Specific Override)
   ========================================= */
body.police-themed {
    background-color: #fdfaf5 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23cbd5e1' stroke-width='0.5' opacity='0.3'%3E%3Cpath d='M50 80 C80 60 80 30 80 30 L50 15 L20 30 C20 30 20 60 50 80 Z' /%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 50% !important;
    background-attachment: fixed !important;
}

/* Police Header Styling */
body.police-themed .test-list-header-glow {
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.08) 0%, transparent 100%);
}

body.police-themed #folder-title {
    color: #1e3a8a;
    background: none;
    -webkit-text-fill-color: initial;
    text-shadow: 0 2px 4px rgba(30, 58, 138, 0.1);
}

body.police-themed .back-btn {
    color: #1e3a8a;
    font-weight: 700;
}

/* Police Card Styling */
body.police-themed .test-card {
    border-left: 5px solid #b08d57;
    background: rgba(255, 255, 255, 0.95);
}

body.police-themed .test-card:hover {
    border-color: #1e3a8a;
    transform: translateY(-4px);
    box-shadow: 0 12px 25px -5px rgba(30, 58, 138, 0.15);
}

body.police-themed .btn-primary {
    background: #1e3a8a;
    border-color: #1e3a8a;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
}

body.police-themed .btn-primary:hover {
    background: #172554;
    transform: translateY(-2px);
}

body.police-themed .btn-outline {
    color: #1e3a8a;
    border-color: #1e3a8a;
}

body.police-themed .btn-outline:hover {
    background: #eff6ff;
}

body.police-themed .badge {
    background: #b08d57;
    color: white;
}

body.police-themed .test-meta i {
    color: #b08d57;
}

/* =========================================
   FATEH PASS – PRICING CARDS & SUBSCRIPTION UI
   ========================================= */

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1100px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* Plan Card Base */
.plan-card {
    background: var(--bg-surface, #fff);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-premium);
}

.plan-card.plan-active {
    border: 2px solid var(--secondary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* Popular Badge */
.popular-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Card Header */
.plan-card-header {
    padding: 1.75rem 1.5rem 1.5rem;
    text-align: center;
}

.plan-card-header .plan-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}

.plan-card-header .plan-tagline {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.25rem;
    font-weight: 500;
}

.plan-price {
    margin-top: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
}

.plan-price .currency {
    font-size: 1.5rem;
    font-weight: 700;
}

.plan-price .amount {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.plan-price .duration {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 500;
}

/* Card Body */
.plan-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    flex: 1;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.4rem 0;
    color: var(--text-secondary);
}

/* Starter Exam Dropdown */
.starter-exam-dropdown {
    margin-bottom: 1rem;
}

.starter-exam-dropdown label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.starter-exam-dropdown select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-surface, #fff);
    color: var(--text-main);
    font-size: 0.85rem;
    font-family: inherit;
}

/* Points Redeem Row */
.points-redeem-row {
    margin-bottom: 1rem;
    padding: 0.6rem 0.75rem;
    background: rgba(249, 115, 22, 0.06);
    border-radius: 8px;
    border: 1px dashed rgba(249, 115, 22, 0.3);
}

.points-redeem-row label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Buy Button */
.plan-btn {
    width: 100%;
    padding: 0.75rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.plan-btn-buy {
    background: var(--primary);
    color: #fff;
}

.plan-btn-buy:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.plan-btn-current {
    background: var(--bg-light, #f8fafc);
    color: var(--text-muted);
    cursor: default;
}

/* Plan Theme Accents (subtle border-top glow) */
.plan-starter .plan-card-header {
    background: linear-gradient(135deg, #06b6d4, #22d3ee) !important;
    color: #083344 !important;
}

.plan-silver .plan-card-header {
    background: linear-gradient(135deg, #475569, #94a3b8) !important;
    color: #fff !important;
}

.plan-gold .plan-card-header {
    background: linear-gradient(135deg, #d97706, #fbbf24) !important;
    color: #451a03 !important;
}

.plan-elite .plan-card-header {
    background: linear-gradient(135deg, #5b21b6, #8b5cf6) !important;
    color: #fff !important;
}

.plan-elite {
    border-color: #7c3aed;
    box-shadow: 0 0 20px rgba(124, 58, 237, 0.15);
}

.plan-elite:hover {
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.25), var(--shadow-premium);
}

/* =========================================
   POINTS PANEL
   ========================================= */
.points-panel {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}

.points-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.points-balance {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.points-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
    line-height: 1;
}

.points-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.points-value {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Referral Section */
.referral-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.referral-code-display {
    flex: 1;
    min-width: 180px;
}

.referral-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 0.3rem;
}

.referral-code-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-light, #f8fafc);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px dashed var(--border);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: 0.08em;
}

.btn-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 4px;
    transition: color 0.2s;
}

.btn-copy:hover {
    color: var(--secondary);
}

/* WhatsApp Button */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #25D366;
    color: #fff !important;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-whatsapp:hover {
    background: #1fb855;
    transform: scale(1.03);
}

.points-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

/* =========================================
   BANNERS (Upgrade & Promo)
   ========================================= */
.upgrade-banner {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.upgrade-banner-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: var(--text-main);
}

.upgrade-banner-content strong {
    color: #2563eb;
}

.upgrade-banner-content p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.promo-banner {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.promo-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.promo-emoji {
    font-size: 1.5rem;
}

.promo-content strong {
    color: #ea580c;
}

.promo-content p {
    margin: 0.25rem 0 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.promo-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 4px;
}

/* Plan Status Badges */
.plan-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.plan-status-free {
    background: var(--bg-light);
    color: var(--text-muted);
}

.plan-status-starter {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
}

.plan-status-silver {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.plan-status-gold {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.plan-status-elite {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
}

/* =========================================
   DARK MODE OVERRIDES for Subscription UI
   ========================================= */
[data-theme="dark"] .plan-card {
    background: var(--bg-surface);
    border-color: var(--border);
}

[data-theme="dark"] .starter-exam-dropdown select {
    background: var(--bg-body);
    border-color: var(--border);
    color: var(--text-main);
}

[data-theme="dark"] .points-panel {
    background: var(--bg-surface);
}

[data-theme="dark"] .referral-code-box {
    background: var(--bg-body);
    border-color: var(--border);
}

[data-theme="dark"] .plan-btn-buy {
    background: var(--secondary);
}

[data-theme="dark"] .plan-btn-buy:hover {
    background: var(--secondary-hover);
}

/* =========================================
   PRACTICE PAGE LAYOUT & MOBILE OVERRIDES
   ========================================= */

.practice-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: calc(100vh - 72px);
}

.subject-sidebar {
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
}

.practice-content-pane {
    padding: 2.5rem;
    background: var(--bg-body);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .practice-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
        overflow-x: hidden !important;
    }

    .subject-sidebar {
        border-right: none !important;
        border-bottom: 1px solid var(--border) !important;
        flex-direction: row !important;
        overflow-x: auto !important;
        width: 100% !important;
        padding: 0.5rem !important;
        height: auto !important;
        position: relative !important;
        top: 0 !important;
    }

    .practice-content-pane {
        width: 100vw !important;
        padding: 1rem !important;
    }

    .subject-item {
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
    }

    .subject-banner {
        padding: 0.5rem;
        height: auto;
        position: sticky;
        top: 60px;
        z-index: 90;
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }

    /* Keep Search Box Hidden on small screens in practice */
    .search-box {
        display: none !important;
    }
}

/* =========================================
   DESIGN POLISH — Added 2026-02-24
   ========================================= */

/* --- #3 — Premium Exam Cards (Homepage) --- */
.exam-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 1rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-decoration: none;
}

.exam-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--secondary);
    border-radius: 4px 0 0 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.exam-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.12);
    border-color: var(--secondary);
}

.exam-card:hover::before {
    opacity: 1;
}

.exam-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.exam-card:hover .exam-card-icon {
    transform: scale(1.1);
}

.exam-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.exam-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.exam-card-footer {
    margin-top: auto;
}

.exam-card-footer span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap 0.3s;
}

.exam-card:hover .exam-card-footer span {
    gap: 0.6rem;
}

/* --- #10 — Section Dividers --- */
.section-wave {
    width: 100%;
    height: 48px;
    display: block;
    overflow: hidden;
    line-height: 0;
}

.section-wave svg {
    width: 100%;
    height: 100%;
}

.section-wave.flip {
    transform: scaleY(-1);
}

/* --- #2 — Why Section Background + Extra Cards --- */
.why-fm-section {
    padding: 5rem 0;
    background: var(--bg-light);
    position: relative;
}

.why-fm-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.5;
    pointer-events: none;
}

/* --- #11 — Micro-Animations for Cards & Buttons --- */
.folder-card,
.exam-card,
.exam-card-mini,
.ts-card,
.why-card,
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:active {
    transform: scale(0.97);
}

/* --- #9 — Footer Visitor Badge Resize --- */
.visitor-badge {
    transform: scale(0.85);
    transform-origin: right center;
}

/* --- #7 — Hero Heading: Single Accent Color --- */
.hero-content h1 span {
    background: linear-gradient(135deg, var(--secondary) 0%, #ea580c 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Mobile Responsive: TS Grid single column --- */
@media (max-width: 768px) {
    .ts-grid {
        grid-template-columns: 1fr !important;
    }

    .section-wave {
        height: 32px;
    }
}

/* =========================================
   LOADING SKELETON SYSTEM
   Shows instantly via CSS while JS loads.
   ========================================= */
@keyframes skeletonShimmer {
    0% {
        background-position: -400px 0;
    }

    100% {
        background-position: 400px 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--bg-surface-2) 25%, var(--border-light) 37%, var(--bg-surface-2) 63%);
    background-size: 800px 100%;
    animation: skeletonShimmer 1.5s ease-in-out infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.25rem;
}

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 65%;
}

.skeleton-text.long {
    width: 90%;
}

.skeleton-card {
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.skeleton-card .skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.skeleton-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.skeleton-row .skeleton-block {
    flex: 1;
    height: 100px;
    border-radius: 0.75rem;
}

/* Page loading overlay — shown until DOMContentLoaded fires */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-light);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: loaderSpin 0.8s linear infinite;
}

.page-loader-text {
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    font-family: "Inter", system-ui, sans-serif;
}

@keyframes loaderSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Auto-hide loader on dark theme */
[data-theme="dark"] .page-loader {
    background: #0f172a;
}
/* =========================================
   BOOK READER STYLES
   ========================================= */
.book-chapter-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    color: var(--text-main);
    font-family: " Noto Sans Devanagari\, serif;
 line-height: 1.8;
}

.book-chapter-content h1 {
 font-size: 2.5rem;
 text-align: center;
 margin-bottom: 2rem;
 border-bottom: 2px solid var(--primary);
 padding-bottom: 1rem;
}

.book-chapter-content h2 {
 font-size: 1.8rem;
 margin-top: 3rem;
 margin-bottom: 1.5rem;
 padding-left: 1rem;
 border-left: 5px solid var(--secondary);
}

.book-chapter-content p {
 font-size: 1.15rem;
 margin-bottom: 1.5rem;
 text-align: justify;
}

.book-chapter-content .info-card {
 background: var(--bg-light);
 border: 1px solid var(--border);
 border-radius: 8px;
 padding: 1.5rem;
 margin: 2rem 0;
}

.book-chapter-content .pairs-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
 gap: 1.5rem;
 margin-top: 2rem;
}

.book-chapter-content .pair {
 padding: 1rem;
 border-bottom: 1px solid var(--border-light);
 transition: background 0.2s;
}

.book-chapter-content .pair:hover {
 background: var(--bg-light);
}

.book-chapter-content .pair strong {
 font-size: 1.25rem;
 color: var(--primary);
 display: block;
 margin-bottom: 0.5rem;
}

.book-chapter-content .pair small {
 font-size: 1rem;
 color: var(--text-secondary);
 display: block;
 font-style: italic;
}

.book-chapter-content .controversial {
 background: #fff9f0;
 border-left: 3px solid var(--secondary);
}

[data-theme=\dark\] .book-chapter-content .controversial {
 background: rgba(249, 115, 22, 0.1);
}

/* =========================================
   BOOK TABLE STYLES
   ========================================= */
.book-table-container {
    width: 100%;
    margin: 2rem 0;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

.book-table {
    width: 100%;
    border-collapse: collapse;
    font-family: " Noto Sans Devanagari\, sans-serif;
 text-align: left;
}

.book-table th {
 background: var(--bg-light);
 color: var(--primary);
 font-weight: 700;
 padding: 1.25rem 1.5rem;
 border-bottom: 2px solid var(--border);
 white-space: nowrap;
}

.book-table td {
 padding: 1rem 1.5rem;
 border-bottom: 1px solid var(--border-light);
 color: var(--text-main);
 font-size: 1.05rem;
 line-height: 1.6;
}

.book-table tr:last-child td {
 border-bottom: none;
}

.book-table tr:hover {
 background: rgba(15, 23, 42, 0.02);
}

.book-table .col-id { width: 60px; color: var(--text-muted); font-size: 0.9rem; }
.book-table .col-pair { width: 40%; font-weight: 700; color: var(--primary); }
.book-table .col-desc { color: var(--text-secondary); }

[data-theme=\dark\] .book-table tr:hover {
 background: rgba(255, 255, 255, 0.03);
}
