/* ========================================================
   CRITICAL THINKING & ARGUMENTATION MASTERY
   Premium Editorial Design System (v4.0)
   Designed for Intellectual Rigor, Clarity, and Confidence
   ======================================================== */


/* --- Root Design Tokens (Dark Mode by Default) --- */
:root {
    /* Foundations: Deep Obsidian & Midnight Slate */
    --bg-main: #080C15;
    --bg-surface: #0E1626;
    --bg-card: #131E33;
    --bg-card-hover: #1A2844;
    --bg-elevated: #1F2F4E;

    /* Typography Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    --text-inverse: #080C15;

    /* Borders & Dividers */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.14);
    --border-active: rgba(212, 175, 55, 0.4);

    /* Intellectual & Editorial Accents */
    --accent-gold: #D4AF37;
    --accent-gold-light: #F6D061;
    --accent-gold-bg: rgba(212, 175, 55, 0.12);
    --accent-gold-border: rgba(212, 175, 55, 0.28);

    --accent-indigo: #6366F1;
    --accent-indigo-light: #818CF8;
    --accent-indigo-bg: rgba(99, 102, 241, 0.12);
    --accent-indigo-border: rgba(99, 102, 241, 0.3);

    /* State & Cognitive Accents */
    --state-valid: #10B981;
    --state-valid-bg: rgba(16, 185, 129, 0.12);
    --state-valid-border: rgba(16, 185, 129, 0.3);

    --state-flaw: #F43F5E;
    --state-flaw-bg: rgba(244, 63, 94, 0.12);
    --state-flaw-border: rgba(244, 63, 94, 0.3);

    --state-inquiry: #0EA5E9;
    --state-inquiry-bg: rgba(14, 165, 233, 0.12);
    --state-inquiry-border: rgba(14, 165, 233, 0.3);

    /* Legacy Bridge Mappings */
    --primary: var(--accent-gold);
    --primary-light: var(--accent-gold-light);
    --primary-bg: var(--accent-gold-bg);
    --primary-border: var(--accent-gold-border);
    --accent: var(--accent-indigo);
    --accent-bg: var(--accent-indigo-bg);
    --danger: var(--state-flaw);
    --danger-bg: var(--state-flaw-bg);
    --border-color: var(--border-subtle);

    /* Surfaces & Shadows */
    --nav-bg: rgba(8, 12, 21, 0.94);
    --nav-border: var(--border-subtle);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
    --shadow-gold: 0 4px 16px rgba(212, 175, 55, 0.15);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* System Safe Areas */
    --safe-top: 36px;
    --safe-bottom: 28px;
}

/* --- Editorial Parchment / Light Theme --- */
[data-theme="light"] {
    --bg-main: #F6F8FA;
    --bg-surface: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F1F4F9;
    --bg-elevated: #E9EEF5;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #8292A6;
    --text-inverse: #FFFFFF;

    --border-subtle: #E2E8F0;
    --border-medium: #CBD5E1;
    --border-active: rgba(180, 83, 9, 0.4);

    --accent-gold: #B45309;
    --accent-gold-light: #D97706;
    --accent-gold-bg: rgba(180, 83, 9, 0.08);
    --accent-gold-border: rgba(180, 83, 9, 0.25);

    --accent-indigo: #4338CA;
    --accent-indigo-light: #4F46E5;
    --accent-indigo-bg: rgba(67, 56, 202, 0.08);
    --accent-indigo-border: rgba(67, 56, 202, 0.25);

    --state-valid: #059669;
    --state-valid-bg: rgba(5, 150, 105, 0.08);
    --state-valid-border: rgba(5, 150, 105, 0.25);

    --state-flaw: #E11D48;
    --state-flaw-bg: rgba(225, 29, 72, 0.08);
    --state-flaw-border: rgba(225, 29, 72, 0.25);

    --state-inquiry: #0284C7;
    --state-inquiry-bg: rgba(2, 132, 199, 0.08);
    --state-inquiry-border: rgba(2, 132, 199, 0.25);

    --nav-bg: rgba(255, 255, 255, 0.95);
    --nav-border: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 10px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.12);
    --shadow-gold: 0 4px 16px rgba(180, 83, 9, 0.1);
}

/* --- Global Reset & Typography Baseline --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Cairo', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;
    text-align: right;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(74px + var(--safe-bottom, 28px));
    transition: background-color 0.25s ease, color 0.25s ease;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Allow text selection in educational prose */
.selectable, .example-card, .chat-bubble, .point-desc, .feedback-box, .playbook-accordion-body {
    user-select: text;
}

/* Latin & Number Font Utility */
.font-latin {
    font-family: 'Outfit', system-ui, sans-serif;
    letter-spacing: -0.01em;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

/* --- Top Editorial App Bar --- */
.top-app-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--nav-border);
    padding-top: calc(var(--safe-top, 36px) + 8px);
    padding-right: 18px;
    padding-left: 18px;
    padding-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-medium);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-info h1 {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.brand-info p {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.2;
    margin-top: 2px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
}

.icon-btn:hover, .icon-btn:active {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

/* --- Main Layout Container --- */
.app-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 16px;
    flex: 1;
}

.view-section {
    display: none;
    animation: editorialFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-section.active {
    display: block;
}

@keyframes editorialFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Home Command Center (3 Core Answers) --- */

/* Section 1: The Daily Reasoning Challenge (ماذا أتعلم اليوم؟) */
.daily-challenge-card {
    background: linear-gradient(145deg, #121A2C 0%, #0D1424 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-xl);
    padding: 22px;
    color: var(--text-primary);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md), var(--shadow-gold);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .daily-challenge-card {
    background: linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 1px solid rgba(180, 83, 9, 0.25);
}

.daily-challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.challenge-eyebrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.challenge-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-gold);
    background: var(--accent-gold-bg);
    border: 1px solid var(--accent-gold-border);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.challenge-index {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.challenge-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.35;
}

.challenge-latin {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-indigo-light);
    margin-bottom: 12px;
    direction: ltr;
    display: inline-block;
}

.challenge-quote-box {
    background: rgba(0, 0, 0, 0.25);
    border-right: 3px solid var(--accent-gold);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
}

[data-theme="light"] .challenge-quote-box {
    background: rgba(180, 83, 9, 0.05);
}

.challenge-quote-text {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    font-style: italic;
}

.challenge-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.btn-editorial-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-gold);
    color: #080C15;
    font-size: 12.5px;
    font-weight: 800;
    padding: 9px 18px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.35);
    transition: all 0.18s ease;
}

.btn-editorial-cta:hover, .btn-editorial-cta:active {
    background: var(--accent-gold-light);
    transform: translateY(-1px);
}

/* Section 2: The Next Step Journey Card (ماذا أفعل بعد ذلك؟) */
.journey-resume-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.18s ease;
}

.journey-resume-card:hover, .journey-resume-card:active {
    border-color: var(--accent-indigo);
    background: var(--bg-card);
    transform: translateY(-1px);
}

.journey-meta-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.journey-level-orb {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-indigo-bg);
    border: 1px solid var(--accent-indigo-border);
    color: var(--accent-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.journey-text-block h4 {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.journey-text-block p {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Section 3: Cognitive Competency Matrix (كيف يتطور تفكيري؟) */
.competency-hub-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 22px;
}

.competency-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.competency-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.competency-radar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(105px, 1fr));
    gap: 8px;
}

.competency-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.competency-pill:hover, .competency-pill.active {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
}

.competency-pill-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.competency-pill-bar {
    width: 100%;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-top: 6px;
}

.competency-pill-fill {
    height: 100%;
    background: var(--accent-gold);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

/* --- Search & Segmented Filtering Controls --- */
.search-wrapper {
    position: relative;
    margin-bottom: 14px;
}

.search-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 46px;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 0 42px 0 38px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: all 0.18s ease;
}

.search-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
    background: var(--bg-card);
}

.search-clear {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--border-medium);
    color: var(--text-secondary);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
}

/* Category Filter Chips */
.filter-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.chip {
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.chip:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.chip.active {
    background: var(--accent-gold);
    color: #080C15;
    border-color: var(--accent-gold);
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

/* Difficulty & Count Row */
.difficulty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 2px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.diff-options {
    display: flex;
    align-items: center;
    gap: 6px;
}

.diff-btn {
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.diff-btn.active {
    background: var(--bg-surface);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

/* --- Redesigned Fallacy Card (Editorial Atlas) --- */
.cards-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fallacy-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.fallacy-card:hover {
    border-color: var(--accent-gold);
    background: var(--bg-card);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.card-title-group {
    flex: 1;
    min-width: 0;
}

.card-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--accent-gold);
    background: var(--accent-gold-bg);
    border: 1px solid var(--accent-gold-border);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.card-name-ar {
    font-size: 16.5px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
    margin-bottom: 2px;
}

.card-name-en {
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    direction: ltr;
    display: inline-block;
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.action-star {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.action-star:hover {
    background: var(--bg-card-hover);
    color: var(--accent-gold);
}

.action-star.starred {
    color: var(--accent-gold);
}

.card-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    font-size: 11px;
}

.card-tag {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    font-weight: 600;
}

.card-diff-tag {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 800;
}

.diff-beginner {
    background: rgba(16, 185, 129, 0.1);
    color: var(--state-valid);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.diff-intermediate {
    background: rgba(14, 165, 233, 0.1);
    color: var(--state-inquiry);
    border: 1px solid rgba(14, 165, 233, 0.25);
}

.diff-advanced {
    background: rgba(244, 63, 94, 0.1);
    color: var(--state-flaw);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

/* --- Forensic Argument Detail Sheet Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2500;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    display: flex;
    opacity: 1;
}

.modal-sheet {
    background: var(--bg-surface);
    border-top: 1px solid var(--border-medium);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-sheet {
    transform: translateY(0);
}

.sheet-handle-bar {
    width: 44px;
    height: 4px;
    background: var(--border-medium);
    border-radius: var(--radius-full);
    margin: 12px auto 6px auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 22px 14px 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
    padding: 20px 22px calc(56px + var(--safe-bottom, 32px)) 22px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px calc(24px + var(--safe-bottom, 32px)) 22px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

/* --- Visual Argument Anatomy (Diagrammatic Flow) --- */
.anatomy-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 14px 0 18px 0;
    position: relative;
}

.anatomy-step {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-right: 4px solid var(--accent-indigo);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    position: relative;
}

.anatomy-step.flaw {
    border-right-color: var(--state-flaw);
    background: var(--state-flaw-bg);
}

.anatomy-step.conclusion {
    border-right-color: var(--accent-gold);
    background: var(--accent-gold-bg);
}

.step-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.anatomy-step.flaw .step-label {
    color: var(--state-flaw);
}

.anatomy-step.conclusion .step-label {
    color: var(--accent-gold);
}

.step-text {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Psychological Hook Card */
.psychology-box {
    background: var(--bg-card);
    border: 1px solid var(--accent-indigo-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 16px;
}

.psychology-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-indigo-light);
    margin-bottom: 6px;
}

.psychology-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* 3-Tier Tactical Refutation Matrix */
.tactics-matrix {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 16px 0;
}

.tactic-item {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
}

.tactic-item.diplomatic {
    border-right: 3.5px solid var(--state-valid);
}

.tactic-item.formal {
    border-right: 3.5px solid var(--accent-indigo);
}

.tactic-item.reversal {
    border-right: 3.5px solid var(--accent-gold);
}

.tactic-badge {
    font-size: 11.5px;
    font-weight: 800;
    margin-bottom: 4px;
}

.tactic-item.diplomatic .tactic-badge { color: var(--state-valid); }
.tactic-item.formal .tactic-badge { color: var(--accent-indigo-light); }
.tactic-item.reversal .tactic-badge { color: var(--accent-gold); }

.tactic-text {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* --- Live Dialogue Simulation Card --- */
.live-dialogue-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin: 18px 0;
    box-shadow: var(--shadow-sm);
}

.live-dialogue-header {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 14px;
    border: 1px solid var(--border-subtle);
}

.live-dialogue-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 6px;
}

.live-dialogue-topic {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 6px;
}

.live-dialogue-context {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.characters-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-subtle);
}

.char-tag {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-weight: 700;
}

.speaker-a-tag {
    background: var(--accent-indigo-bg);
    color: var(--accent-indigo-light);
    border: 1px solid var(--accent-indigo-border);
}

.speaker-b-tag {
    background: var(--accent-gold-bg);
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold-border);
}

.char-vs {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 800;
}

.dialogue-chat-stream {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 4px 0;
}

.chat-turn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.turn-speaker-a { align-items: flex-start; }
.turn-speaker-b { align-items: flex-end; }

.chat-speaker-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 0 4px;
}

.speaker-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: white;
}

.avatar-a { background: var(--accent-indigo); }
.avatar-b { background: var(--accent-gold); color: #080C15; }

.chat-bubble {
    max-width: 92%;
    padding: 12px 15px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.65;
}

.bubble-a {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-top-right-radius: 4px;
    text-align: right;
}

.bubble-b {
    background: var(--accent-indigo-bg);
    color: var(--text-primary);
    border: 1px solid var(--accent-indigo-border);
    border-top-left-radius: 4px;
    text-align: right;
}

.dialogue-refutation-box {
    background: var(--bg-surface);
    border: 1.5px solid var(--accent-gold-border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.refutation-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}

.refutation-point { margin-bottom: 12px; }
.refutation-point:last-child { margin-bottom: 0; }

.point-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 5px;
}

.point-quote {
    background: var(--state-flaw-bg);
    border-right: 3.5px solid var(--state-flaw);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--state-flaw);
    margin-bottom: 6px;
    line-height: 1.55;
}

.point-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.model-quote {
    background: var(--state-valid-bg);
    border-right: 3.5px solid var(--state-valid);
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--state-valid);
    line-height: 1.6;
}

/* --- Forensic Academy (View 3: Detective) --- */
.level-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.level-btn {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.level-btn.active {
    background: var(--accent-indigo);
    color: #FFFFFF;
    border-color: var(--accent-indigo);
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.detective-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-md);
}

.scenario-dialogue {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border-right: 4px solid var(--accent-gold);
    padding: 16px;
    font-size: 13.5px;
    line-height: 1.75;
    white-space: pre-line;
    margin: 14px 0;
    color: var(--text-primary);
}

.detective-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.quiz-option {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.18s ease;
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
    transform: translateX(-2px);
}

.quiz-option.correct {
    background: var(--state-valid-bg) !important;
    border-color: var(--state-valid) !important;
    color: var(--state-valid) !important;
    font-weight: 800;
}

.quiz-option.incorrect {
    background: var(--state-flaw-bg) !important;
    border-color: var(--state-flaw) !important;
    color: var(--state-flaw) !important;
    opacity: 0.8;
}

.feedback-box {
    margin-top: 14px;
    animation: editorialFadeIn 0.2s ease;
}

/* --- Debater Playbook (View 4: Accordions) --- */
.playbook-accordion-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.playbook-accordion-card:hover {
    border-color: var(--border-medium);
}

.playbook-accordion-header {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background: var(--bg-surface);
}

.playbook-chevron {
    color: var(--text-muted);
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
}

.playbook-accordion-card.open .playbook-chevron {
    transform: rotate(180deg);
}

.playbook-accordion-body {
    display: none;
    padding: 0 18px 18px 18px;
    border-top: 1px solid var(--border-subtle);
}

.playbook-accordion-card.open .playbook-accordion-body {
    display: block;
    animation: editorialFadeIn 0.2s ease;
}

/* --- Buttons Component Library --- */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    flex: 1;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gold);
    color: #080C15;
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.btn-secondary.starred {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    background: var(--accent-gold-bg);
}

/* --- Scrubber Radar (View 2) --- */
.scrubber-card {
    background: linear-gradient(145deg, #121A2C 0%, #0D1424 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 22px;
    color: var(--text-primary);
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
}

.custom-range {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.custom-range::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gold);
    border: 2px solid #080C15;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
    cursor: pointer;
}

.scrubber-spotlight {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 22px;
    box-shadow: var(--shadow-md);
}

/* --- Stats & Mastery (View 6) --- */
.progress-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.bar-track {
    width: 100%;
    height: 7px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 8px;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-gold));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.stat-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

/* --- Bottom Navigation Bar --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 50;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-top: 8px;
    padding-bottom: calc(var(--safe-bottom, 28px) + 6px);
    max-width: 680px;
    margin: 0 auto;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    flex: 1;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: all 0.15s ease;
}

.nav-item.active {
    color: var(--accent-gold);
}

.nav-item.active svg {
    stroke-width: 2.5;
    transform: translateY(-2px);
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}


/* ========================================================
   COURSE-INSPIRED LEARNING EXPERIENCE DESIGN SYSTEM (v5.0)
   Structured Curriculum, Progressive Path, Bite-sized Lessons,
   Smart Review of Mistakes, and Adult Intellectual Gamification
   ======================================================== */

/* --- Top Header Stats Row --- */
.header-stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}
.header-stats-row::-webkit-scrollbar {
    display: none;
}

.stat-chip-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.stat-chip-pill.streak {
    color: #F59E0B;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
}

.stat-chip-pill.daily-goal {
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
}

.stat-chip-pill.mastery-xp {
    color: var(--accent-gold);
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.08);
}

/* --- Course Continuation Hero Card --- */
.course-continuation-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, var(--bg-surface) 100%);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.course-continuation-card::after {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.course-continuation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.course-unit-tag {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-indigo);
    background: var(--accent-indigo-bg);
    border: 1px solid var(--accent-indigo-border);
    padding: 3px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.course-lesson-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 4px 0 6px 0;
    line-height: 1.4;
}

.course-lesson-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.course-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}

.course-progress-track {
    height: 7px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 16px;
}

.course-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-gold));
    border-radius: 99px;
    transition: width 0.4s ease;
}

.course-cta-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    color: #FFFFFF;
    border: none;
    padding: 13px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.course-cta-btn:hover, .course-cta-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(99, 102, 241, 0.55);
}

/* --- Smart Review Banner --- */
.course-review-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(19, 30, 51, 0.95) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 20px;
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.course-review-banner:hover {
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}

.course-review-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.course-review-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.16);
    color: #F59E0B;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* --- Visual Learning Path Tree --- */
.learning-path-wrapper {
    margin: 24px 0;
}

.unit-container-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 26px;
    padding: 22px 18px;
    margin-bottom: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    position: relative;
}

.unit-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}

.unit-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.unit-icon-orb {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.unit-label-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.unit-sub-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 3px;
    line-height: 1.4;
}

.unit-badge-pill {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 10.5px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

/* Vertical Connected Node Tree */
.unit-tree-path {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
    padding: 10px 0 20px 0;
}

.unit-tree-path::before {
    content: '';
    position: absolute;
    top: 25px;
    bottom: 35px;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent-indigo) 0%, rgba(255, 255, 255, 0.08) 100%);
    border-radius: 99px;
    z-index: 1;
}

.lesson-node-item {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    width: 100%;
    max-width: 220px;
}

.lesson-node-bubble {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    position: relative;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.lesson-node-bubble.completed {
    background: linear-gradient(135deg, #059669, #10B981);
    color: #FFFFFF;
    border: 3px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.lesson-node-bubble.active {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    color: #FFFFFF;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 0 7px rgba(99, 102, 241, 0.25), 0 8px 28px rgba(99, 102, 241, 0.5);
    animation: activeNodePulse 2.4s infinite;
}

.lesson-node-bubble.locked {
    background: var(--bg-card);
    color: var(--text-muted);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    opacity: 0.7;
    cursor: not-allowed;
}

@keyframes activeNodePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.5); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 12px rgba(99, 102, 241, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.lesson-node-tag {
    position: absolute;
    bottom: -6px;
    background: var(--accent-gold);
    color: #080C15;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 99px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lesson-node-title {
    margin-top: 10px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.35;
}

.lesson-node-sub {
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Course Interactive Lesson Player Modal --- */
.lesson-player-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-main);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.lesson-player-modal.active {
    display: flex;
    animation: playerSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes playerSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.player-top-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: calc(var(--safe-top, 28px) + 12px) 20px 14px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 20;
}

.player-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.player-close-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.player-segments-wrapper {
    flex: 1;
    display: flex;
    gap: 6px;
    height: 8px;
}

.player-segment {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 99px;
    overflow: hidden;
    position: relative;
}

.player-segment.filled {
    background: var(--accent-gold);
}

.player-segment.current {
    background: var(--accent-indigo);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.player-body-content {
    flex: 1;
    padding: 24px 20px 120px 20px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

/* Lesson Cards inside Player */
.player-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 22px;
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.player-station-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-gold);
    background: var(--accent-gold-bg);
    border: 1px solid var(--accent-gold-border);
    padding: 4px 12px;
    border-radius: 99px;
    margin-bottom: 12px;
}

.player-card-title {
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 10px;
}

.player-card-desc {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 18px;
}

/* Practice Choices inside Player */
.player-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 18px 0;
}

.player-option-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 2px solid var(--border-subtle);
    border-radius: 18px;
    color: var(--text-primary);
    text-align: right;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    transition: all 0.2s ease;
}

.player-option-btn:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: var(--bg-card-hover);
}

.player-option-btn.selected {
    border-color: var(--accent-indigo);
    background: var(--accent-indigo-bg);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.option-letter-badge {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.player-option-btn.selected .option-letter-badge {
    background: var(--accent-indigo);
    color: #FFFFFF;
}

/* Bottom Feedback Sheet in Lesson Player */
/* Bottom Feedback Sheet in Lesson Player (100% Opaque & High Contrast) */
.player-feedback-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-surface) !important; /* 100% Solid Opaque Base */
    border-top: 3px solid var(--border-medium);
    border-radius: 26px 26px 0 0;
    padding: 22px 24px calc(var(--safe-bottom, 28px) + 18px) 24px;
    display: none;
    z-index: 2000;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.95);
    max-width: 680px;
    margin: 0 auto;
}

.player-feedback-sheet.active {
    display: block;
    animation: feedbackSheetUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes feedbackSheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.player-feedback-sheet.correct {
    background: linear-gradient(180deg, #091D1A 0%, #061311 100%) !important;
    border-top-color: #10B981 !important;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.95), 0 -2px 20px rgba(16, 185, 129, 0.3);
}

.player-feedback-sheet.incorrect {
    background: linear-gradient(180deg, #240E16 0%, #12060B 100%) !important;
    border-top-color: #F43F5E !important;
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.95), 0 -2px 20px rgba(244, 63, 94, 0.3);
}

.feedback-status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.feedback-title {
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.2px;
}

.feedback-correct .feedback-title {
    color: #10B981;
}

.feedback-incorrect .feedback-title {
    color: #FB7185;
}

.feedback-text {
    font-size: 13.5px;
    font-weight: 600;
    color: #F8FAFC !important;
    line-height: 1.75;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.feedback-action-btn {
    width: 100%;
    padding: 13px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.feedback-action-btn.correct-btn {
    background: linear-gradient(135deg, #059669, #10B981);
    color: #fff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.feedback-action-btn.incorrect-btn {
    background: linear-gradient(135deg, #E11D48, #F43F5E);
    color: #fff;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.3);
}

/* --- Dedicated Smart Review View --- */
.review-hub-header {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, var(--bg-surface) 100%);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 22px;
    padding: 20px;
    margin-bottom: 20px;
}

.mistake-card {
    background: var(--bg-surface);
    border: 1px solid rgba(244, 63, 94, 0.25);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.mistake-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    bottom: 0;
    background: #F43F5E;
}


/* ========================================================
   FALLACY DEMARCATION & CONFUSION COMPARISON SYSTEM
   Scientific distinctions between easily confused fallacies
   ======================================================== */

.confusion-warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, var(--bg-surface) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.35);
    border-radius: 18px;
    padding: 16px;
    margin: 18px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
}

.confusion-warning-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    bottom: 0;
    background: #F59E0B;
}

.confusion-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.confusion-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
}

.confusion-trap-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
}

.demarcation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

@media (max-width: 480px) {
    .demarcation-grid {
        grid-template-columns: 1fr;
    }
}

.demarcation-col {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px;
}

.demarcation-col.current {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.08);
}

.demarcation-col.sibling {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.06);
}

.demarcation-col-title {
    font-size: 12.5px;
    font-weight: 800;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.demarcation-col.current .demarcation-col-title {
    color: var(--accent-indigo);
}

.demarcation-col.sibling .demarcation-col-title {
    color: #F59E0B;
}

.demarcation-col-desc {
    font-size: 11.5px;
    color: var(--text-primary);
    line-height: 1.55;
    margin: 0;
}

.demarcation-golden-rule {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #E2E8F0;
    line-height: 1.6;
}

.demarcation-golden-rule strong {
    color: #10B981;
}

.demarcation-jump-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demarcation-jump-btn:hover, .demarcation-jump-btn:active {
    background: #F59E0B;
    color: #080C15;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}

/* Hub Entry Banner */
.demarcation-hub-banner {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, var(--bg-surface) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 20px;
    padding: 16px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.demarcation-hub-banner:hover {
    border-color: rgba(212, 175, 55, 0.5);
    transform: translateY(-1px);
}

/* --- Foundations & Art of Dialogue Gateway --- */
.foundations-hub-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, var(--bg-surface) 50%, rgba(212, 175, 55, 0.12) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 22px;
    padding: 18px 20px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.foundations-hub-banner::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-indigo), var(--accent-gold));
}

.foundations-hub-banner:hover {
    border-color: rgba(212, 175, 55, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(99, 102, 241, 0.25);
}

.foundations-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #818CF8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.foundations-banner-badge {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 800;
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 2px 10px;
    border-radius: 99px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.foundations-banner-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.foundations-banner-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.foundations-banner-btn {
    font-size: 11.5px;
    font-weight: 800;
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.2);
    color: #A5B4FC;
    border: 1px solid rgba(99, 102, 241, 0.5);
    border-radius: 12px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.foundations-hub-banner:hover .foundations-banner-btn {
    background: var(--accent-indigo);
    color: white;
}

/* Modal Inner Tabs */
.foundations-tabs-nav {
    display: flex;
    gap: 6px;
    padding: 12px 18px 8px 18px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    scrollbar-width: none;
}
.foundations-tabs-nav::-webkit-scrollbar { display: none; }

.f-tab-btn {
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.f-tab-btn.active {
    background: var(--accent-indigo);
    color: #FFFFFF;
    border-color: var(--accent-indigo);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

/* Chapter Articles */
.foundations-chapter {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}
.foundations-chapter.active {
    display: block;
}

.f-article-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(212, 175, 55, 0.06) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 20px;
}

.f-lead-quote {
    background: rgba(212, 175, 55, 0.08);
    border-right: 4px solid var(--accent-gold);
    padding: 14px 18px;
    border-radius: 0 14px 14px 0;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.7;
    margin: 16px 0;
    font-style: italic;
}

.f-content-section {
    margin-bottom: 24px;
}

.f-section-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.f-prose {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 14px;
}

.f-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

@media (max-width: 580px) {
    .f-grid-2 {
        grid-template-columns: 1fr;
    }
}

.f-card-box {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 14px 16px;
    transition: transform 0.2s;
}

.f-card-box.indigo-tone {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.04);
}

.f-card-box.gold-tone {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(212, 175, 55, 0.04);
}

.f-card-box.emerald-tone {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.04);
}

.f-card-box.rose-tone {
    border-color: rgba(244, 63, 94, 0.3);
    background: rgba(244, 63, 94, 0.04);
}

.f-pill-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 99px;
    margin-bottom: 6px;
}

.f-code-box {
    background: #0D1322;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px;
    font-size: 12px;
    color: #CBD5E1;
    line-height: 1.6;
    margin: 12px 0;
}

.f-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    margin-bottom: calc(36px + var(--safe-bottom, 32px));
    padding-top: 16px;
    padding-bottom: 12px;
    border-top: 1px solid var(--border-subtle);
}

/* ========================================================
   MIND MAP LESSON EXPLORER (خريطة تفكيك الدرس التفاعلية)
   ======================================================== */

.mindmap-explorer-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-bottom: 30px;
}

/* Top Lesson Status & Mastery Tracker */
.mindmap-top-bar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 10px 16px;
    margin-bottom: 20px;
}

.mindmap-tag-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mindmap-category-tag {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 3px 10px;
    border-radius: 99px;
}

.mindmap-status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 4px 12px;
    border-radius: 99px;
}

/* The Constellation Hub Layout */
.mindmap-hub-layout {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    position: relative;
}

/* Challenge Node (Boss Gate at Top) */
.mindmap-challenge-gate {
    width: 100%;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, var(--bg-surface) 100%);
    border: 1.5px dashed rgba(212, 175, 55, 0.35);
    border-radius: 20px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 18px rgba(0,0,0,0.25);
    position: relative;
    overflow: hidden;
}

.mindmap-challenge-gate.locked {
    opacity: 0.65;
    filter: grayscale(0.3);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.mindmap-challenge-gate.unlocked {
    border-style: solid;
    border-color: var(--accent-gold);
    animation: challengeGateGlow 2.5s infinite alternate ease-in-out;
}

@keyframes challengeGateGlow {
    from {
        box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2), inset 0 0 15px rgba(212, 175, 55, 0.1);
    }
    to {
        box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4), inset 0 0 25px rgba(212, 175, 55, 0.2);
    }
}

/* Central Fallacy Orb */
.mindmap-core-orb {
    width: 100%;
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.95) 0%, #0A101D 100%);
    border: 2px solid rgba(99, 102, 241, 0.35);
    border-radius: 24px;
    padding: 24px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mindmap-core-orb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.15), transparent 70%);
    pointer-events: none;
}

.mindmap-core-icon {
    font-size: 34px;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

.mindmap-core-title {
    font-size: 20px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.mindmap-core-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 14px;
    direction: ltr;
}

.mindmap-capsule-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--accent-gold);
    font-size: 11.5px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 99px;
    cursor: pointer;
    transition: all 0.2s;
}

.mindmap-capsule-btn:hover {
    background: rgba(212, 175, 55, 0.22);
    transform: translateY(-1px);
}

/* Satellite Nodes Grid */
.mindmap-satellite-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .mindmap-satellite-grid {
        grid-template-columns: 1fr;
    }
}

.mindmap-node-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: 18px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.mindmap-node-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.mindmap-node-card:active {
    transform: scale(0.98);
}

.mindmap-node-card.completed {
    border-color: rgba(16, 185, 129, 0.45);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, var(--bg-surface) 100%);
}

.mindmap-node-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mindmap-node-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.mindmap-node-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.mindmap-node-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.mindmap-node-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.2s;
}

.mindmap-node-card.completed .mindmap-node-badge {
    background: #10B981;
    border-color: #10B981;
    color: #FFFFFF;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* --- Mind Map Bottom Sheet Modal --- */
.mindmap-bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 16, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3200;
    display: none;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.28s ease;
}

.mindmap-bottom-sheet-overlay.active {
    display: flex;
    opacity: 1;
}

.mindmap-bottom-sheet {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    max-height: 86vh;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: none;
    border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.mindmap-bottom-sheet-overlay.active .mindmap-bottom-sheet {
    transform: translateY(0);
}

.mindmap-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.mindmap-sheet-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.mindmap-sheet-category-badge {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent-gold);
    text-transform: uppercase;
}

.mindmap-sheet-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 2px 0 0 0;
}

.mindmap-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.mindmap-sheet-footer {
    padding: 14px 20px calc(var(--safe-bottom, 32px) + 28px) 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    display: flex;
    gap: 10px;
}

.mindmap-done-btn {
    flex: 1;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 16px;
    padding: 14px 20px;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.mindmap-done-btn:active {
    transform: scale(0.98);
}

.mindmap-next-btn {
    flex: 0 0 95px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 16px;
    padding: 14px 10px;
    font-size: 13px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mindmap-next-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* Logical Circuit Blueprint Styles inside Sheet */
.blueprint-circuit {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
}

.blueprint-step {
    border-radius: 14px;
    padding: 12px 16px;
    line-height: 1.6;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blueprint-step.premise {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.blueprint-step.flaw {
    background: rgba(244, 63, 94, 0.1);
    border: 1.5px solid rgba(244, 63, 94, 0.45);
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.12);
}

.blueprint-step.conclusion {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.blueprint-tag {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
}

/* ========================================================
   MACRO CATALOGUE TREE VIEW (شجرة الموسوعة الكبرى)
   ======================================================== */

.catalogue-mode-bar {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 5px;
    border-radius: 16px;
    margin-bottom: 18px;
}

.cat-mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 12.5px;
    font-weight: 800;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-mode-btn.active {
    background: var(--bg-surface);
    color: var(--accent-gold);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.catalogue-tree-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

/* Root Tree Trunk */
.tree-root-hub {
    background: radial-gradient(circle at center, rgba(30, 41, 59, 0.95) 0%, #0A101D 100%);
    border: 2px solid rgba(212, 175, 55, 0.35);
    border-radius: 22px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.tree-root-hub::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 15px;
    background: var(--accent-gold);
    box-shadow: 0 0 10px var(--accent-gold);
}

.tree-root-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 4px 0;
}

.tree-root-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Category Branches */
.tree-branch-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    position: relative;
}

.tree-branch-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.tree-branch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
}

.tree-branch-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tree-branch-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.tree-branch-title {
    font-size: 15px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.tree-branch-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.tree-branch-count-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 99px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.tree-branch-chevron {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.25s ease;
}

.tree-branch-card.open .tree-branch-chevron {
    transform: rotate(180deg);
}

/* Leaf Nodes Cluster */
.tree-branch-nodes {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

.tree-branch-card.open .tree-branch-nodes {
    display: grid;
}

.tree-leaf-node {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tree-leaf-node:hover {
    transform: translateY(-2px);
    background: var(--bg-card-hover);
    border-color: var(--accent-indigo);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.tree-leaf-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tree-leaf-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.tree-leaf-latin {
    font-size: 10px;
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    direction: ltr;
    text-align: right;
}

/* Fallacy Detail Modal Mind Map Hub */
.detail-mindmap-hub {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 0;
}

.modal-view-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 6px;
}

.modal-mode-switch-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 99px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.modal-mode-switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-gold);
}


/* ========================================================
   INTENSIVE TRAINING CAMP STYLES (قسم التدريب المكثف)
   ======================================================== */

.bottom-nav .nav-item {
    padding: 4px 4px;
    font-size: 9.8px;
    white-space: nowrap;
}

.intensive-hub-banner {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.16) 0%, rgba(99, 102, 241, 0.18) 50%, var(--bg-surface) 100%);
    border: 1.5px solid rgba(244, 63, 94, 0.45);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(244, 63, 94, 0.15);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.intensive-hub-banner:hover, .intensive-hub-banner:active {
    transform: translateY(-2px);
    border-color: #FB7185;
    box-shadow: 0 14px 34px rgba(244, 63, 94, 0.25);
}

.intensive-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid rgba(244, 63, 94, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.intensive-banner-badge {
    font-size: 10.5px;
    font-weight: 800;
    color: #FDA4AF;
    background: rgba(244, 63, 94, 0.2);
    padding: 2px 9px;
    border-radius: 99px;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.intensive-banner-title {
    font-size: 15.5px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 2px 0 4px 0;
    line-height: 1.35;
}

.intensive-banner-desc {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.55;
}

.intensive-banner-btn {
    width: 100%;
    background: linear-gradient(135deg, #E11D48, #6366F1);
    color: #FFFFFF;
    border: none;
    border-radius: 13px;
    padding: 10px 16px;
    font-size: 12.5px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
}

.intensive-top-header {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 12px;
}

.intensive-stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.intensive-stat-pill {
    font-size: 11.5px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    padding: 5px 10px;
    border-radius: 99px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.intensive-util-btn {
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #A5B4FC;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 11px;
    border-radius: 99px;
    cursor: pointer;
    font-family: inherit;
    margin-right: auto;
    transition: all 0.15s;
}

.intensive-util-btn.danger {
    margin-right: 0;
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.3);
    color: #FDA4AF;
}

.intensive-index-drawer {
    background: var(--bg-surface);
    border: 1.5px solid var(--accent-indigo);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.intensive-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 7px;
    max-height: 240px;
    overflow-y: auto;
    padding: 2px;
}

.intensive-idx-cell {
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.intensive-idx-cell.current {
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.15);
}

.intensive-idx-cell.solved-correct {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34D399;
}

.intensive-idx-cell.solved-wrong {
    background: rgba(244, 63, 94, 0.18);
    border-color: rgba(244, 63, 94, 0.45);
    color: #FB7185;
}

.intensive-case-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding: 4px 2px 10px 2px;
    margin-bottom: 8px;
    scrollbar-width: none;
}

.intensive-case-strip::-webkit-scrollbar {
    display: none;
}

.case-strip-pill {
    min-width: 38px;
    height: 34px;
    padding: 0 9px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.case-strip-pill.active {
    border: 2px solid var(--accent-gold);
    background: rgba(212, 175, 55, 0.16);
    color: var(--accent-gold);
    transform: translateY(-1px);
}

.case-strip-pill.correct {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(16, 185, 129, 0.14);
    color: #34D399;
}

.case-strip-pill.wrong {
    border-color: rgba(244, 63, 94, 0.45);
    background: rgba(244, 63, 94, 0.14);
    color: #FB7185;
}

.intensive-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: calc(28px + var(--safe-bottom, 28px));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.intensive-dialogue-box {
    background: var(--overlay-scrim, rgba(15, 23, 42, 0.75));
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-right: 4px solid var(--accent-indigo);
    border-radius: 16px;
    padding: 15px 16px;
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.85;
    white-space: pre-line;
    margin: 12px 0 16px 0;
}

[data-theme="light"] .intensive-dialogue-box {
    background: rgba(99, 102, 241, 0.06);
}

.intensive-option-btn {
    width: 100%;
    text-align: right;
    background: var(--bg-card);
    border: 1.5px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px 15px;
    margin-bottom: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.65;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.intensive-option-btn:hover:not(:disabled) {
    border-color: var(--accent-indigo);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.intensive-option-btn.opt-correct {
    border: 2px solid #10B981 !important;
    background: rgba(16, 185, 129, 0.14) !important;
}

.intensive-option-btn.opt-wrong {
    border: 2px solid #F43F5E !important;
    background: rgba(244, 63, 94, 0.14) !important;
}

.intensive-opt-letter {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.intensive-option-btn.opt-correct .intensive-opt-letter {
    background: #10B981;
    color: #080C15;
    border-color: #10B981;
}

.intensive-option-btn.opt-wrong .intensive-opt-letter {
    background: #F43F5E;
    color: #FFFFFF;
    border-color: #F43F5E;
}

/* Diagnostic & Refutation Breakdown Cards */
.diagnostic-panel {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: fadeIn 0.25s ease;
}

.diag-card {
    border-radius: 18px;
    padding: 16px;
    border: 1.5px solid var(--border-subtle);
}

.diag-card.chosen-wrong {
    background: rgba(244, 63, 94, 0.09);
    border-color: rgba(244, 63, 94, 0.45);
}

.diag-card.chosen-correct {
    background: rgba(16, 185, 129, 0.09);
    border-color: rgba(16, 185, 129, 0.45);
}

.diag-card.all-wrongs {
    background: var(--bg-card);
    border-color: var(--border-medium);
}

.diag-subbox {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 11px 13px;
    margin-top: 9px;
    border-right: 3.5px solid var(--accent-indigo);
}

[data-theme="light"] .diag-subbox {
    background: rgba(15, 23, 42, 0.04);
}

.diag-wrong-item {
    background: var(--bg-surface);
    border: 1px solid rgba(244, 63, 94, 0.28);
    border-right: 4px solid #F43F5E;
    border-radius: 14px;
    padding: 13px 14px;
    margin-top: 10px;
}

.intensive-nav-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}


/* --- Smart Training Mode Switcher, Coach Radar & Tactical Arsenal --- */
.intensive-mode-switcher {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    background: var(--overlay-scrim, rgba(15, 23, 42, 0.65));
    padding: 5px;
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 12px;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
}

.int-mode-btn {
    min-width: 0;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    padding: 8px 4px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    box-sizing: border-box;
}

.int-mode-icon {
    font-size: 15px;
    line-height: 1;
}

.int-mode-label {
    display: block;
    width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
}

.int-mode-btn.active {
    background: linear-gradient(135deg, #F43F5E 0%, #6366F1 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.coach-skill-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 14px 0;
}

@media (max-width: 520px) {
    .coach-skill-grid {
        grid-template-columns: 1fr;
    }
}

.coach-skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 14px;
    transition: all 0.2s;
}

.arsenal-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border-medium);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.arsenal-pillar-box {
    border-radius: 13px;
    padding: 11px 13px;
    margin-top: 9px;
    font-size: 12.5px;
    line-height: 1.7;
}
