/* ════════════════════════════════════════
   StudyBuddy — style.css
   Dark glassmorphism design system
═════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────── */
:root {
  --bg: #0d0f1a;
  --bg2: #131629;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hi: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-hi: rgba(255, 255, 255, 0.2);

  --violet: #7c5ce0;
  --violet-lite: #a78bfa;
  --cyan: #22d3ee;
  --pink: #ec4899;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #f87171;

  --text: #e8e8f0;
  --text-muted: #8888aa;
  --text-dim: #555577;

  --radius: 18px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(124, 92, 224, 0.25);

  --sidebar-w: 230px;
  --transition: 0.3s cubic-bezier(.4, 0, .2, 1);
}

/* ── Reset & Base ──────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hi);
  border-radius: 99px;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.25rem;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2.5rem;
}

.logo-icon {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 8px rgba(124, 92, 224, 0.8));
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--violet-lite), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Nav */
.nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.nav-btn:hover {
  background: var(--surface);
  color: var(--text);
  transform: translateX(3px);
}

.nav-btn.active {
  background: linear-gradient(135deg, rgba(124, 92, 224, 0.25), rgba(34, 211, 238, 0.1));
  color: var(--violet-lite);
  border: 1px solid rgba(124, 92, 224, 0.35);
  box-shadow: 0 2px 12px rgba(124, 92, 224, 0.2);
}

.nav-icon {
  font-size: 1.15rem;
}

.nav-label {
  font-weight: 600;
}

/* Sidebar Stats */
.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 1.5rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--violet-lite);
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════
   MAIN CONTENT
══════════════════════════════════════ */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.5rem 2.5rem 4rem;
  max-width: 1100px;
}

/* ── Section Header ───────────────────── */
.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--violet-lite));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 0.95rem;
}

/* ── Tab Panels ───────────────────────── */
.tab-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ══════════════════════════════════════
   SHARED COMPONENTS
══════════════════════════════════════ */

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--violet), #5b21b6);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(124, 92, 224, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124, 92, 224, 0.55);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.wide {
  width: 100%;
  margin-top: 1rem;
  padding: 14px;
  font-size: 1rem;
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover {
  background: var(--surface-hi);
  color: var(--text);
  border-color: var(--border-hi);
}

.btn-ghost.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  transition: var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.toggle input:checked+.toggle-slider {
  background: var(--violet);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(22px);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

input[type="text"],
input[type="number"],
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  resize: vertical;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--violet);
  background: rgba(124, 92, 224, 0.08);
  box-shadow: 0 0 0 3px rgba(124, 92, 224, 0.18);
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.editor-btns {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.editor-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.card-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0 0.75rem;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.empty-msg {
  color: var(--text-dim);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem 0;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: var(--surface-hi);
  color: var(--text);
}

/* ══════════════════════════════════════
   POMODORO
══════════════════════════════════════ */

/* Mode Pills */
.mode-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px;
  width: fit-content;
}

.pill {
  padding: 8px 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 99px;
  cursor: pointer;
  transition: var(--transition);
}

.pill.active {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 2px 10px rgba(124, 92, 224, 0.5);
}

.pill:hover:not(.active) {
  color: var(--text);
}

/* Pomodoro two-column layout */
.pomodoro-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.pomodoro-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Timer Card */
.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  box-shadow: var(--shadow), var(--shadow-glow);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.timer-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(124, 92, 224, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Ring */
.timer-ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-ring {
  position: absolute;
  top: 0;
  left: 0;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 10;
}

.ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 615.75;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

/* inject gradient via JS — fallback stroke */
.ring-fill {
  stroke: var(--violet);
}

.timer-display {
  position: relative;
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
}

.timer-mode-label {
  position: absolute;
  bottom: -1.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

/* Controls */
.timer-controls {
  display: flex;
  gap: 14px;
  align-items: center;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
}

.ctrl-btn:hover {
  border-color: var(--border-hi);
  color: var(--text);
  background: var(--surface-hi);
}

.ctrl-btn.primary {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--violet), #5b21b6);
  border: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 0 4px 18px rgba(124, 92, 224, 0.5);
}

.ctrl-btn.primary:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 24px rgba(124, 92, 224, 0.65);
}

/* Session Dots */
.session-dots {
  display: flex;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: var(--transition);
}

.dot.active {
  background: var(--violet);
  box-shadow: 0 0 6px var(--violet);
}

.dot.done {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

/* Settings Card */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.settings-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.setting-row label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.toggle-row {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

/* Input Stepper */
.input-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow: hidden;
}

.input-stepper button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.input-stepper button:hover {
  background: var(--surface-hi);
  color: var(--text);
}

.input-stepper input {
  width: 46px;
  text-align: center;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  padding: 6px 4px;
  border-radius: 0;
  color: var(--text);
  font-size: 0.9rem;
}

.input-stepper input:focus {
  box-shadow: none;
  background: transparent;
}

/* ══════════════════════════════════════
   FLASHCARDS
══════════════════════════════════════ */
.fc-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.fc-viewer-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fc-deck-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.fc-nav-btns {
  display: flex;
  gap: 6px;
}

/* Flashcard */
.flashcard {
  width: 100%;
  aspect-ratio: 3/2;
  perspective: 1000px;
  cursor: pointer;
}

.fc-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(.4, 0, .2, 1);
  border-radius: var(--radius);
}

.fc-inner.flipped {
  transform: rotateY(180deg);
}

.fc-front,
.fc-back {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fc-front {
  background: linear-gradient(145deg, rgba(124, 92, 224, 0.2), rgba(34, 211, 238, 0.08));
  border: 1px solid rgba(124, 92, 224, 0.3);
  box-shadow: var(--shadow), 0 0 30px rgba(124, 92, 224, 0.15);
}

.fc-back {
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.15), rgba(124, 92, 224, 0.08));
  border: 1px solid rgba(34, 211, 238, 0.25);
  box-shadow: var(--shadow), 0 0 30px rgba(34, 211, 238, 0.15);
  transform: rotateY(180deg);
}

.fc-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.fc-text {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.5;
}

.fc-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Rating */
.fc-rating {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}

.rating-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.rating-btns {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.rating-btn {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
}

.rating-btn:hover {
  transform: scale(1.04);
}

.rating-btn.bad:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--red);
}

.rating-btn.ok:hover {
  background: rgba(251, 191, 36, 0.2);
  border-color: var(--amber);
}

.rating-btn.good:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--green);
}

/* Editor */
.fc-editor-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.editor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Card List Items */
.card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.card-item:hover {
  border-color: var(--violet);
  background: rgba(124, 92, 224, 0.08);
}

.card-item.active {
  border-color: var(--violet);
  background: rgba(124, 92, 224, 0.12);
}

.card-item-q {
  flex: 1;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-item-deck {
  font-size: 0.75rem;
  color: var(--violet-lite);
  background: rgba(124, 92, 224, 0.15);
  padding: 2px 8px;
  border-radius: 99px;
}

.card-item-del {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.card-item-del:hover {
  color: var(--red);
  background: rgba(248, 113, 113, 0.12);
}

/* ══════════════════════════════════════
   QUIZ
══════════════════════════════════════ */
.quiz-setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.quiz-builder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.qz-options-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qz-options-wrap>label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.qz-option-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qz-option-row input[type="radio"] {
  display: none;
}

.radio-correct-label {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-dim);
  transition: var(--transition);
  flex-shrink: 0;
}

.qz-option-row input[type="radio"]:checked+.radio-correct-label {
  background: var(--green);
  border-color: var(--green);
  color: #000;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.4);
}

.qz-opt-input {
  flex: 1;
}

.quiz-list-col {
  display: flex;
  flex-direction: column;
}

.quiz-settings-row {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* Question list items */
.q-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.q-item:hover {
  border-color: var(--cyan);
}

.q-item-num {
  font-weight: 700;
  color: var(--cyan);
  min-width: 22px;
}

.q-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-item-del {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.q-item-del:hover {
  color: var(--red);
}

/* Active Quiz */
.quiz-progress-bar-wrap {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  border-radius: 99px;
  transition: width 0.5s ease;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.qz-timer-badge {
  background: rgba(124, 92, 224, 0.2);
  border: 1px solid rgba(124, 92, 224, 0.4);
  color: var(--violet-lite);
  padding: 4px 14px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.88rem;
}

.qz-timer-badge.urgent {
  background: rgba(248, 113, 113, 0.2);
  border-color: var(--red);
  color: var(--red);
  animation: pulse 0.6s ease infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 1;
  }

  to {
    opacity: 0.5;
  }
}

.quiz-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  max-width: 680px;
  box-shadow: var(--shadow);
}

.qz-q-text {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.qz-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.98rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--violet-lite);
  background: rgba(124, 92, 224, 0.1);
  transform: translateX(4px);
}

.answer-btn .opt-badge {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.answer-btn.correct {
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.15);
}

.answer-btn.correct .opt-badge {
  background: var(--green);
  color: #000;
}

.answer-btn.wrong {
  border-color: var(--red);
  background: rgba(248, 113, 113, 0.15);
}

.answer-btn.wrong .opt-badge {
  background: var(--red);
  color: #fff;
}

.answer-btn:disabled {
  cursor: default;
}

/* Results */
.results-card {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem 2.5rem;
  text-align: center;
  box-shadow: var(--shadow), var(--shadow-glow);
}

.results-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.results-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.results-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--violet-lite);
  margin: 1rem 0 0.25rem;
}

.results-pct {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.results-bar-wrap {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.results-bar {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s ease 0.3s;
}

.results-review {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 2rem;
  max-height: 220px;
  overflow-y: auto;
  text-align: left;
}

.review-item {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
}

.review-item.pass {
  background: rgba(74, 222, 128, 0.1);
}

.review-item.fail {
  background: rgba(248, 113, 113, 0.1);
}

.review-icon {
  flex-shrink: 0;
}

.results-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg2);
  border: 1px solid var(--border-hi);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all 0.35s cubic-bezier(.4, 0, .2, 1);
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  :root {
    --sidebar-w: 70px;
  }

  .logo-text,
  .nav-label {
    display: none;
  }

  .logo {
    justify-content: center;
  }

  .nav-btn {
    justify-content: center;
    padding: 12px;
  }

  .sidebar-stats {
    display: none;
  }

  .pomodoro-layout,
  .fc-layout,
  .quiz-setup-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 1.5rem 1.25rem 3rem;
  }
}

@media (max-width: 600px) {
  .timer-card {
    padding: 2rem 1rem;
  }

  .quiz-question-card {
    padding: 1.5rem;
  }

  .results-card {
    padding: 2rem 1.25rem;
  }
}
