/* ─── Study Module Bar ─────────────────────────────────────────────────────── */

.study-module-bar {
    display: none;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 200;
    background: var(--bg-sidebar, #1a1a24);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 5px 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.study-module-bar.visible {
    display: flex;
}

/* ─── Shared Button Style ──────────────────────────────────────────────────── */
.smod-title-btn,
.smod-settings-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 7px 12px;
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.smod-title-btn:hover,
.smod-settings-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
}

.smod-selector.active .smod-title-btn,
.smod-settings-wrap.active .smod-settings-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.smod-chevron {
    width: 13px;
    height: 13px;
    color: var(--text-secondary);
    transition: transform 0.2s;
    flex-shrink: 0;
    stroke: currentColor;
}

.smod-selector.active .smod-chevron,
.smod-settings-wrap.active .smod-chevron {
    transform: rotate(180deg);
}

/* ─── Wrappers (positioning anchors) ──────────────────────────────────────── */
.smod-selector,
.smod-settings-wrap {
    position: relative;
}

/* ─── Dropdown Panels ──────────────────────────────────────────────────────── */
.smod-dropdown,
.smod-settings-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: rgba(20, 23, 30, 0.97);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4);
    padding: 6px;
    display: none;
    z-index: 200;
    min-width: 200px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.smod-selector.active .smod-dropdown,
.smod-settings-wrap.active .smod-settings-panel {
    display: block;
}

.smod-settings-panel {
    left: auto;
    right: 0;
    min-width: 248px;
}

/* ─── Module Options ───────────────────────────────────────────────────────── */
.smod-opt {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    text-align: left;
    transition: background 0.15s;
    font-family: inherit;
}

.smod-opt:hover {
    background: rgba(255, 255, 255, 0.06);
}

.smod-opt.active {
    background: rgba(255, 255, 255, 0.1);
}

.smod-opt.active .smod-opt-dot {
    display: block;
}

.smod-opt-dot {
    display: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-primary);
    margin-left: auto;
    flex-shrink: 0;
}

.smod-opt-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.smod-opt-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

/* ─── Settings Sections ────────────────────────────────────────────────────── */
.smod-section {
    padding: 10px 8px 8px;
}

.smod-section + .smod-section {
    border-top: 1px solid var(--border-color);
    margin-top: 2px;
}

.smod-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

/* ─── Radio Group ──────────────────────────────────────────────────────────── */
.smod-radio-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.smod-radio {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.smod-radio:hover {
    background: rgba(255, 255, 255, 0.05);
}

.smod-radio.checked {
    background: rgba(255, 255, 255, 0.08);
}

.smod-radio input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: #ececec;
    cursor: pointer;
    flex-shrink: 0;
}

.smod-radio-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.smod-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: auto;
    padding-left: 6px;
    white-space: nowrap;
}

/* ─── Count Group (Quiz) ───────────────────────────────────────────────────── */
.smod-count-group {
    display: flex;
    gap: 6px;
}

.smod-count-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.smod-count-btn:hover {
    background: rgba(255, 255, 255, 0.07);
}

.smod-count-btn.active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ─── Checkbox Group (Quiz modes) ──────────────────────────────────────────── */
.smod-check-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.smod-check {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    user-select: none;
}

.smod-check:hover {
    background: rgba(255, 255, 255, 0.05);
}

.smod-check.checked {
    background: rgba(255, 255, 255, 0.08);
}

.smod-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #ececec;
    cursor: pointer;
    flex-shrink: 0;
}

.smod-check-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ─── Flat group (no sections, just items + divider) ──────────────────────── */
.smod-flat-group {
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.smod-flat-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 8px;
}

/* ─── Hallo Placeholder ────────────────────────────────────────────────────── */
.smod-hallo {
    padding: 12px 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ─── Placeholder Views (hallo modules) ────────────────────────────────────── */
.study-placeholder-view {
    display: none;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 49px);
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ─── Light mode overrides ─────────────────────────────────────────────────── */
body.light-mode .smod-dropdown,
body.light-mode .smod-settings-panel {
    background: rgba(255, 255, 255, 0.97);
}

body.light-mode .smod-title-btn,
body.light-mode .smod-settings-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-color);
}

body.light-mode .smod-title-btn:hover,
body.light-mode .smod-settings-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light-mode .smod-radio input[type="radio"],
body.light-mode .smod-check input[type="checkbox"] {
    accent-color: #171717;
}

/* ═══════════════════════════════════════════════════════════════
   WHITEBOARD VIDEO GENERATOR
   ═══════════════════════════════════════════════════════════════ */

/* Card accent */
.learning-card--video {
    border: 1px solid rgba(99, 179, 237, 0.25);
    background: linear-gradient(135deg,
        rgba(99, 179, 237, 0.07) 0%,
        rgba(255,255,255,0.03) 100%);
}
.learning-card--video:hover {
    border-color: rgba(99, 179, 237, 0.45);
    background: linear-gradient(135deg,
        rgba(99, 179, 237, 0.13) 0%,
        rgba(255,255,255,0.05) 100%);
}
.learning-card-icon {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    color: #63b3ed;
}

/* Shell */
#whiteboardVideoView {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px 40px 16px;
    box-sizing: border-box;
}
#wbvEditor.interrog-view {
    padding: 0;
    min-height: unset;
}
.wbv-shell {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.wbv-header { display: flex; flex-direction: column; gap: 6px; }
.wbv-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Form */
.wbv-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wbv-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    resize: none;
    outline: none;
    transition: border-color 0.18s;
    line-height: 1.5;
}
.wbv-textarea:focus {
    border-color: rgba(99,179,237,0.5);
}
.wbv-textarea::placeholder { color: var(--text-secondary); opacity: 0.7; }

.wbv-options-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.wbv-option-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wbv-option-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wbv-pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.wbv-pill {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.wbv-pill:hover { border-color: rgba(99,179,237,0.35); color: var(--text-primary); }
.wbv-pill.active {
    background: rgba(99,179,237,0.18);
    border-color: rgba(99,179,237,0.55);
    color: #90cdf4;
    font-weight: 600;
}

.wbv-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3a7bd5, #2c5faa);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.18s, transform 0.12s;
}
.wbv-generate-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.wbv-generate-btn:active { transform: translateY(0); }
.wbv-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Progress */
.wbv-progress-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wbv-progress-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}
.wbv-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wbv-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.wbv-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    flex-shrink: 0;
    transition: background 0.3s, box-shadow 0.3s, transform 0.2s;
}
.wbv-step-dot.active {
    background: #a78bfa;
    box-shadow: 0 0 0 4px rgba(167,139,250,0.25), 0 0 12px rgba(124,58,237,0.5);
    transform: scale(1.2);
}
.wbv-step-dot.pulse {
    background: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124,58,237,0.3), 0 0 16px rgba(124,58,237,0.6);
    animation: wbv-pulse 1.2s ease-in-out infinite;
    transform: scale(1.2);
}
.wbv-step-dot.done { background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,0.4); }
.wbv-step-dot.error { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,0.4); }

/* Legacy class support */
.wbv-step--active .wbv-step-dot {
    background: #a78bfa;
    box-shadow: 0 0 0 4px rgba(167,139,250,0.25);
}
.wbv-step--active .wbv-step-label { color: var(--text-primary); font-weight: 600; }
.wbv-step--done .wbv-step-dot { background: #34d399; }
.wbv-step--done .wbv-step-label { color: #34d399; }
.wbv-step--error .wbv-step-dot { background: #f87171; }
.wbv-step--error .wbv-step-label { color: #f87171; }

@keyframes wbv-pulse {
    0%, 100% { transform: scale(1.2); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
}

.wbv-progress-bar-track {
    height: 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}
.wbv-progress-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #3a7bd5, #63b3ed);
    width: 0%;
    transition: width 0.4s ease;
}

/* Result */
.wbv-result-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wbv-player {
    width: 100%;
    border-radius: 12px;
    background: #000;
    max-height: 400px;
}
.wbv-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.wbv-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(99,179,237,0.18);
    border: 1px solid rgba(99,179,237,0.4);
    color: #90cdf4;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.wbv-download-btn:hover { background: rgba(99,179,237,0.28); }
.wbv-new-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}
.wbv-new-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-primary); }

/* Error */
.wbv-error-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.wbv-error-msg {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(252,129,129,0.3);
    background: rgba(252,129,129,0.08);
    color: #fc8181;
    font-size: 14px;
    line-height: 1.5;
}

/* Light mode */
body.light-mode .wbv-textarea {
    background: #f0f4fa;
    border-color: rgba(0,0,0,0.12);
    color: #1a2230;
}
body.light-mode .wbv-pill {
    background: #e8edf5;
    border-color: rgba(0,0,0,0.12);
    color: #5d687c;
}
body.light-mode .wbv-pill.active {
    background: rgba(58,123,213,0.15);
    border-color: rgba(58,123,213,0.5);
    color: #2c5faa;
}
body.light-mode .learning-card--video {
    border-color: rgba(58,123,213,0.25);
    background: linear-gradient(135deg, rgba(58,123,213,0.07) 0%, #e8edf5 100%);
}
body.light-mode .learning-card-icon { color: #3a7bd5; }

@media (max-width: 600px) {
    #whiteboardVideoView { padding: 20px 14px 40px; }
    .wbv-options-row { flex-direction: column; gap: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   INTERROGATION (AI ORAL EXAM) REDESIGN
   ═══════════════════════════════════════════════════════════════ */

.interrog-view {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: unset;
    padding: 20px 24px 16px;
    box-sizing: border-box;
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.05), transparent),
                radial-gradient(circle at bottom left, rgba(124, 58, 237, 0.03), transparent);
}

.interrog-shell {
    width: 100%;
    max-width: 800px;
}

.interrog-panel {
    display: none;
    animation: fadeInSlide 0.4s ease-out;
}

.interrog-panel.active {
    display: block;
}

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

/* Header */
.interrog-header {
    text-align: center;
    margin-bottom: 16px;
}

.interrog-icon-main {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a78bfa;
}

.interrog-icon-main svg { width: 24px; height: 24px; }

.interrog-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.interrog-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* Setup Card */
.interrog-setup-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px 24px;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.interrog-drop-zone {
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.01);
}

.interrog-drop-zone:hover {
    border-color: rgba(124, 58, 237, 0.4);
    background: rgba(124, 58, 237, 0.03);
}

.dz-icon { width: 32px; height: 32px; margin-bottom: 12px; color: var(--text-secondary); }
.dz-text { font-size: 14px; color: var(--text-secondary); }

.interrog-divider {
    text-align: center;
    position: relative;
    height: 14px;
}
.interrog-divider::before {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}
.interrog-divider span {
    position: relative;
    background: #12121e; /* Approximate base bg */
    padding: 0 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.1em;
}

.interrog-lib-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.interrog-lib-btn:hover { background: rgba(255, 255, 255, 0.08); }

.interrog-textarea {
    width: 100%; min-height: 80px; max-height: 140px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 12px 14px;
    color: #fff;
    font-family: inherit; font-size: 15px;
    resize: vertical; outline: none;
    transition: border-color 0.2s;
}
.interrog-textarea:focus { border-color: rgba(124, 58, 237, 0.5); }

.interrog-start-btn {
    width: 100%;
    padding: 13px;
    background: var(--accent-color);
    color: var(--accent-text);
    border: none; border-radius: 14px;
    font-size: 16px; font-weight: 700;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: transform 0.1s, opacity 0.2s;
}
.interrog-start-btn:hover { opacity: 0.9; }
.interrog-start-btn:active { transform: scale(0.98); }

/* Session Layout */
.interrog-session-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px;
}
.interrog-count { font-size: 12px; font-weight: 700; color: #a78bfa; text-transform: uppercase; }
.interrog-status-pill {
    padding: 6px 12px; border-radius: 20px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    font-size: 11px; color: #a78bfa;
}

.interrog-main-hub {
    text-align: center;
    margin-bottom: 40px;
}

.interrog-voice-visualizer {
    position: relative;
    width: 120px; height: 120px;
    margin: 0 auto 30px;
    display: flex; align-items: center; justify-content: center;
}

.interrog-mic-btn {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: #7c3aed;
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.2s;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}

.interrog-mic-btn.recording {
    background: #ef4444;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.4);
}

.pulse-ring {
    position: absolute;
    width: 100%; height: 100%;
    border-radius: 50%;
    background: #7c3aed;
    opacity: 0;
    z-index: 1;
}

.interrog-mic-btn.recording ~ .pulse-ring {
    animation: voicePulse 2s infinite;
}
.interrog-mic-btn.recording ~ .pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

@keyframes voicePulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(2.2); opacity: 0; }
}

.interrog-question-text {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    max-width: 600px;
    margin: 0 auto;
}

.interrog-transcript-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    height: 250px;
    overflow-y: auto;
    padding: 20px;
    margin-bottom: 24px;
}

.interrog-transcript { display: flex; flex-direction: column; gap: 12px; }

.interrog-turn-examiner, .interrog-turn-student {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    max-width: 85%;
}

.interrog-turn-examiner {
    background: rgba(124, 58, 237, 0.1);
    color: #a78bfa;
    align-self: flex-start;
}
.interrog-turn-student {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    align-self: flex-end;
}

.interrog-finish-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.interrog-finish-btn:hover { background: rgba(255, 255, 255, 0.05); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }

/* Feedback */
.interrog-feedback-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px;
}
.feedback-header { margin-bottom: 24px; }
.feedback-title { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.feedback-subtitle { font-size: 14px; color: var(--text-secondary); }

.feedback-markdown {
    line-height: 1.6;
    color: var(--text-primary);
    font-size: 15px;
}
.feedback-markdown h1, .feedback-markdown h2 { color: #a78bfa; margin-top: 20px; }
.feedback-markdown ul { padding-left: 20px; }

/* Shroud/Loader */
.interrog-loading-shroud {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
}
.interrog-loader { text-align: center; }
.spinner {
    width: 40px; height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.1);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* ═══════════════════════════════════════════════════════════════
   INTERACTIVE QUIZ MODAL
   ═══════════════════════════════════════════════════════════════ */

.quiz-modal-shroud {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.quiz-modal-card {
    background: rgba(25, 25, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    width: 100%; max-width: 600px;
    display: flex; flex-direction: column;
    box-shadow: 0 30px 70px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.quiz-modal-header {
    padding: 20px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; justify-content: space-between; align-items: center;
}

.quiz-modal-count { font-size: 13px; font-weight: 700; color: #48bb78; text-transform: uppercase; letter-spacing: 0.05em; }
.quiz-modal-title { font-size: 20px; font-weight: 700; margin: 0; color: #fff; }

.quiz-modal-close {
    background: transparent; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 4px; display: flex; align-items: center;
    transition: color 0.2s;
}
.quiz-modal-close:hover { color: #fff; }

.quiz-modal-body {
    padding: 32px 28px;
    flex: 1;
    overflow-y: auto;
    max-height: 70vh;
}

.quiz-modal-question {
    font-size: 20px; font-weight: 600; line-height: 1.4;
    color: #fff; margin-bottom: 30px;
}

.quiz-modal-choices {
    display: flex; flex-direction: column; gap: 12px;
}

.quiz-choice-btn {
    text-align: left; padding: 16px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 15px; font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.quiz-choice-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
}
.quiz-choice-btn.selected {
    background: rgba(72, 187, 120, 0.1);
    border-color: rgba(72, 187, 120, 0.5);
    color: #48bb78;
}
.quiz-choice-btn.wrong {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #f87171;
}

.quiz-modal-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex; justify-content: flex-end;
}

.quiz-modal-btn {
    padding: 12px 24px;
    border-radius: 12px; border: none;
    background: #4a5568; color: #fff;
    font-weight: 700; cursor: pointer;
    transition: opacity 0.2s;
}
.quiz-modal-btn:hover { opacity: 0.9; }

/* Score & Feedback */
.quiz-score-circle {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: rgba(72, 187, 120, 0.1);
    border: 4px solid #48bb78;
    margin: 0 auto 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: #fff;
}

.quiz-ai-rating {
    text-align: center; font-size: 15px; color: var(--text-secondary);
    line-height: 1.6; margin-bottom: 24px;
    padding: 16px; background: rgba(255,255,255,0.03); border-radius: 16px;
}

.quiz-review-list {
    display: flex; flex-direction: column; gap: 12px;
}
.quiz-review-item {
    padding: 14px; border-radius: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
}
.quiz-review-q { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 6px; }
.quiz-review-a { font-size: 13px; color: #a0aec0; margin-bottom: 6px; }
.quiz-review-a.incorrect { color: #f87171; text-decoration: line-through; margin-right: 8px; }
.quiz-review-pts { font-size: 12px; font-weight: 700; color: #a78bfa; margin-top: 6px; }
.quiz-criteria-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }
.quiz-criterion { font-size: 12px; padding: 4px 8px; border-radius: 6px; }
.quiz-criterion.correct  { color: #48bb78; background: rgba(72,187,120,.08); }
.quiz-criterion.partial  { color: #f6ad55; background: rgba(246,173,85,.08); }
.quiz-criterion.incorrect{ color: #f87171; background: rgba(248,113,113,.08); }
.quiz-criterion-pts { opacity: .7; font-size: 11px; }
.quiz-review-skipped { color: rgba(255,255,255,0.35) !important; font-style: italic; }

/* ═══════════════════════════════════════════════════════════════
   NOTE MAKER REDESIGN
   ═══════════════════════════════════════════════════════════════ */

.note-paper {
    background: #fbfbf9; /* Softer off-white to reduce glare */
    color: #1a1a24;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    min-height: 500px;
    position: relative;
    font-family: 'Manrope', sans-serif;
    margin: 20px auto;
    max-width: 800px;
}

body.dark-mode .note-paper {
    background: #14141d; /* Deepened background for better contrast */
    color: #ececec;      /* Brightened text */
    border: 1px solid rgba(255,255,255,0.08);
}

.note-actions {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.note-action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(124, 58, 237, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.note-action-btn:hover {
    background: #7c3aed;
    color: #fff;
}

.note-body-markdown {
    line-height: 1.7;
    font-size: 16px;
    color: var(--text-primary);
}

/* ── High-Contrast Note Headings ── */
.note-body-markdown h1 {
    color: #a78bfa;
    border-bottom: 2px solid rgba(167, 139, 250, 0.25);
    padding-bottom: 10px;
    margin-bottom: 24px;
    font-size: 1.5em;
}
.note-body-markdown h2 {
    color: #c4b5fd;
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 1.25em;
}
.note-body-markdown h3 {
    color: #ddd6fe;
    margin-top: 24px;
    font-size: 1.1em;
}
body:not(.dark-mode) .note-body-markdown h1 { color: #6d28d9; }
body:not(.dark-mode) .note-body-markdown h2 { color: #5b21b6; }
body:not(.dark-mode) .note-body-markdown h3 { color: #7c3aed; }

.note-body-markdown p {
    margin-bottom: 16px;
    color: var(--text-primary);
}
.note-body-markdown ul, .note-body-markdown ol {
    margin-bottom: 20px;
    padding-left: 20px;
}
.note-body-markdown li {
    margin-bottom: 8px;
    color: var(--text-primary);
}
.note-body-markdown strong {
    color: var(--text-primary);
    font-weight: 700;
}
.note-body-markdown blockquote {
    border-left: 4px solid #a78bfa;
    padding-left: 16px;
    margin: 20px 0;
    color: var(--text-secondary);
    font-style: italic;
}

/* ── Micro-Mindmap Bullet Style ── */
.note-body-markdown ul {
    list-style: none;
    padding-left: 8px;
}
.note-body-markdown ul > li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
}
.note-body-markdown ul > li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 14px;
    height: 2px;
    background: rgba(167, 139, 250, 0.45);
    border-radius: 1px;
}
.note-body-markdown ul > li::after {
    content: '›';
    position: absolute;
    left: 12px;
    top: 1px;
    color: #a78bfa;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.7;
}
body:not(.dark-mode) .note-body-markdown ul > li::before {
    background: rgba(109, 40, 217, 0.3);
}
body:not(.dark-mode) .note-body-markdown ul > li::after {
    color: #7c3aed;
}

/* ─── Layout Fixes for Scrolling ─── */

.study-module-shell {
    height: 100% !important;
    overflow-y: auto !important;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.mindmap-header {
    width: 100%;
    margin-bottom: 8px;
    position: relative !important;
    z-index: 10;
}

#quizView, #noteView, #interrogationView, #whiteboardVideoView {
    padding: 20px 40px 16px;
    box-sizing: border-box;
}

/* Centering the interactive results */
.mindmap-result-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}
