﻿
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css');

:root {
  --font-family: 'Plus Jakarta Sans', sans-serif;
  --bg-color: #f6edff; /* light purple background */
  --card-bg: #ffffff;
  --text-main: #1e1b4b; /* very dark purple/blue */
  --text-muted: #64748b;
  --primary-blue: #1d4ed8;
  --primary-purple: #7c3aed;
  --orange: #f97316;
  --red: #ef4444;
  --green: #16a34a;
  --border-light: #e2e8f0;
     
}



/* ── DEMO STRIP ─────────────────────────────────── */
.demo-strip {
    max-width: 960px;
    margin: 0 auto 32px;
    background: var(--card);
    border-radius: 14px;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

    .demo-strip h2 {
        font-size: 1.1rem;
        font-weight: 800;
        flex: 1;
    }

.tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: none;
    background: #e9d5ff;
    color: #6b21a8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background .2s;
}

    .tool-btn:hover {
        background: #d8b4fe;
    }

    .tool-btn.active {
        background: var(--purple);
        color: white;
    }

/* ── FLOATING WINDOW BASE ───────────────────────── */
.float-win {
    position: fixed;
    z-index: 9999;
    background: var(--card);
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: none;
    flex-direction: column;
    overflow: hidden;
    resize: both;
    opacity: 1;
    transition: opacity .4s;
    user-select: none;
}

    .float-win.visible {
        display: flex;
    }

    .float-win.idle {
        opacity: .85;
    }

    .float-win.minimized .win-body {
        display: none;
    }

    .float-win.minimized {
        resize: none;
    }

/* Title bar */
.win-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #1e1b4b, #3730a3);
    color: white;
    cursor: grab;
    border-radius: 14px 14px 0 0;
}

    .win-header:active {
        cursor: grabbing;
    }

.win-title {
    flex: 1;
    font-weight: 700;
    font-size: .9rem;
}

.win-controls {
    display: flex;
    gap: 6px;
}

.win-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .65rem;
    cursor: pointer;
}

    .win-btn.close {
        background: #ef4444;
    }

    .win-btn.mini {
        background: #f59e0b;
    }

    .win-btn.maximize {
        background: #22c55e;
    }

.resize-hint {
    text-align: center;
    font-size: .65rem;
    color: #cbd5e1;
    padding: 3px;
    user-select: none;
    cursor: se-resize;
}

/* ═══ CALCULATOR ═══════════════════════════════════ */
#calc-win {
    width: 340px;
    top: 80px;
    left: 100px;
}

.calc-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.calc-tab {
    flex: 1;
    padding: 7px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-weight: 700;
    font-size: .8rem;
    color: var(--muted);
    transition: all .2s;
}

    .calc-tab.active {
        background: white;
        color: var(--blue);
        box-shadow: 0 1px 4px rgba(0,0,0,.1);
    }

.calc-screen {
    background: #0f172a;
    padding: 16px;
    border-bottom: 1px solid #334155;
}

.calc-expr {
    color: #94a3b8;
    font-size: .8rem;
    font-weight: 600;
    text-align: right;
    min-height: 18px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calc-result {
    color: #f8fafc;
    font-size: 2rem;
    font-weight: 800;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calc-keys {
    display: grid;
    gap: 6px;
    padding: 10px;
}

    .calc-keys.g4 {
        grid-template-columns: repeat(4,1fr);
    }

    .calc-keys.g5 {
        grid-template-columns: repeat(5,1fr);
    }

.k {
    padding: 14px 6px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: .9rem;
    transition: all .15s;
    background: #f8fafc;
    color: var(--text);
}

    .k:hover {
        filter: brightness(.93);
    }

    .k:active {
        transform: scale(.95);
    }

    .k.op {
        background: #dbeafe;
        color: #1e40af;
    }

    .k.eq {
        background: var(--orange);
        color: white;
    }

    .k.clr {
        background: #fee2e2;
        color: var(--red);
    }

    .k.del {
        background: #fff7ed;
        color: #c2410c;
    }

    .k.sci {
        background: #f3e8ff;
        color: #6b21a8;
        font-size: .75rem;
        padding: 12px 4px;
    }

    .k.zero {
        grid-column: span 2;
    }


/* ═══ NOTEPAD ══════════════════════════════════════ */
#note-win {
    width: 480px;
    top: 100px;
    left: 460px;
}

.note-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
}

.note-tab {
    flex: 1;
    padding: 7px;
    border: none;
    border-radius: 6px;
    background: transparent;
    font-weight: 700;
    font-size: .8rem;
    color: var(--muted);
    transition: all .2s;
}

    .note-tab.active {
        background: white;
        color: var(--blue);
        box-shadow: 0 1px 4px rgba(0,0,0,.1);
    }

.note-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    background: #f8fafc;
}

.note-tool {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: white;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    transition: all .2s;
}

    .note-tool:hover {
        background: #e0e7ff;
        color: var(--blue);
        border-color: #c7d2fe;
    }

    .note-tool.active {
        background: var(--blue);
        color: white;
        border-color: var(--blue);
    }

.sep {
    width: 1px;
    height: 22px;
    background: var(--border);
}

.note-fs {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: .8rem;
    background: white;
    color: var(--text);
    width: 56px;
}

.mode-btns {
    margin-left: auto;
    display: flex;
    gap: 4px;
}

.mode-btn {
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: .75rem;
    font-weight: 700;
    color: var(--muted);
    transition: all .2s;
}

    .mode-btn.active {
        background: var(--purple);
        color: white;
        border-color: var(--purple);
    }

/* Text editor */
.note-editor-wrap {
    position: relative;
}

#noteEditor {
    min-height: 260px;
    padding: 18px;
    font-size: 16px;
    line-height: 1.75;
    outline: none;
    color: var(--text);
    background: white;
    border-radius: 0 0 14px 14px;
}

.save-badge {
    position: absolute;
    bottom: 10px;
    right: 16px;
    font-size: .72rem;
    color: var(--green);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity .4s;
}

    .save-badge.show {
        opacity: 1;
    }

/* Canvas */
.canvas-wrap {
    display: none;
    background: white;
    border-radius: 0 0 14px 14px;
}

    .canvas-wrap.visible {
        display: block;
    }

#noteCanvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}

.canvas-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    flex-wrap: wrap;
}

.cdot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

    .cdot.sel {
        border-color: #1e1b4b;
    }

.brush-r {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    border-radius: 2px;
    background: #cbd5e1;
    cursor: pointer;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body { font-family: var(--font-family); background-color: var(--bg-color); color: var(--text-main); padding: 24px; min-height: 100vh; }
a { text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.page-shell { max-width: 1280px; margin: 0 auto; }

/* HEADER */
.review-header {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.review-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}
.header-brand { display: flex; align-items: center; gap: 16px; }
.brand-logo img { height: 48px; object-fit: contain; }
.brand-info h1 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin-bottom: 2px; }
.question-counter { font-size: 0.85rem; font-weight: 700; color: var(--primary-blue); }

.header-actions { display: flex; align-items: center; gap: 16px; }
.timer-badge {
  display: flex; align-items: center; gap: 8px; background: #dbeafe; border-radius: 8px; padding: 8px 16px; color: var(--primary-blue); font-weight: 700; font-size: 1.1rem;
}
.instructor-toggle { display: flex; align-items: center; gap: 8px; }
.toggle-label { font-size: 0.85rem; font-weight: 700; color: var(--text-main); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #cbd5e1; transition: .3s; border-radius: 24px; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-blue); }
input:checked + .slider:before { transform: translateX(20px); }

.btn-submit { background: var(--orange); color: white; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-exit { background: var(--primary-purple); color: white; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.exam-progress { height: 6px; background: #e2e8f0; width: 100%; }
.exam-progress-bar { height: 100%; background: #a78bfa; width: 20%; /* arbitrary default */ }

/* MAIN GRID */
.exam-main { display: grid; grid-template-columns: 280px 1fr; gap: 24px; margin-top: 24px; align-items: start; }

/* SIDEBAR */
.sidebar-card { background: var(--card-bg); border-radius: 16px; padding: 24px; border: 1px solid var(--border-light); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }
.ql-title { font-size: 1.1rem; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
.ql-subtitle { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 16px; }
.ql-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ql-btn {
  aspect-ratio: 1; border: 1px solid var(--border-light); background: white; border-radius: 6px; font-weight: 700; color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ql-btn.current { background: #eff6ff; border-color: #bfdbfe; color: var(--primary-blue); }
.ql-btn.answered { background: #f0fdf4; border-color: #bbf7d0; color: var(--green); }
.ql-btn.skipped { background: #fef2f2; border-color: #fecaca; color: var(--red); }
.ql-legend { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-main); }
.legend-dot { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--border-light); }
.legend-dot.current { background: #eff6ff; border-color: #bfdbfe; }
.legend-dot.answered { background: #f0fdf4; border-color: #bbf7d0; }
.legend-dot.skipped { background: #fef2f2; border-color: #fecaca; }
.legend-dot.blank { background: white; border-color: var(--border-light); }
.revise-later { margin-top: 24px; font-size: 0.85rem; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.revise-later i { color: #eab308; }

/* QUESTION AREA */
.question-area { display: flex; flex-direction: column; }
.panel-toolbar-outside { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-qnum { font-size: 1rem; font-weight: 800; color: var(--text-main); }
.toolbar-group { display: flex; align-items: center; gap: 12px; }
.toolbox { display: flex; gap: 8px; }
.tool-btn {
  width: 36px; height: 36px; border-radius: 8px; border: none; background: #e9d5ff; color: #6b21a8; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem;
}
.toolbar-divider { color: #cbd5e1; }
.action-btn { padding: 8px 12px; border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer; border: 1px solid transparent; display: flex; align-items: center; gap: 6px; }
.btn-flag { background: white; border-color: #fde047; color: #ca8a04; }
.btn-flag i { color: #facc15; }
.btn-clear { background: #312e81; color: white; }

.question-card { background: var(--card-bg); border-radius: 16px; padding: 32px; border: 1px solid var(--border-light); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); }

/* CONTENT */
.question-text { font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.question-subtext { font-size: 0.9rem; color: var(--primary-blue); font-weight: 600; margin-bottom: 16px; }
.question-meta-badge { display: inline-block; background: #f1f5f9; color: var(--text-muted); font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: 6px; margin-bottom: 24px; }

/* MCQ / Multi Response Options */
.choice-stack { display: flex; flex-direction: column; gap: 12px; }
.choice-item {
  display: flex; align-items: center; padding: 12px 16px; border: 1px solid var(--border-light); background: #fafafa; border-radius: 8px; font-weight: 600; font-size: 0.95rem; cursor: pointer; gap: 12px;
}
.choice-item input { accent-color: var(--primary-blue); transform: scale(1.2); }
.choice-item.selected { background: #ffffff; border-color: #22c55e; }
.correct-badge { margin-left: auto; color: #16a34a; font-weight: 800; font-size: 0.85rem; display: flex; align-items: center; gap: 4px; }

/* Fill in the Blank Layout */
.fib-container { display: flex; flex-direction: column; gap: 24px; }
.fib-row { display: flex; align-items: center; gap: 16px; font-weight: 700; font-size: 1.1rem; color: var(--text-main); }
.fib-input-box {
  flex: 1; border: 1px solid #4ade80; border-radius: 8px; background: #f0fdf4; padding: 16px; display: flex; justify-content: space-between; align-items: center; color: var(--primary-blue); font-weight: 700; font-size: 1rem;
}

/* Matching Layout */
.match-rows { display: flex; flex-direction: column; gap: 16px; }
.match-row { display: flex; gap: 0; align-items: stretch; height: 50px; }
.match-left, .match-right {
  display: flex; align-items: center; padding: 0 16px; font-weight: 600; font-size: 0.95rem; border: 1px solid #4ade80;
}
.match-left {
  flex: 1; background: #f0fdf4; color: var(--primary-blue); border-radius: 8px 0 0 8px; border-right: none; position: relative; gap: 8px;
}
/* creating puzzle piece effect */
.match-left::after {
  content: ''; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; background: #f0fdf4; border-radius: 50%; border: 1px solid #4ade80; border-left: none; z-index: 2; clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}
.match-right {
  flex: 1; background: white; color: var(--orange); border-radius: 0 8px 8px 0; border-left: none; padding-left: 24px; justify-content: space-between;
}
.match-icon-drag { color: var(--text-muted); cursor: grab; }
.match-action { display: flex; align-items: center; gap: 12px; }
.match-x { color: var(--red); font-size: 1.2rem; cursor: pointer; font-weight: bold; }

/* Hotspot Image */
.hotspot-img-container { text-align: center; margin: 24px 0; position: relative; display: inline-block; width: 100%; display: flex; justify-content: center; }
.hotspot-img-container img { max-width: 100%; height: auto; border-radius: 12px; }
.hotspot-point {
  position: absolute; width: 40px; height: 40px; background: rgba(203, 213, 225, 0.6); border: 2px solid white; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.hotspot-point.correct { background: rgba(255, 255, 255, 0.7); border: 2px solid #22c55e; }

/* Accordion */



/* FOOTER */
.panel-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 32px; }
.footer-actions { display: flex; gap: 16px; }
.btn-prev { background: white; border: 1px solid var(--primary-blue); color: var(--primary-blue); padding: 10px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-skip { background: var(--red); border: none; color: white; padding: 10px 24px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.btn-next { background: var(--primary-blue); border: none; color: white; padding: 10px 32px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* Numeric & Short Answer */
.numeric-box {
  border: 1px solid #4ade80;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 1rem;
  margin-top: 16px;
  max-width: 400px;
}
.short-answer-box {
  border: 1px solid #4ade80;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 1rem;
  margin-top: 16px;
  min-height: 200px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

/* Drag and Drop (Categories) */
.category-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.category-col {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #f8fafc;
  padding: 24px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.category-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 24px;
}
.category-items {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.category-item {
  border: 1px solid #4ade80;
  border-radius: 6px;
  background: #ffffff;
  padding: 16px;
  text-align: center;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
}
.category-correct {
  position: absolute;
  bottom: 24px;
  right: 24px;
}

/* Drag into Blank (Ordering/Drag Words) */
.drag-blank-sentence {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
  margin-top: 16px;
}
.drag-blank-slot {
  border: 1px solid #4ade80;
  border-radius: 6px;
  background: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--primary-blue);
  font-size: 1.1rem;
}
.drag-options {
  display: flex;
  gap: 16px;
  justify-content: center;
}
.drag-option {
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: #ffffff;
  padding: 12px 32px;
  font-weight: 600;
  color: var(--text-main);
  font-size: 1rem;
}

/* Numeric text blue */
.numeric-text {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 24px;
}

/* Essay Box */
.essay-box {
  border: 1px solid #4ade80;
  border-radius: 8px;
  background: #ffffff;
  padding: 24px;
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-top: 16px;
  margin-bottom: 32px;
}

/* Ordering Rows */
.ordering-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.ordering-item {
  border: 1px solid #4ade80;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1rem;
}
.ordering-drag-handle {
  color: var(--text-muted);
  margin-right: 16px;
  cursor: grab;
  font-size: 1.2rem;
}
.ordering-correct {
  margin-left: auto;
  color: #16a34a;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Instructor Accordion */
.instructor-accordion {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  margin-top: 32px;
  overflow: hidden;
}
.instructor-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  user-select: none;
}
.accordion-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.accordion-icon-wrap {
  color: var(--primary-blue);
  border-bottom: 2px solid var(--primary-blue);
  padding-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.instructor-accordion-body {
  padding: 0 24px 24px 24px;
  display: none;
}
.instructor-accordion.open .instructor-accordion-body {
  display: block;
}
.instructor-accordion .bi-chevron-down {
  transition: transform 0.3s;
}
.instructor-accordion.open .bi-chevron-down {
  transform: rotate(180deg);
}

/* Explanation Box inside Accordion */
.explanation-box {
  background: #fffbeb;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 24px;
}
.explanation-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.explanation-text {
  color: #b45309;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.7;
}
