/* ════════════════════════════════════════════════════════════════
   EduPlatform AI — CSS
   Mirrors the Streamlit UI exactly:
   - Same gradient header (#1e3a5f → #2d6a9f → #1a8c6e)
   - Same badge colors
   - Same pipeline sidebar layout
   - Same info cards
════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap');

/* ─── CSS Variables (same palette as Streamlit CSS) ─────────── */
:root {
    --primary-blue: #2d6a9f;
    --dark-blue: #1e3a5f;
    --teal: #1a8c6e;
    --sidebar-bg: #f0f2f6;
    --sidebar-width: 280px;
    --white: #ffffff;
    --text: #262730;
    --text-muted: #555;
    --border: #e0e0e0;
    --radius: 8px;

    /* Badge colors — identical to Python CSS */
    --badge-curriculum-bg: #e3f2fd; --badge-curriculum-text: #1565c0;
    --badge-tutor-bg: #e8f5e9;      --badge-tutor-text: #2e7d32;
    --badge-quiz-bg: #fff3e0;       --badge-quiz-text: #e65100;
    --badge-feedback-bg: #f3e5f5;   --badge-feedback-text: #6a1b9a;
    --badge-genai-bg: #fce4ec;      --badge-genai-text: #880e4f;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; color: var(--text); background: #f5f7fa; }

/* ─── Layout ─────────────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.sidebar-header h2 { font-size: 1rem; font-weight: 700; color: var(--dark-blue); }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.form-input {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--primary-blue); }

/* Level radio group */
.level-selector {
    display: flex;
    gap: 0.4rem;
}
.level-option {
    flex: 1;
    cursor: pointer;
}
.level-option input[type="radio"] { display: none; }
.level-option span {
    display: block;
    padding: 0.4rem 0.3rem;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.2s;
    background: white;
}
.level-option input:checked + span {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

/* Toggle */
.toggle-label { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.88rem; }
.toggle-input { display: none; }
.toggle-switch {
    width: 36px; height: 20px;
    background: #ccc; border-radius: 10px;
    position: relative; transition: background 0.2s; flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; position: absolute;
    width: 16px; height: 16px;
    background: white; border-radius: 50%;
    top: 2px; left: 2px; transition: left 0.2s;
}
.toggle-input:checked + .toggle-switch { background: var(--primary-blue); }
.toggle-input:checked + .toggle-switch::after { left: 18px; }

.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 0.25rem 0; }
.sidebar-footer { font-size: 0.75rem; color: var(--text-muted); }

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--teal));
    color: white; border: none;
    padding: 0.65rem 1rem;
    border-radius: var(--radius);
    font-size: 0.95rem; font-weight: 600;
    cursor: pointer; width: 100%;
    transition: opacity 0.2s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary {
    background: white; color: var(--primary-blue);
    border: 1.5px solid var(--primary-blue);
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--primary-blue); color: white; }

/* Alerts */
.alert {
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.alert-error   { background: #ffebee; color: #c62828; border: 1px solid #ffcdd2; }
.alert-info    { background: #e3f2fd; color: #1565c0; border: 1px solid #bbdefb; }

/* Pipeline steps (sidebar) */
.pipeline-section h3 { font-size: 0.9rem; font-weight: 700; color: var(--dark-blue); margin-bottom: 0.5rem; }
.pipeline-step {
    display: flex; align-items: center; gap: 0.6rem;
    border-left: 4px solid var(--primary-blue);
    padding: 0.4rem 0.7rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    background: white;
    margin-bottom: 0.25rem;
}
.pipeline-icon { font-size: 1.1rem; }
.pipeline-text { display: flex; flex-direction: column; }
.pipeline-text strong { font-size: 0.85rem; }
.pipeline-text small { font-size: 0.75rem; color: var(--text-muted); }
.pipeline-arrow { text-align: center; color: var(--text-muted); font-size: 0.8rem; line-height: 1; }

/* ─── Main Content ────────────────────────────────────────────── */
.main-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    max-width: calc(100vw - var(--sidebar-width));
    position: relative;
}

/* Header — exact gradient match to Python's .main-header */
.main-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 50%, #1a8c6e 100%);
    padding: 2rem; border-radius: 12px; color: white; margin-bottom: 1.5rem;
    text-align: center;
}
.main-header h1 { font-size: 2rem; font-weight: 800; margin-bottom: 0.4rem; }
.main-header p { font-size: 1.05rem; opacity: 0.9; margin-bottom: 1rem; }
.badge-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }

/* Badges — exact match to Python CSS */
.agent-badge {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 0.8em; font-weight: 600;
}
.badge-curriculum { background: var(--badge-curriculum-bg); color: var(--badge-curriculum-text); }
.badge-tutor      { background: var(--badge-tutor-bg);      color: var(--badge-tutor-text); }
.badge-quiz       { background: var(--badge-quiz-bg);        color: var(--badge-quiz-text); }
.badge-feedback   { background: var(--badge-feedback-bg);    color: var(--badge-feedback-text); }
.badge-genai      { background: var(--badge-genai-bg);       color: var(--badge-genai-text); }

/* ─── Landing State ────────────────────────────────────────────── */
.info-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 2rem; }
.info-card {
    background: #e3f2fd; border-radius: var(--radius);
    padding: 1.25rem; text-align: center;
}
.info-card-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.info-card h3 { color: var(--dark-blue); font-size: 1rem; margin-bottom: 0.5rem; }
.info-card p  { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; }
.landing-hint {
    text-align: center; font-size: 1.1rem; color: var(--text-muted);
    padding: 1rem; border: 2px dashed var(--border); border-radius: var(--radius);
}

/* ─── Loading Overlay ────────────────────────────────────────────── */
.loading-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.loading-card {
    background: white; border-radius: 12px;
    padding: 2rem 2.5rem; text-align: center; min-width: 360px;
}
.loading-card h3 { margin-bottom: 1.5rem; color: var(--dark-blue); }
.spinner {
    width: 48px; height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 1.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { text-align: left; }
.loading-step {
    padding: 0.4rem 0.75rem; border-radius: var(--radius);
    font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem;
    transition: all 0.3s;
}
.loading-step.active {
    background: #e3f2fd; color: var(--primary-blue); font-weight: 600;
}
.loading-step.done { color: var(--teal); }
.loading-step.done::before { content: '✅ '; }

/* ─── Tabs ───────────────────────────────────────────────────────── */
.tabs-nav {
    display: flex; gap: 0.25rem;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem; flex-wrap: wrap;
    position: relative; z-index: 1;
}
.tab-btn {
    padding: 0.65rem 1.2rem;
    border: none; background: transparent;
    font-size: 0.9rem; font-weight: 500;
    cursor: pointer; color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s; border-radius: var(--radius) var(--radius) 0 0;
    pointer-events: auto !important;
    z-index: 2;
    position: relative;
}
.tab-btn:hover { background: #f0f2f6; color: var(--text); }
.tab-btn.active { color: var(--primary-blue); border-bottom-color: var(--primary-blue); font-weight: 700; }

.tab-content { display: none; }
.tab-content.active { display: block; }
.tab-title { font-size: 1.3rem; font-weight: 700; color: var(--dark-blue); margin-bottom: 1.25rem; }
.tab-subtitle { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; margin-top: -0.75rem; }

/* ─── Two Column Layout ──────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 280px; gap: 1.5rem; }
.key-points-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
    margin-bottom: 1rem;
}
.key-points-card h3 { font-size: 0.95rem; color: var(--dark-blue); margin-bottom: 0.75rem; }
.key-points-card ul { padding-left: 1.2rem; }
.key-points-card li { font-size: 0.88rem; margin-bottom: 0.35rem; line-height: 1.4; }

/* ─── Markdown rendered content ─────────────────────────────────── */
.markdown-body { line-height: 1.7; font-size: 0.95rem; }
.markdown-body h1 { font-size: 1.5rem; color: var(--dark-blue); margin: 1.5rem 0 0.75rem; }
.markdown-body h2 { font-size: 1.25rem; color: var(--dark-blue); margin: 1.25rem 0 0.6rem; }
.markdown-body h3 { font-size: 1.05rem; color: var(--primary-blue); margin: 1rem 0 0.5rem; }
.markdown-body p  { margin-bottom: 0.75rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.markdown-body li { margin-bottom: 0.3rem; }
.markdown-body code {
    background: #f4f6f9; padding: 0.15rem 0.4rem;
    border-radius: 4px; font-family: 'Fira Code', monospace; font-size: 0.88rem;
}
.markdown-body pre {
    background: #f4f6f9; padding: 1rem;
    border-radius: var(--radius); overflow-x: auto; margin-bottom: 1rem;
}
.markdown-body pre code { background: none; padding: 0; }
.markdown-body blockquote {
    border-left: 4px solid var(--primary-blue);
    padding: 0.5rem 1rem; background: #f8f9fa;
    border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 0.75rem;
}
.markdown-body strong { color: var(--dark-blue); }
.markdown-body hr { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }

/* ─── GenAI overview expander ────────────────────────────────────── */
.genai-overview {
    background: #fce4ec; border-radius: var(--radius); padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.genai-overview summary { cursor: pointer; font-weight: 600; color: #880e4f; font-size: 0.9rem; }
.genai-overview p { margin-top: 0.5rem; font-size: 0.9rem; line-height: 1.6; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ─── Visual Tab ─────────────────────────────────────────────────── */
.generated-image {
    width: 100%; border-radius: var(--radius); border: 1px solid var(--border);
    margin-bottom: 1rem;
}
.prompt-details { margin-top: 0.75rem; }
.prompt-details summary { cursor: pointer; font-size: 0.88rem; color: var(--text-muted); }
.prompt-details code {
    display: block; margin-top: 0.5rem; padding: 0.75rem;
    background: #f4f6f9; border-radius: var(--radius); white-space: pre-wrap;
}

/* ─── Quiz Tab ───────────────────────────────────────────────────── */
.question-block { margin-bottom: 1.5rem; }
.question-text  { font-size: 0.95rem; margin-bottom: 0.75rem; line-height: 1.5; }
.options-group  { display: flex; flex-direction: column; gap: 0.4rem; }
.option-label {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; font-size: 0.9rem;
    transition: all 0.15s; background: white;
}
.option-label:hover { border-color: var(--primary-blue); background: #e3f2fd; }
.option-label input { accent-color: var(--primary-blue); }
.short-answer-group textarea.answer-textarea {
    width: 100%; padding: 0.65rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem; font-family: inherit; resize: vertical;
    transition: border-color 0.2s;
}
.short-answer-group textarea:focus { outline: none; border-color: var(--primary-blue); }
.question-divider { border: none; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.btn-quiz { width: auto; padding: 0.7rem 2rem; font-size: 1rem; }
.question-result { margin-bottom: 0.75rem; }
.answer-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; padding-left: 1.5rem; }
.section-divider { border: none; border-top: 2px solid var(--border); margin: 1.5rem 0; }

/* ─── Chat Tab ───────────────────────────────────────────────────── */
.chat-container {
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; background: white;
}
.chat-messages {
    min-height: 300px; max-height: 480px;
    overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: 1rem;
}
.chat-bubble {
    display: flex; gap: 0.75rem; align-items: flex-start;
}
.chat-user { flex-direction: row-reverse; }
.chat-user .chat-text { background: #e3f2fd; }
.chat-assistant .chat-text { background: #f4f6f9; }
.chat-avatar { font-size: 1.5rem; flex-shrink: 0; }
.chat-text {
    padding: 0.75rem 1rem; border-radius: var(--radius);
    font-size: 0.9rem; max-width: 80%;
    line-height: 1.6;
}
.chat-input-row {
    display: flex; border-top: 1px solid var(--border);
}
.chat-input {
    flex: 1; padding: 0.75rem 1rem;
    border: none; font-size: 0.9rem; font-family: inherit;
    outline: none;
}
.btn-chat {
    padding: 0.75rem 1.25rem;
    background: var(--primary-blue); color: white;
    border: none; font-weight: 600; cursor: pointer;
    transition: background 0.2s;
}
.btn-chat:hover { background: var(--dark-blue); }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .main-content { max-width: 100%; }
    .two-col { grid-template-columns: 1fr; }
    .info-cards { grid-template-columns: 1fr; }
}

/* ─── Landing Divider (matches Streamlit's st.markdown("---")) ── */
.landing-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 2rem 0 1.5rem;
}
.landing-hint {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    padding: 1rem;
}
.visual-container { text-align: center; }

/* ─── Dark Mode ─────────────────────────────────────────────────────────── */
body.dark-mode { background: #1a1a2e; color: #e0e0e0; }
body.dark-mode .sidebar { background: #16213e; border-color: #333; }
body.dark-mode .sidebar-header h2,
body.dark-mode .pipeline-section h3,
body.dark-mode .tab-title,
body.dark-mode .markdown-body strong,
body.dark-mode .key-points-card h3 { color: #7ec8e3; }
body.dark-mode .form-input,
body.dark-mode .level-option span,
body.dark-mode .toggle-switch { background: #1a1a2e; color: #e0e0e0; border-color: #444; }
body.dark-mode .level-option input:checked + span { background: #0f3460; color: #e0e0e0; border-color: #0f3460; }
body.dark-mode .main-content { background: #1a1a2e; }
body.dark-mode .main-header { background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%); }
body.dark-mode .tab-btn { color: #aaa; }
body.dark-mode .tab-btn.active { color: #7ec8e3; border-bottom-color: #7ec8e3; }
body.dark-mode .tab-btn:hover { background: #16213e; color: #e0e0e0; }
body.dark-mode .tab-content { background: transparent; }
body.dark-mode .markdown-body code,
body.dark-mode .markdown-body pre,
body.dark-mode .prompt-details code { background: #16213e; color: #e0e0e0; }
body.dark-mode .key-points-card,
body.dark-mode .chat-container,
body.dark-mode .option-label,
body.dark-mode .pipeline-step { background: #16213e; border-color: #333; }
body.dark-mode .chat-assistant .chat-text { background: #16213e; }
body.dark-mode .chat-user .chat-text { background: #0f3460; }
body.dark-mode .alert-success { background: #1a3a2e; color: #4caf50; border-color: #2e7d32; }
body.dark-mode .alert-error { background: #3a1a1a; color: #ef5350; border-color: #c62828; }
body.dark-mode .alert-info { background: #16213e; color: #7ec8e3; border-color: #0f3460; }
body.dark-mode .info-card { background: #16213e; }
body.dark-mode .info-card h3 { color: #7ec8e3; }
body.dark-mode .info-card p { color: #aaa; }
body.dark-mode .genai-overview { background: #2a1a2e; }
body.dark-mode .genai-overview summary { color: #ce93d8; }

/* ─── Gamification Sidebar Stats ────────────────────────────────────────── */
.gamification-section h3 { font-size: 0.9rem; font-weight: 700; color: var(--dark-blue); margin-bottom: 0.5rem; }
.stat-row { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.3rem; font-size: 0.85rem; }
.stat-icon { font-size: 1rem; }
.stat-value { font-weight: 700; color: var(--primary-blue); min-width: 24px; }
.stat-label { color: var(--text-muted); }
body.dark-mode .gamification-section h3 { color: #7ec8e3; }
body.dark-mode .stat-value { color: #7ec8e3; }

/* ─── Tab Header Row ────────────────────────────────────────────────────── */
.tab-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.tab-actions { display: flex; gap: 0.5rem; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

/* ─── Points Card ───────────────────────────────────────────────────────── */
.points-card {
    display: flex; align-items: center; gap: 0.75rem;
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    padding: 1rem 1.5rem; border-radius: var(--radius);
    margin-bottom: 1rem; font-size: 1.1rem;
}
.points-icon { font-size: 1.5rem; }
.points-value { font-size: 1.8rem; font-weight: 800; color: #e65100; }
.points-label { color: var(--text-muted); font-size: 0.9rem; }
.score-detail { margin-left: auto; color: var(--text-muted); font-size: 0.9rem; }
body.dark-mode .points-card { background: linear-gradient(135deg, #3a2a1a, #2a1a0a); }

/* ─── Flashcards ─────────────────────────────────────────────────────────── */
.flashcards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.flashcard {
    perspective: 600px; height: 160px; cursor: pointer;
}
.flashcard-inner {
    position: relative; width: 100%; height: 100%;
    transition: transform 0.5s; transform-style: preserve-3d;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute; inset: 0; border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    backface-visibility: hidden; padding: 1rem; text-align: center;
}
.flashcard-front {
    background: linear-gradient(135deg, var(--primary-blue), var(--teal));
    color: white;
}
.flashcard-front .flashcard-number {
    font-size: 2rem; font-weight: 800; opacity: 0.3;
}
.flashcard-front p { font-size: 1rem; font-weight: 600; margin-top: 0.5rem; }
.flashcard-back {
    background: white; border: 2px solid var(--primary-blue);
    color: var(--text); transform: rotateY(180deg);
}
.flashcard-back p { font-size: 0.9rem; line-height: 1.5; }
body.dark-mode .flashcard-back { background: #16213e; border-color: #7ec8e3; color: #e0e0e0; }

/* ─── Summary Card ──────────────────────────────────────────────────────── */
.summary-card {
    background: #e8f5e9; border-left: 4px solid var(--teal);
    padding: 1.25rem; border-radius: var(--radius);
}
body.dark-mode .summary-card { background: #1a3a2e; border-left-color: #4caf50; }

/* ─── Related Topics ────────────────────────────────────────────────────── */
.related-topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; }
.related-topic-card {
    display: flex; align-items: center; gap: 0.5rem;
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.75rem 1rem;
    transition: all 0.2s;
}
.related-topic-card:hover { border-color: var(--primary-blue); background: #e3f2fd; }
.related-topic-icon { font-size: 1.2rem; }
.related-topic-btn {
    background: none; border: none; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; color: var(--primary-blue);
    text-align: left; padding: 0; font-family: inherit;
}
.related-topic-btn:hover { text-decoration: underline; }
body.dark-mode .related-topic-card { background: #16213e; border-color: #333; }
body.dark-mode .related-topic-card:hover { background: #0f3460; }
body.dark-mode .related-topic-btn { color: #7ec8e3; }

/* ─── Bookmarks ──────────────────────────────────────────────────────────── */
.bookmarks-list { display: flex; flex-direction: column; gap: 0.5rem; }
.bookmark-item {
    display: flex; align-items: center; justify-content: space-between;
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.65rem 1rem;
}
.bookmark-text { font-size: 0.9rem; flex: 1; }
.btn-remove-bookmark {
    background: none; border: none; color: #c62828; cursor: pointer;
    font-size: 1rem; padding: 0.2rem 0.5rem; border-radius: 4px;
}
.btn-remove-bookmark:hover { background: #ffebee; }
body.dark-mode .bookmark-item { background: #16213e; border-color: #333; }
body.dark-mode .btn-remove-bookmark { color: #ef5350; }
body.dark-mode .btn-remove-bookmark:hover { background: #3a1a1a; }

/* ─── Dashboard Grid ─────────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.dash-card {
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.dash-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.dash-value { font-size: 2rem; font-weight: 800; color: var(--primary-blue); display: block; }
.dash-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; }
body.dark-mode .dash-card { background: #16213e; border-color: #333; }
body.dark-mode .dash-value { color: #7ec8e3; }

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badges-section { margin-bottom: 1.5rem; }
.badges-section h3 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--dark-blue); }
.badges-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.badge-card {
    display: flex; align-items: center; gap: 0.5rem;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 1px solid #ffd54f; border-radius: 20px;
    padding: 0.4rem 0.9rem; font-size: 0.85rem;
}
.badge-emoji { font-size: 1.1rem; }
.badge-name { font-weight: 600; color: #e65100; }
body.dark-mode .badge-card { background: linear-gradient(135deg, #3a2a0a, #2a1a00); border-color: #6d4c00; }
body.dark-mode .badge-name { color: #ffb74d; }
body.dark-mode .badges-section h3 { color: #7ec8e3; }

/* ─── Session List ───────────────────────────────────────────────────────── */
.session-list { display: flex; flex-direction: column; gap: 0.5rem; }
.session-item { margin-bottom: 0; }
.session-item-btn {
    display: flex; align-items: center; gap: 0.75rem;
    background: white; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 0.65rem 1rem;
    cursor: pointer; width: 100%; text-align: left; font-family: inherit;
    transition: all 0.2s;
}
.session-item-btn:hover { border-color: var(--primary-blue); background: #e3f2fd; }
.session-topic { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.session-meta { font-size: 0.8rem; color: var(--text-muted); }
.session-points { margin-left: auto; font-size: 0.85rem; color: #e65100; font-weight: 600; }
body.dark-mode .session-item-btn { background: #16213e; border-color: #333; color: #e0e0e0; }
body.dark-mode .session-item-btn:hover { background: #0f3460; }
body.dark-mode .session-topic { color: #e0e0e0; }
body.dark-mode .session-points { color: #ffb74d; }

/* ─── Dashboard Section (landing) ───────────────────────────────────────── */
.dashboard-section { margin-bottom: 1.5rem; }
.recent-sessions-section { margin-top: 1.5rem; }
.recent-sessions-section h3 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--dark-blue); }
body.dark-mode .recent-sessions-section h3 { color: #7ec8e3; }

/* ─── Responsive additions ──────────────────────────────────────────────── */
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .flashcards-grid { grid-template-columns: 1fr; }
    .related-topics-grid { grid-template-columns: 1fr; }
}
