/* style.css – dark mode, notebook aesthetic, responsive */

/* ===== VARIABILE ===== */
:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1a1a;
    --bg-sidebar: #1a1a1a;
    --bg-header: #0f0f0fee;
    --accent: #a78bfa;
    --accent-dark: #7c5cc4;
    --success: #1b5e20;
    --success-border: #2e7d32;
    --error: #b71c1c;
    --error-border: #c62828;
    --text-primary: #e8e8e8;
    --text-secondary: #bbbbbb;
    --border-light: #2e2e2e;
    --border-dark: #444;
    --shadow: 0 4px 0 #111;
    --shadow-hover: 0 6px 0 #111;
    --transition: 0.2s;
    --radius-btn: 40px;
    --radius-card: 40px 20px 20px 20px;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* ── subject accent colors ── */
    --arch-color:  #60a5fa;
    --prog-color:  #4ade80;
    --ment-color:  #fb923c;
    --img-color:   #f472b6;
    --asdn-color:  #2dd4bf;
    --fav-color:   #facc15;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Atkinson Hyperlegible', 'Segoe UI', Roboto, system-ui, sans-serif;
    background: var(--bg-dark);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    padding: 0 0 2rem 0;
}

/* ===== HEADER ===== */
.header {
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 2px solid #222;
    box-shadow: 0 6px 0 #1a1a1a, 0 8px 20px rgba(0,0,0,0.5);
    padding: 0.8rem 0;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.logo-text {
    font-family: 'Space Mono', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}
.logo-text span { color: var(--arch-color); }

.header-subtitle {
    font-size: 0.75rem;
    color: #888;
    background: #1e1e1e;
    padding: 0.2rem 1rem;
    border-radius: var(--radius-btn);
    border: 1px solid #333;
    font-family: 'Space Mono', monospace;
    display: inline-block;
}

/* ===== DASHBOARD ===== */
.dashboard-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.dashboard-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 4px 4px 0 #3a3a3a;
    margin-bottom: 0.25rem;
    letter-spacing: -1px;
}

.dashboard-subtitle {
    font-size: 1rem;
    color: #dddddd;
    background: #2a2a2a;
    display: inline-block;
    padding: 0.3rem 1.5rem;
    border-radius: 60px;
    border: 2px solid var(--border-light);
    box-shadow: inset 0 -2px 0 #3a3a3a;
}

/* ===== TABS ===== */
.tabs-scroll {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 1rem 0.2rem 1.5rem 0.2rem;
    margin-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: #888 #2d2d2d;
}

.tabs-scroll::-webkit-scrollbar {
    height: 6px;
}
.tabs-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 20px;
    border: 2px solid #2d2d2d;
}

.mode-btn {
    background: #2d2d2d;
    border: 2px solid var(--border-light);
    color: #dddddd;
    padding: 0.6rem 1.4rem;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 0 #222, 0 6px 10px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    min-height: 44px; /* touch target */
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover), 0 10px 14px rgba(0, 0, 0, 0.4);
    background: #3d3d3d;
    color: #ffffff;
}

.mode-btn.active-tab {
    background: var(--tab-active-bg, var(--accent));
    border-color: var(--tab-active-border, var(--accent-dark));
    color: #000000;
    box-shadow: 0 4px 0 var(--tab-active-shadow, #6a4e9c);
}

/* ── per-subject tab active colors ── */
.mode-btn[data-subject="arch"].active-tab { --tab-active-bg: var(--arch-color); --tab-active-border: #2a70d0; --tab-active-shadow: #1a50aa; }
.mode-btn[data-subject="prog"].active-tab { --tab-active-bg: var(--prog-color); --tab-active-border: #22a050; --tab-active-shadow: #156030; }
.mode-btn[data-subject="ment"].active-tab { --tab-active-bg: var(--ment-color); --tab-active-border: #d07020; --tab-active-shadow: #a05010; }
.mode-btn[data-subject="img"].active-tab  { --tab-active-bg: var(--img-color);  --tab-active-border: #d04090; --tab-active-shadow: #a02070; }
.mode-btn[data-subject="asdn"].active-tab { --tab-active-bg: var(--asdn-color); --tab-active-border: #1aa099; --tab-active-shadow: #0a7070; }
.mode-btn[data-subject="fav"].active-tab  { --tab-active-bg: var(--fav-color);  --tab-active-border: #d0a800; --tab-active-shadow: #a08000; }

/* ===== CARDS ===== */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

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

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

@media (min-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.eval-card {
    background: var(--bg-card);
    border: 2px solid #444;
    border-radius: var(--radius-card);
    padding: 1.5rem;
    box-shadow: 8px 8px 0 #1a1a1a, 0 12px 24px -8px rgba(0, 0, 0, 0.7);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    min-height: 250px;
    overflow: hidden;
    animation: cardFadeUp 0.35s ease both;
}

.eval-card:nth-child(1) { animation-delay: 0.04s; }
.eval-card:nth-child(2) { animation-delay: 0.09s; }
.eval-card:nth-child(3) { animation-delay: 0.14s; }
.eval-card:nth-child(4) { animation-delay: 0.19s; }

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

/* top accent strip */
.eval-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: var(--card-accent, #444);
    border-radius: 40px 20px 0 0;
    transition: height 0.15s ease;
}
.eval-card:hover::before { height: 5px; }

/* per-subject card accents */
.eval-card[data-subject="arch"] { --card-accent: var(--arch-color); }
.eval-card[data-subject="prog"] { --card-accent: var(--prog-color); }
.eval-card[data-subject="ment"] { --card-accent: var(--ment-color); }
.eval-card[data-subject="img"]  { --card-accent: var(--img-color);  }
.eval-card[data-subject="asdn"] { --card-accent: var(--asdn-color); }

.eval-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 12px 12px 0 #111,
                0 0 0 1px var(--card-accent, #444),
                0 0 24px -4px var(--card-accent, #333);
    border-color: var(--card-accent, #555);
}

.eval-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.eval-icon {
    font-size: 3rem;
    line-height: 1;
}

.eval-badge {
    background: #3d3d3d;
    color: #dddddd;
    font-weight: 600;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-btn);
    border: 1px solid var(--border-dark);
    font-size: 0.75rem;
    margin-top: 20px;
}

.eval-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.eval-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
    flex: 1;
}

.eval-footer {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.eval-tag {
    background: #3d3d3d;
    color: #dddddd;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border-dark);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
    padding: var(--spacing-md);
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: #000000b0;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #2d2d2d;
    border: 3px solid #666;
    border-radius: 60px 30px 30px 30px;
    padding: 2rem;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 15px 15px 0 #222, 0 30px 40px black;
    color: var(--text-primary);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #3d3d3d;
    border: 2px solid var(--border-dark);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #ffffff;
    transition: var(--transition);
}

.modal-close:hover {
    background: #555;
    transform: rotate(90deg);
}

.modal-icon {
    font-size: 3.5rem;
    text-align: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: #ffffff;
    text-align: center;
    margin-top: 0.5rem;
}

.mode-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (min-width: 600px) {
    .mode-options {
        grid-template-columns: 1fr 1fr;
    }
}

.mode-card {
    background: #3a3a3a;
    border: 3px solid #666;
    border-radius: 40px 20px 20px 20px;
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 7px 7px 0 #222;
    color: #eee;
}

.mode-card:hover {
    transform: translate(-3px, -3px);
    box-shadow: 10px 10px 0 #1a1a1a;
}

.mode-card-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
}

.mode-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
}

.mode-features {
    list-style: none;
    margin: 1rem 0;
}

.mode-features li {
    font-size: 0.9rem;
    padding: 0.2rem 0;
    color: #cccccc;
}

.mode-btn.special {
    display: inline-block;
    background: var(--accent);
    padding: 0.6rem 2rem;
    border-radius: var(--radius-btn);
    font-weight: 700;
    border: 2px solid var(--accent-dark);
    color: #000000;
    min-height: 44px;
}

/* ===== QUIZ SECTION — NEW DESIGN ===== */
.quiz-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md) 3rem;
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .quiz-shell { grid-template-columns: 1fr; }
}

/* top bar */
.quiz-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.back-btn {
    background: #1e1e1e;
    border: 1px solid #333;
    color: #666;
    font-size: 0.8rem;
    padding: 0.5rem 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.15s, border-color 0.15s;
    min-height: 36px;
    font-family: 'Space Mono', monospace;
}
.back-btn:hover { color: var(--text-primary); border-color: #555; }

/* segmented progress track */
.quiz-progress-track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
}
.progress-seg {
    flex: 1;
    height: 4px;
    background: #2a2a2a;
    border-radius: 4px;
    transition: background 0.3s ease;
    min-width: 4px;
}
.progress-seg.seg-done    { background: #22c55e; }
.progress-seg.seg-current { background: var(--accent); }
.progress-seg.seg-wrong   { background: #ef4444; }

/* hide old info box - q number is now in card */
#quiz-info { display: none; }

/* ── question card ── */
.question-card {
    background: #1a1a1a;
    border: 1px solid #272727;
    border-radius: 36px;
    padding: 2rem 2rem 1.5rem;
    position: relative;
    overflow: hidden;
    animation: qSlideUp 0.28s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes qSlideUp {
    from { opacity:0; transform: translateY(12px); }
    to   { opacity:1; transform: translateY(0); }
}
.question-card::before {
    content:'';
    position:absolute; left:0; top:0; bottom:0; width:3px;
    background: var(--accent);
    border-radius: 4px 0 0 4px;
}

.q-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.4rem;
}
.q-number {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    background: #111;
    border: 1px solid #2a2a2a;
    padding: 0.25rem 0.8rem;
    border-radius: 30px;
    letter-spacing: 0.05em;
}
.q-type-badge {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #555;
    padding: 0.2rem 0.7rem;
    border: 1px solid #252525;
    border-radius: 30px;
}
.q-star {
    margin-left: auto;
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 0.95rem;
    cursor: pointer;
    color: #444;
    display: flex; align-items:center; justify-content:center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.q-star:hover { border-color: #f6e05b; color: #f6e05b; }
.q-star.active { background: #1a1600; border-color: #f6e05b; color: #f6e05b; }

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.65;
    margin-bottom: 1.6rem;
    padding-right: 0;
}

/* ── answer options ── */
.answer-option {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    background: #1e1e1e;
    border: 1.5px solid #2a2a2a;
    border-radius: 18px;
    padding: 0;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, transform 0.1s;
    overflow: hidden;
    min-height: 52px;
    position: relative;
}
.answer-option:hover:not([class*="correct"]):not([class*="incorrect"]) {
    border-color: var(--accent);
    background: #141e2e;
    transform: translateX(3px);
}
.answer-option input {
    margin: 1rem 0 1rem 1.1rem;
    width: 1.1rem; height: 1.1rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--accent);
}
.answer-option label {
    flex: 1;
    padding: 0.9rem 1rem 0.9rem 0;
    cursor: pointer;
    font-size: 0.97rem;
    color: var(--text-primary);
    display: block;
    line-height: 1.45;
}
.answer-option input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.answer-option.correct {
    background: #0a1f0f;
    border-color: #22c55e;
    animation: flashCorrect 0.4s ease;
}
.answer-option.incorrect {
    background: #1f0a0a;
    border-color: #ef4444;
    animation: shake 0.35s ease;
}
@keyframes flashCorrect {
    0%  { transform: scale(1); }
    40% { transform: scale(1.012); }
    100%{ transform: scale(1); }
}
@keyframes shake {
    0%,100%{ transform: translateX(0); }
    20%    { transform: translateX(-5px); }
    60%    { transform: translateX(4px); }
}
.answer-option.correct label { color: #22c55e; }
.answer-option.incorrect label { color: #ef4444; }

/* ── fill input ── */
.fill-input {
    background: #1e1e1e;
    border: 1.5px solid #2a2a2a;
    border-radius: 18px;
    padding: 0.9rem 1.3rem;
    font-size: 1rem;
    width: 100%;
    margin: 0.5rem 0;
    color: var(--text-primary);
    min-height: 52px;
    transition: border-color 0.15s;
}
.fill-input:focus { outline: none; border-color: var(--accent); }

/* ── fill dropdown ── */
.fill-dropdown-select {
    display: inline-block;
    width: auto;
    min-width: 120px;
    background: #1e1e1e;
    border: 1.5px solid #3a3a3a;
    border-radius: 14px;
    padding: 0.4rem 1.8rem 0.4rem 0.9rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 0 4px;
    vertical-align: middle;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><polyline points="6 9 12 15 18 9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1rem;
    min-height: 40px;
}
.fill-dropdown-select:focus { outline: 2px solid var(--accent); }

.question-text-inline {
    line-height: 2.8;
    margin: 1rem 0;
    font-size: 1rem;
    color: var(--text-primary);
}

/* ── match rows ── */
.match-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    background: #1e1e1e;
    border-radius: 16px;
    padding: 0.9rem 1.1rem;
    margin: 0.5rem 0;
    border: 1.5px solid #2a2a2a;
    color: var(--text-primary);
}
@media (min-width: 600px) {
    .match-row { flex-direction: row; align-items: center; gap: 1rem; }
}
.match-row select {
    width: 100%;
    background: #141414;
    border: 1.5px solid #333;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    min-height: 40px;
    cursor: pointer;
}
.match-row.correct { background: #0a1f0f; border-color: #22c55e; }
.match-row.incorrect { background: #1f0a0a; border-color: #ef4444; }

/* ── ordering ── */
.ordering-container { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0; }
.ordering-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #1e1e1e;
    border: 1.5px solid #2a2a2a;
    border-radius: 14px;
    padding: 0.8rem 1rem;
    color: var(--text-primary);
    cursor: grab;
    transition: background 0.15s;
    min-height: 52px;
}
.ordering-item:active { cursor: grabbing; background: #282828; }
.ordering-controls { display: flex; gap: 0.5rem; }
.ordering-btn {
    background: #141414;
    border: 1.5px solid #333;
    border-radius: 50%;
    width: 36px; height: 36px;
    cursor: pointer;
    color: #aaa;
    font-size: 1rem;
    display: flex; align-items:center; justify-content:center;
    transition: all 0.12s;
}
.ordering-btn:hover { background: var(--accent); color: #000; border-color: var(--accent); }
.ordering-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.drop-indicator { height: 3px; background: var(--accent); border-radius: 2px; margin: 2px 0; }

/* ── feedback banner ── */
.feedback-banner {
    border-radius: 16px;
    padding: 1rem 1.3rem;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-top: 0.8rem;
    animation: feedIn 0.22s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes feedIn {
    from { opacity:0; transform: translateY(6px); }
    to   { opacity:1; transform: translateY(0); }
}
.feedback-banner.correct {
    background: #0a1f0f;
    border: 1px solid #15422a;
}
.feedback-banner.incorrect {
    background: #1f0a0a;
    border: 1px solid #3a1212;
}
.fb-icon { font-size: 1.1rem; flex-shrink:0; margin-top:2px; }
.fb-title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.15rem; }
.feedback-banner.correct .fb-title { color: #22c55e; }
.feedback-banner.incorrect .fb-title { color: #ef4444; }
.fb-text { font-size: 0.82rem; color: #666; line-height: 1.5; }

/* ── explanation box ── */
.explanation-box {
    background: #141414;
    border-left: 3px solid var(--accent);
    border-radius: 0 14px 14px 0;
    padding: 1rem 1.2rem;
    margin-top: 0.8rem;
    color: #888;
    font-size: 0.88rem;
    line-height: 1.6;
    animation: feedIn 0.25s ease both;
}
.explanation-box strong { color: var(--accent); }

/* ── image container ── */
.img-container {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 20px;
    margin: 1rem 0 1.4rem;
    text-align: center;
    border: 1px solid #2a2a2a;
}
.img-container img { max-width: 100%; height: auto; border-radius: 14px; }

/* ── nav buttons ── */
.quiz-nav {
    display: flex;
    gap: 0.7rem;
    margin-top: 1rem;
}
.nav-btn {
    padding: 0.85rem 1.4rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex; align-items:center; justify-content:center; gap:0.4rem;
    transition: all 0.12s;
    border: none;
    min-height: 48px;
    flex: 1;
}
.nav-prev {
    background: #1e1e1e;
    border: 1.5px solid #333 !important;
    color: #666;
    flex: 0 0 auto;
    padding: 0.85rem 1.4rem;
}
.nav-prev:hover { color: var(--text-primary); border-color: #555 !important; }
.nav-prev:disabled { opacity: 0.3; pointer-events: none; }

.nav-next {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 4px 0 #1d4ed8;
}
.nav-next:hover { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 6px 0 #1d4ed8; }
.nav-next:active { transform: translateY(1px); box-shadow: 0 2px 0 #1d4ed8; }
.nav-next:disabled { opacity: 0.4; pointer-events: none; box-shadow: none; transform: none; }

.nav-reveal {
    background: #1e1e1e;
    border: 1.5px solid #333 !important;
    color: #555;
    flex: 0 0 auto;
    font-size: 0.82rem;
    padding: 0.85rem 1.1rem;
}
.nav-reveal:hover { border-color: var(--accent) !important; color: var(--accent); }

/* ── favorite star (inside question card) ── */
.favorite-star {
    margin-left: auto;
    background: none;
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    width: 32px; height: 32px;
    font-size: 0.95rem;
    cursor: pointer;
    color: #444;
    display: flex; align-items:center; justify-content:center;
    transition: all 0.15s;
    flex-shrink: 0;
    z-index: 10;
    box-shadow: none;
}
.favorite-star:hover { border-color: #f6e05b; color: #f6e05b; }
.favorite-star.active { background: #1a1600; border-color: #f6e05b; color: #f6e05b; }

/* ── sidebar ── */
.quiz-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.sidebar-card {
    background: #141414;
    border: 1px solid #272727;
    border-radius: 28px;
    padding: 1.3rem;
    position: sticky;
    top: 80px;
    color: var(--text-primary);
}
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.sidebar-header h3 {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 400;
}
.sidebar-stat {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
}

/* ── nav grid dots ── */
.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 1.1rem;
}
.question-nav-btn {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1.5px solid #252525;
    background: #1e1e1e;
    font-family: 'Space Mono', monospace;
    font-size: 0.62rem;
    color: #444;
    cursor: pointer;
    display: flex; align-items:center; justify-content:center;
    transition: all 0.1s;
    min-height: 34px;
    padding: 0;
}
.question-nav-btn:hover { border-color: var(--accent); color: var(--text-primary); }
.question-nav-btn.answered { background: #14532d; border-color: #22c55e; color: #4ade80; }
.question-nav-btn.incorrect{ background: #7f1d1d; border-color: #ef4444; color: #fca5a5; }
/* current always wins — must come AFTER answered/incorrect */
.question-nav-btn.current  { background: var(--accent) !important; border-color: var(--accent) !important; color: #000 !important; font-weight:700; }

/* ── submit button ── */
.submit-btn {
    width: 100%;
    padding: 0.9rem;
    border-radius: 50px;
    border: none;
    background: #03dac6;
    color: #000;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 5px 0 #018786;
    transition: all 0.12s;
    min-height: 52px;
    display: flex; align-items:center; justify-content:center; gap:0.5rem;
}
.submit-btn:hover { filter:brightness(1.08); transform: translateY(-1px); box-shadow: 0 7px 0 #018786; }
.submit-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #018786; }
.submit-btn:disabled { background: #2a2a2a; box-shadow: 0 2px 0 #1a1a1a; color: #555; pointer-events: none; transform: none; }

/* ── results sidebar ── */
.results-sidebar {
    margin-top: 1.2rem;
    border-top: 1px solid #252525;
    padding-top: 1.2rem;
}
.results-header {
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 0.8rem;
}
.results-header h3 { font-size: 0.9rem; color: var(--text-primary); font-weight: 700; }
.results-icon { font-size: 1.2rem; }
.results-score {
    font-family: 'Space Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.3rem;
}
.results-grade { font-size: 0.85rem; color: #777; margin-bottom: 0.5rem; line-height: 1.6; }
.results-feedback { font-size: 1.1rem; }

/* ── sidebar toggle (mobile) ── */
.sidebar-toggle {
    display: block;
    width: 100%;
    background: #1e1e1e;
    border: 1.5px solid #333;
    border-radius: 50px;
    padding: 0.7rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: #888;
    text-align: center;
    font-size: 0.85rem;
}
@media (min-width: 900px) {
    .sidebar-toggle { display: none; }
}
.sidebar-card.collapsed { display: none; }
@media (min-width: 900px) {
    .sidebar-card.collapsed { display: block; }
}

/* ===== UTILITY ===== */
.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== RESPONSIVE FONTS ===== */
@media (max-width: 600px) {
    .dashboard-header h1 {
        font-size: 1.8rem;
    }
    .modal-header h2 {
        font-size: 1.5rem;
    }
    .mode-card h3 {
        font-size: 1.4rem;
    }
}
/* ===== SECTION HEADER (subject-colored dot + label) ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.2rem;
    padding-left: 0.2rem;
}
.section-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--section-color, #555);
    box-shadow: 0 0 8px var(--section-color, #555);
    flex-shrink: 0;
}
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--section-color, #555);
}

/* ===== CARD SCORE PROGRESS BAR ===== */
.card-score {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #333;
}
.card-score-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.68rem;
    color: #555;
    margin-bottom: 0.35rem;
}
.card-score-label span:last-child { color: #888; font-weight: 700; }
.score-track {
    height: 5px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
}
.score-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--card-accent, #555);
    width: 0%;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== FAVORITES EMPTY STATE ===== */
.favorites-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 5rem 2rem;
    border: 2px dashed #333;
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.fav-star-big {
    font-size: 4rem;
    animation: starPulse 2.4s ease-in-out infinite;
}
@keyframes starPulse {
    0%, 100% { transform: scale(1);    opacity: 0.35; }
    50%       { transform: scale(1.2); opacity: 0.9;  }
}
.favorites-empty h3 { font-size: 1.1rem; color: #555; font-weight: 600; }
.favorites-empty p  { font-size: 0.85rem; color: #3a3a3a; max-width: 320px; line-height: 1.6; }

/* ===== STREAK DISPLAY ===== */
.streak-display {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    color: #f6a35b;
    background: rgba(246, 163, 91, 0.08);
    border: 1.5px solid rgba(246, 163, 91, 0.25);
    border-radius: var(--radius-btn);
    padding: 0.25rem 0.9rem;
    margin-left: auto;
    cursor: default;
    user-select: none;
    transition: border-color 0.2s;
}
.streak-display:hover { border-color: rgba(246, 163, 91, 0.5); }

/* ===== QUIZ TIMER ===== */
.quiz-timer {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: var(--radius-btn);
    padding: 0.35rem 1rem;
    white-space: nowrap;
    transition: color 0.3s, border-color 0.3s;
    flex-shrink: 0;
}
.quiz-timer.warning {
    color: #f6a35b;
    border-color: #f6a35b;
}
.quiz-timer.danger {
    color: #cf6679;
    border-color: #cf6679;
    animation: timerPulse 1s ease-in-out infinite;
}
@keyframes timerPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* ===== RESUME BANNER ===== */
.resume-banner {
    background: #1e1e1e;
    border: 2px solid var(--accent);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.resume-banner-text {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.9rem;
    min-width: 200px;
}
.resume-banner-text strong { color: var(--text-primary); }
.resume-banner-btns { display: flex; gap: 0.6rem; flex-shrink: 0; }

/* ===== CARD STATS LINE ===== */
.card-stats-line {
    font-size: 0.72rem;
    color: #666;
    margin-top: 0.35rem;
    font-family: 'Space Mono', monospace;
    letter-spacing: -0.3px;
}

/* ===== RETRY WRONG BUTTON ===== */
.retry-wrong-btn {
    display: block;
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.65rem 1rem;
    background: #cf6679;
    color: #000;
    border: none;
    border-radius: var(--radius-btn);
    font-weight: 700;
    cursor: pointer;
    font-family: 'Syne', sans-serif;
    font-size: 0.85rem;
    box-shadow: 0 4px 0 #8b3a4a;
    transition: transform 0.1s, box-shadow 0.1s;
}
.retry-wrong-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #8b3a4a; }
.retry-wrong-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #8b3a4a; }
.retry-wrong-btn:disabled {
    background: #3a3a3a;
    color: #666;
    box-shadow: none;
    cursor: default;
    transform: none;
}

/* ===== FAVORITE CARDS (redesign) ===== */
.fav-card {
    background: #1e1e1e;
    border: 2px solid #2e2e2e;
    border-radius: 24px;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    transition: border-color 0.2s, transform 0.15s;
}
.fav-card:hover {
    border-color: #444;
    transform: translateY(-2px);
}
.fav-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.fav-subject-tag {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    border: 1.5px solid;
    border-radius: 20px;
    padding: 0.15rem 0.7rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.fav-remove-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.2rem;
    border-radius: 50%;
    transition: transform 0.15s, opacity 0.15s;
    opacity: 0.75;
    flex-shrink: 0;
}
.fav-remove-btn:hover {
    transform: scale(1.25);
    opacity: 1;
}
.fav-card-text {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.5;
    flex: 1;
}
.fav-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.3rem;
}
.fav-type-tag {
    font-size: 0.68rem;
    color: #666;
    font-family: 'Space Mono', monospace;
    background: #252525;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    border: 1px solid #333;
}
.fav-practice-btn {
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 20px;
    padding: 0.3rem 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    cursor: pointer;
    box-shadow: 0 3px 0 #5a3d8a;
    transition: transform 0.1s, box-shadow 0.1s;
}
.fav-practice-btn:hover  { transform: translateY(-1px); box-shadow: 0 4px 0 #5a3d8a; }
.fav-practice-btn:active { transform: translateY(1px);  box-shadow: 0 1px 0 #5a3d8a; }

/* Pending removal state for fav-card */
.fav-card {
    transition: border-color 0.2s, transform 0.15s, opacity 0.25s;
}
