/* ==========================================================
   Captain Lerna™ — NIOS Course Pages Shared Stylesheet
   Path: captainlerna/nios/shared/nios.css
   Reusable styling for all NIOS secondary & senior secondary pages
   ========================================================== */

:root {
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --accent-yt: #dc2626;
    --accent-yt-hover: #b91c1c;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --card-border: rgba(226, 232, 240, 0.85);
    --card-shadow: 0 4px 16px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03);
    --card-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.1), 0 3px 8px rgba(15, 23, 42, 0.06);
}

body {
    font-family: var(--font-main);
    background: #f8fafc;
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Container Layout */
.page-container {
    flex: 1;
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    padding: calc(var(--header-height, 56px) + 24px) var(--side-padding, 16px) 60px;
    box-sizing: border-box;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-500);
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: var(--slate-600);
    text-decoration: none;
    transition: color 0.15s ease;
}

.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumbs .sep {
    color: var(--slate-400);
}

.breadcrumbs .current {
    color: var(--slate-900);
    font-weight: 600;
}

/* Header Hero */
.course-hero {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 36px 32px;
    box-shadow: var(--card-shadow);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.course-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #6366f1);
}

.badge-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-nios {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.course-hero h1 {
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-align: left;
}

.syllabus-notice {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: clamp(15px, 2.8vw, 18px);
    color: var(--slate-400);
    font-weight: 500;
    margin-bottom: 16px;
}

.syllabus-notice a {
    color: #0284c7;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s ease;
}

.syllabus-notice a:hover {
    color: #0369a1;
}

.course-desc {
    font-size: clamp(15px, 2.5vw, 18px);
    color: #334155;
    line-height: 1.65;
    margin: 0 0 20px 0;
    max-width: 820px;
    text-align: left;
}

/* Stats & Quick Actions */
.course-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--slate-100);
}

.meta-stats {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--slate-600);
}

.meta-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.meta-stat-item strong {
    color: var(--slate-900);
    font-weight: 700;
}

/* Search & Filter Bar */
.controls-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

@media (min-width: 720px) {
    .controls-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 440px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 10px;
    border: 1px solid var(--slate-200);
    background: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    color: var(--slate-800);
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

.search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #f1f5f9;
    color: var(--slate-700);
    border: 1px solid transparent;
    padding: 6px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    background: #e2e8f0;
    color: var(--slate-900);
}

.filter-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* Section Heading */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: clamp(20px, 3.5vw, 26px);
    font-weight: 700;
    color: var(--slate-900);
    margin: 0;
    letter-spacing: -0.01em;
    text-align: left;
}

.counter-badge {
    font-size: 13px;
    color: var(--slate-500);
    font-weight: 500;
    background: #e2e8f0;
    padding: 4px 10px;
    border-radius: 9999px;
}

/* Chapters Grid */
.chapters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 40px;
}

@media (min-width: 640px) {
    .chapters-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Chapter Card */
.chapter-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.chapter-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.chapter-num-badge {
    background: #f1f5f9;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
}

.book-badge,
.module-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chapter-title {
    font-size: clamp(17px, 2.2vw, 19px);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 18px 0;
    line-height: 1.35;
    text-align: left;
}

/* Chapter Action Buttons */
.chapter-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: auto;
}

@media (min-width: 480px) {
    .chapter-actions {
        flex-direction: row;
        align-items: center;
    }
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    box-sizing: border-box;
    flex: 1;
    text-align: center;
}

.btn-pdf {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.btn-pdf:hover {
    background: #1d4ed8;
    color: #ffffff;
    border-color: #1d4ed8;
    box-shadow: 0 3px 8px rgba(29, 78, 216, 0.25);
    text-decoration: none;
}

.btn-video {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.btn-video:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25);
    text-decoration: none;
}

.no-video-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    flex: 1;
}

/* Captain Lerna Practice Banner */
.app-cta-banner {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: 16px;
    padding: 30px 24px;
    color: #ffffff;
    margin-bottom: 36px;
    border: 1px solid #334155;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 18px;
}

@media (min-width: 768px) {
    .app-cta-banner {
        flex-direction: row;
        text-align: left;
        justify-content: space-between;
        padding: 32px 36px;
    }
}

.app-cta-content h3 {
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #ffffff;
}

.app-cta-content p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
    max-width: 520px;
    line-height: 1.5;
    text-align: left;
}

.app-cta-stores {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.app-cta-stores a {
    display: inline-block;
    transition: transform 0.18s ease;
}

.app-cta-stores a:hover {
    transform: scale(1.04);
}

.app-cta-stores img {
    height: 44px;
    width: auto;
}

.disclaimer-card {
    background-color: #1e293b;
    color: #f8fafc;
    border-radius: 16px;
    padding: 28px 28px;
    border: 1px solid #334155;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
    position: relative;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.disclaimer-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    flex-shrink: 0;
}

.disclaimer-card h3 {
    font-size: clamp(17px, 2.5vw, 20px);
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    letter-spacing: -0.01em;
    text-align: left;
}

.disclaimer-body {
    font-size: clamp(13px, 2vw, 15px);
    line-height: 1.7;
    color: #e2e8f0;
}

.disclaimer-body p {
    margin: 0 0 12px 0;
    text-align: left;
    max-width: none;
    color: #e2e8f0;
}

.disclaimer-body p:last-child {
    margin-bottom: 0;
}

.disclaimer-body a {
    color: #38bdf8;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    transition: color 0.15s ease;
}

.disclaimer-body a:hover {
    color: #7dd3fc;
}

/* Ensure footer flows naturally after long content */
footer {
    position: relative;
    margin-top: 48px;
}

/* Empty state when filtering/searching */
.empty-state {
    display: none;
    text-align: center;
    padding: 48px 20px;
    background: #ffffff;
    border-radius: 14px;
    border: 1px dashed var(--slate-300);
    grid-column: 1 / -1;
}

.empty-state p {
    font-size: 16px;
    color: var(--slate-500);
    margin: 8px 0 0 0;
}

/* SVG icon sizing */
.svg-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ==========================================================
   Quiz & Practice Problems Styles (Reusable for NIOS pages)
   ========================================================== */
.quiz-section {
    margin-bottom: 44px;
}

.quiz-header-card {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 28px 24px;
    color: #ffffff;
    margin-bottom: 24px;
    border: 1px solid #334155;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.quiz-header-card .badge-quiz {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 9999px;
    display: inline-block;
    margin-bottom: 10px;
}

.quiz-header-card h2 {
    font-size: clamp(20px, 3.5vw, 26px);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 10px 0;
    letter-spacing: -0.01em;
}

.quiz-header-card p {
    font-size: clamp(14px, 2.2vw, 16px);
    color: #cbd5e1;
    margin: 0 0 16px 0;
    line-height: 1.6;
    max-width: none;
    text-align: left;
}

.quiz-app-notice {
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.4);
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.quiz-app-notice-text {
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.5;
}

.quiz-app-notice-text strong {
    color: #38bdf8;
}

.quiz-app-notice-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.quiz-app-notice-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: #2563eb;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.quiz-app-notice-links a:hover {
    background: #1d4ed8;
    text-decoration: none;
}

.quiz-questions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.quiz-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: var(--card-shadow);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quiz-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--card-shadow-hover);
}

.quiz-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.quiz-q-num {
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
}

.quiz-hint-btn {
    background: transparent;
    border: 1px solid var(--slate-300);
    color: var(--slate-600);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.quiz-hint-btn:hover {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

.quiz-hint-box {
    display: none;
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #92400e;
    margin-bottom: 14px;
    line-height: 1.5;
}

.quiz-hint-box.show {
    display: block;
}

.quiz-question-text {
    font-size: clamp(16px, 2.5vw, 18px);
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 16px 0;
    line-height: 1.4;
    text-align: left;
}

.quiz-options-group {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 14px;
}

.quiz-opt-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1.5px solid var(--slate-200);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--slate-800);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.quiz-opt-btn:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.quiz-opt-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.quiz-opt-btn .opt-marker {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.quiz-opt-btn.correct {
    background: #ecfdf5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

.quiz-opt-btn.correct .opt-marker {
    background: #10b981 !important;
    color: #ffffff !important;
}

.quiz-opt-btn.incorrect {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #991b1b !important;
}

.quiz-opt-btn.incorrect .opt-marker {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.quiz-opt-btn.reveal-correct {
    background: #ecfdf5 !important;
    border-color: #34d399 !important;
    color: #065f46 !important;
}

.quiz-opt-btn.reveal-correct .opt-marker {
    background: #34d399 !important;
    color: #ffffff !important;
}

.quiz-opt-btn:disabled {
    cursor: default;
}

.quiz-explanation-box {
    display: none;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #166534;
    line-height: 1.55;
    animation: fadeIn 0.2s ease-in;
}

.quiz-explanation-box.show {
    display: block;
}

.quiz-explanation-box strong {
    color: #14532d;
    display: inline-block;
    margin-bottom: 4px;
}

.quiz-explanation-cta {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #86efac;
    font-size: 12px;
    color: #15803d;
    font-weight: 600;
}

.quiz-explanation-cta a {
    color: #166534;
    text-decoration: underline;
    font-weight: 700;
}

.quiz-footer-banner {
    background: #ffffff;
    border: 2px dashed #3b82f6;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    margin-top: 24px;
}

.quiz-footer-banner h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 8px 0;
}

.quiz-footer-banner p {
    font-size: 14px;
    color: var(--slate-600);
    margin: 0 auto 16px auto;
    max-width: 600px;
    line-height: 1.5;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================
   Level & Section Index Pages Styling
   Used by captainlerna/nios/index.html & captainlerna/nios/secondary/index.html
   ========================================================== */

/* Level & Subject Grids */
.levels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

@media (min-width: 800px) {
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.level-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
}

.level-card.upcoming::before {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}

.level-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.level-card-header {
    margin-bottom: 16px;
}

.level-card-title {
    font-size: clamp(20px, 2.8vw, 24px);
    font-weight: 800;
    color: var(--slate-900);
    margin: 8px 0 10px 0;
    letter-spacing: -0.01em;
}

.level-card-desc {
    font-size: 14px;
    color: var(--slate-600);
    line-height: 1.6;
    margin: 0 0 18px 0;
}

.subject-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.subject-pill {
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 9999px;
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    text-decoration: none;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.subject-pill:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-color: #bfdbfe;
}

.subject-pill.disabled {
    opacity: 0.65;
    cursor: default;
    background: #f8fafc;
}

/* Subjects Catalog Grid */
.subjects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

@media (min-width: 680px) {
    .subjects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1040px) {
    .subjects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.subject-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
    border-color: #cbd5e1;
}

.subject-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.subject-code-tag {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.5px;
}

.subject-cat-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subject-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.subject-card-desc {
    font-size: 13px;
    color: var(--slate-600);
    line-height: 1.55;
    margin: 0 0 16px 0;
    flex-grow: 1;
}

.subject-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.topic-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.subject-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--slate-100);
    border-bottom: 1px solid var(--slate-100);
    margin-bottom: 18px;
    font-size: 12px;
    color: var(--slate-600);
}

.subject-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.subject-stat strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-900);
}

.subject-card-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    transition: all 0.18s ease;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-primary-action:hover {
    background: var(--primary-dark);
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.3);
    color: #ffffff;
    text-decoration: none;
}

.btn-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 600;
    background: #f8fafc;
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    text-decoration: none;
    transition: all 0.18s ease;
}

.btn-secondary-action:hover {
    background: #e2e8f0;
    color: var(--slate-900);
    text-decoration: none;
}

/* Feature Grid for Benefits */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 36px;
}

@media (min-width: 640px) {
    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-box {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    text-align: left;
}

.feature-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 14px;
}

.icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-emerald {
    background: #ecfdf5;
    color: #059669;
}

.icon-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.feature-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 0 0 8px 0;
}

.feature-box p {
    font-size: 13px;
    color: var(--slate-600);
    line-height: 1.55;
    margin: 0;
}

/* ==========================================================
   Quiz Collections Master Hub Styling
   Used by captainlerna/quizzes/index.html
   ========================================================== */

.featured-collection-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 34px 30px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.featured-collection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #818cf8);
}

.featured-collection-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.09);
}

.collection-badge-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.status-badge-active {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 9999px;
}

.status-badge-planned {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #cbd5e1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 9999px;
}

.status-badge-app {
    background: #fdf4ff;
    color: #86198f;
    border: 1px solid #f0abfc;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 9999px;
}

.collection-headline {
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 800;
    color: var(--slate-900);
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
}

.collection-description {
    font-size: 15px;
    color: var(--slate-600);
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 820px;
}

.collection-meta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 16px 0;
    border-top: 1px solid var(--slate-100);
    border-bottom: 1px solid var(--slate-100);
    margin-bottom: 22px;
}

.collection-meta-stat {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--slate-600);
}

.collection-meta-stat strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-900);
}

.collection-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==========================================================
   FAQ Section & Accordion Styles
   ========================================================== */
.faq-section {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    margin-bottom: 32px;
}

.faq-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    background: var(--primary-light);
    border-radius: 9999px;
    margin-bottom: 8px;
}

.faq-section h2 {
    font-size: clamp(20px, 3vw, 24px);
    font-weight: 800;
    color: var(--slate-900);
    margin: 0 0 8px 0;
    letter-spacing: -0.01em;
}

.faq-subtitle {
    font-size: 14px;
    color: var(--slate-600);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: var(--slate-50);
    transition: all 0.2s ease;
    overflow: hidden;
}

.faq-item:hover {
    border-color: var(--slate-300);
    background: #ffffff;
}

.faq-item[open] {
    background: #ffffff;
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.faq-question {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 700;
    color: var(--slate-800);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--slate-500);
    border-bottom: 2px solid var(--slate-500);
    transform: rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s ease;
    margin-left: 12px;
    flex-shrink: 0;
}

.faq-item[open] .faq-question::after {
    transform: rotate(-135deg);
    border-color: var(--primary);
}

.faq-answer {
    padding: 0 20px 18px 20px;
    font-size: 14px;
    color: var(--slate-600);
    line-height: 1.65;
    border-top: 1px solid transparent;
}

.faq-item[open] .faq-answer {
    border-top: 1px solid var(--slate-100);
    padding-top: 12px;
}

.faq-answer p {
    margin: 0 0 10px 0;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}