:root {
  --bg-primary: #f4f7fc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --success: #10b981;
  --success-light: #ecfdf5;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --border-color: #cbd5e1;
  --card-shadow: 0 20px 40px -15px rgba(79, 70, 229, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-subtle: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.15);
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --border-color: #334155;
  --card-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  overflow-x: hidden !important;
  max-width: 100vw;
  width: 100%;
  position: relative;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  user-select: none;
  touch-action: manipulation;
}

/* Header */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-main), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.desktop-only {
  display: flex;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-muted);
  white-space: nowrap;
}

.stat-badge span.val {
  color: var(--primary);
  font-weight: 800;
}

.btn-icon {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon:active {
  transform: scale(0.92);
}

.btn-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.btn-icon.active-toggle {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.mobile-only {
  display: none;
}

/* App Container */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 24px;
  flex: 1;
  overflow-x: hidden;
}

/* Sidebar & Drawer Styling */
.sidebar {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: fit-content;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.drawer-header {
  display: none;
}

.sidebar-user-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.user-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-box {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.stat-box .num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
}

.stat-box .label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-search-btn {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.sidebar-search-btn:active {
  transform: scale(0.98);
}

.sidebar-search-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drawer-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
  display: block;
  opacity: 1;
}

@media (max-width: 850px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex;
  }
  
  .drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border-color);
  }

  .app-container {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 14px;
    width: 100vw;
    overflow-x: hidden;
  }
  
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 200;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
    overflow-y: auto;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.25);
  }

  .brand-title {
    font-size: 1rem;
  }

  .stat-badge {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

.nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.nav-item:active {
  transform: scale(0.98);
}

.nav-item:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
}

.nav-icon-wrapper {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
  flex-shrink: 0;
}

.nav-blue { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.nav-purple { background: rgba(168, 85, 247, 0.12); color: #a855f7; }
.nav-orange { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.nav-red { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.nav-amber { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.nav-green { background: rgba(16, 185, 129, 0.12); color: #10b981; }

.nav-item .badge-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-card-subtle);
  color: var(--text-muted);
}

.nav-item.active .badge-count {
  background: var(--primary);
  color: #fff;
}

/* Main Area */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  overflow-x: hidden;
}

/* Progress bar container */
.progress-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}

.progress-bar-bg {
  flex: 1;
  height: 10px;
  background: var(--bg-card-subtle);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #a855f7);
  width: 0%;
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 65px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Question Card & Title Box Matching Option Style */
.question-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: var(--card-shadow);
  position: relative;
  touch-action: pan-y;
}

@media (min-width: 851px) {
  .question-card {
    padding: 28px;
  }
}

.question-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tag-num {
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(79, 70, 229, 0.25);
  letter-spacing: 0.02em;
}

.tag-page {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #d97706;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(217, 119, 6, 0.25);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-star {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 1.1rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-star.starred {
  color: #f59e0b;
  background: var(--warning-light);
  border-color: #f59e0b;
}

.btn-star:active {
  transform: scale(1.15);
}

/* Question Title Box (Identical Style to Options Card) */
.question-title-box {
  background: var(--bg-card-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.question-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.65;
  color: var(--text-main);
}

@media (max-width: 600px) {
  .question-text {
    font-size: 1.05rem;
  }
}

/* Options Grid Modernized */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
  min-height: 56px;
  touch-action: manipulation;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.option-btn .option-content {
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.5;
}

.option-btn:active:not(.disabled) {
  transform: scale(0.98);
  border-color: var(--primary);
}

.option-btn:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.1);
}

.option-key {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-btn:hover:not(.disabled) .option-key {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Option States with Rich Gradient & Contrast */
.option-btn.correct {
  border-color: var(--success) !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.16)) !important;
  color: var(--text-main) !important;
  animation: pulseSuccess 0.4s ease;
}

.option-btn.correct .option-key {
  background: var(--success) !important;
  color: #fff !important;
  border-color: var(--success) !important;
}

.option-btn.wrong {
  border-color: var(--danger) !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.16)) !important;
  color: var(--text-main) !important;
  animation: shakeWrong 0.4s ease;
}

.option-btn.wrong .option-key {
  background: var(--danger) !important;
  color: #fff !important;
  border-color: var(--danger) !important;
}

@keyframes pulseSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* Feedback Callout Redesign */
.feedback-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  display: none;
  animation: fadeIn 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.feedback-box.show {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-box.is-correct {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.15));
  border: 1px solid var(--success);
  color: #047857;
}

[data-theme="dark"] .feedback-box.is-correct {
  color: #34d399;
}

.feedback-box.is-wrong {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.15));
  border: 1px solid var(--danger);
  color: #b91c1c;
}

[data-theme="dark"] .feedback-box.is-wrong {
  color: #fca5a5;
}

.feedback-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-detail {
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 500;
}

/* Bottom Controls Sticky on Mobile */
.controls-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

@media (max-width: 850px) {
  .controls-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 90;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    border-bottom: none;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.95);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.95);
}

/* Grid Trigger Badge */
.grid-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
}

/* Footer */
.app-footer {
  text-align: center;
  padding: 20px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  margin-top: 35px;
  width: 100%;
}

.app-footer strong {
  color: var(--primary);
}

@media (max-width: 850px) {
  .app-footer {
    margin-bottom: calc(75px + env(safe-area-inset-bottom));
    padding-bottom: 20px;
  }
}

/* Reset Options Modal Styling */
.reset-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reset-option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.reset-option-item:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.reset-option-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  margin-top: 2px;
  cursor: pointer;
}

.reset-opt-content .title {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
}

.reset-opt-content .desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modal Legend */
.grid-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-dot.current {
  background: var(--primary);
}

.legend-dot.correct {
  background: var(--success);
}

.legend-dot.wrong {
  background: var(--danger);
}

.legend-dot.unread {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
}

/* Redesigned Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card-subtle);
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.grid-numbers {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}

@media (max-width: 600px) {
  .grid-numbers {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }
}

.num-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.num-cell:active {
  transform: scale(0.9);
}

.num-cell.current {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--primary);
}

.num-cell.correct {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

.num-cell.wrong {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* Toast Notification Redesign */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px) scale(0.9);
  background: rgba(16, 185, 129, 0.95);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 10px 22px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

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

.toast.toast-info {
  background: rgba(79, 70, 229, 0.95);
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
}

.toast.toast-warning {
  background: rgba(245, 158, 11, 0.95);
  box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
}

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

/* Search Results Redesign */
.search-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.95rem;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-item {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.search-item .q-title {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.search-item .q-ans {
  font-size: 0.83rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
