/* =========================================================================
   STYLE.CSS - MODERN DESIGN SYSTEM CHO HỆ THỐNG TRẮC NGHIỆM JAVA
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.25);

  --success: #10b981;
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-border: #6ee7b7;

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fca5a5;

  --warning: #f59e0b;
  --warning-light: #fffbeb;

  --bg-main: #0f172a;
  --bg-surface: #1e293b;
  --bg-card: #ffffff;
  --bg-card-subtle: #f8fafc;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  --text-dim: #94a3b8;

  --border-light: #e2e8f0;
  --border-dark: #334155;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.3);

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-code: 'JetBrains Mono', Consolas, monospace;
}

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

body {
  font-family: var(--font-main);
  background: #f1f5f9;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =========================================================================
   HEADER & NAVBAR
   ========================================================================= */
.navbar {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #334155;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text span {
  font-size: 0.75rem;
  color: #94a3b8;
  display: block;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.admin-badge.locked {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-badge.unlocked {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: white;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
}
.btn-secondary:hover {
  background: #475569;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 1px solid #475569;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #94a3b8;
}

/* =========================================================================
   CONTAINER & LAYOUT
   ========================================================================= */
.main-wrapper {
  max-width: 1320px;
  margin: 28px auto;
  padding: 0 20px;
  width: 100%;
  flex: 1;
}

/* =========================================================================
   1. HOME / MODE SELECTOR VIEW
   ========================================================================= */
.hero-section {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
  max-width: 980px;
  margin: 0 auto 50px auto;
}

.mode-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.mode-card:hover {
  transform: translateY(-6px);
  border-color: #cbd5e1;
}

.mode-card.featured {
  border-color: #6366f1;
  background: linear-gradient(to bottom, #ffffff, #fbfbfe);
}

.mode-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 22px;
}

.mode-card.exam-mode .mode-icon-circle {
  background: #eff6ff;
  color: #2563eb;
}

.mode-card.practice-mode .mode-icon-circle {
  background: #ecfdf5;
  color: #059669;
}

.mode-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.mode-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  flex-grow: 1;
}

.mode-features-list {
  list-style: none;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-features-list li {
  font-size: 0.9rem;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-features-list li span.check {
  color: #10b981;
  font-weight: 700;
}

/* Locked Practice Mode State */
.mode-card.locked {
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.88;
}

.mode-card.locked:hover {
  transform: none;
}

.lock-ribbon {
  position: absolute;
  top: 18px;
  right: -32px;
  background: #ef4444;
  color: white;
  padding: 4px 36px;
  font-size: 0.75rem;
  font-weight: 700;
  transform: rotate(45deg);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.locked-notice {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =========================================================================
   2. PRACTICE MODE VIEW
   ========================================================================= */
.practice-header {
  background: white;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.exam-filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill.active {
  background: #4f46e5;
  color: white;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.practice-search {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-size: 0.9rem;
  width: 280px;
  outline: none;
  font-family: inherit;
}
.practice-search:focus {
  border-color: #6366f1;
}

.practice-stats {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Question Cards for Practice */
.question-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.q-box {
  background: white;
  border-radius: var(--radius-md);
  padding: 26px 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.q-box-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.q-badge-exam {
  font-size: 0.8rem;
  font-weight: 700;
  background: #eef2ff;
  color: #4338ca;
  padding: 3px 10px;
  border-radius: 6px;
}

.q-num-text {
  font-weight: 800;
  color: #1e293b;
  font-size: 1.05rem;
}

.q-text-body {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.55;
  margin-bottom: 18px;
}

.q-img-wrap {
  margin: 16px 0;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 6px;
  background: #f8fafc;
  display: inline-block;
  max-width: 100%;
}

.q-img-wrap img {
  max-width: 100%;
  max-height: 400px;
  border-radius: 4px;
  display: block;
}

/* Options */
.options-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.opt-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-size: 0.96rem;
  color: #334155;
  position: relative;
}

.opt-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.opt-label {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.opt-text {
  flex-grow: 1;
  word-break: break-word;
  line-height: 1.4;
  padding-top: 2px;
}

/* Practice Option states */
.opt-btn.correct {
  background: var(--success-light) !important;
  border-color: var(--success) !important;
  color: #065f46 !important;
}
.opt-btn.correct .opt-label {
  background: var(--success) !important;
  color: white !important;
}

.opt-btn.incorrect {
  background: var(--danger-light) !important;
  border-color: var(--danger) !important;
  color: #991b1b !important;
}
.opt-btn.incorrect .opt-label {
  background: var(--danger) !important;
  color: white !important;
}

.opt-btn.show-correct {
  border-color: var(--success) !important;
  border-style: dashed !important;
  background: #f0fdf4 !important;
}

/* Explanation Box */
.explanation-drawer {
  margin-top: 20px;
  border-radius: var(--radius-md);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 20px 22px;
  display: none;
  animation: slideDown 0.25s ease-out forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.explanation-drawer.visible {
  display: block;
}

.exp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #166534;
  margin-bottom: 8px;
}

.exp-content {
  font-size: 0.95rem;
  color: #14532d;
  line-height: 1.6;
}

/* =========================================================================
   3. EXAM MODE VIEW
   ========================================================================= */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 992px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }
}

.exam-main-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.exam-timer-bar {
  background: #1e293b;
  color: white;
  padding: 16px 22px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}

.timer-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-code);
  font-size: 1.4rem;
  font-weight: 700;
  color: #38bdf8;
}

.timer-clock.warning {
  color: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Exam Sidebar */
.exam-sidebar {
  background: white;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.q-grid-palette {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.palette-btn {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.palette-btn:hover {
  background: #e2e8f0;
}

.palette-btn.answered {
  background: #10b981;
  color: white;
  border-color: #059669;
}

.palette-btn.current {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px #818cf8;
}

/* =========================================================================
   4. EXAM RESULT SCREEN
   ========================================================================= */
.result-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 820px;
  margin: 0 auto 40px auto;
}

.score-badge-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 0 auto 24px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.score-badge-circle.passed {
  background: linear-gradient(135deg, #10b981, #059669);
}

.score-badge-circle.failed {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.score-points {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
}

.score-total {
  font-size: 0.95rem;
  opacity: 0.9;
}

.result-status-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.result-status-title.passed { color: #059669; }
.result-status-title.failed { color: #dc2626; }

.result-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 32px 0;
  padding: 24px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
}

.summary-metric {
  background: #f8fafc;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid #e2e8f0;
}

.metric-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.metric-lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* =========================================================================
   MODAL DIALOG
   ========================================================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.2s;
}

.modal-overlay.open .modal-card {
  transform: translateY(0);
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
}

.modal-body {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* =========================================================================
   EXAM SETUP MODAL STYLES
   ========================================================================= */
.modal-card.setup-modal {
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  text-align: left;
  padding: 28px 32px;
}

.setup-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
}

.setup-header-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.setup-header-text h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.setup-header-text p {
  font-size: 0.85rem;
  color: #64748b;
}

.setup-section {
  margin-bottom: 22px;
}

.setup-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}

.setup-hint {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.preset-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.setup-pill {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.setup-pill:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.setup-pill.active {
  background: #4f46e5;
  color: white;
  border-color: #4338ca;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.setup-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.setup-number-input {
  width: 110px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  outline: none;
  font-family: inherit;
}

.setup-number-input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.setup-unit-label {
  font-size: 0.88rem;
  color: #64748b;
  font-weight: 600;
}

.setup-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  cursor: pointer;
  user-select: none;
}

.setup-toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #4f46e5;
  cursor: pointer;
}

.setup-toggle-row span {
  font-size: 0.88rem;
  color: #334155;
  font-weight: 500;
}


/* =========================================================================
   CODE SNIPPET & CATEGORY BADGE
   ========================================================================= */
.q-code-snippet {
  background: #0f172a;
  color: #f8fafc;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font-code);
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-x: auto;
  margin: 12px 0 16px 0;
  border: 1px solid #334155;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.q-code-snippet code {
  font-family: inherit;
  color: #38bdf8;
  white-space: pre;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.bank-id-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

/* =========================================================================
   TOPIC CHIPS & SELECTOR
   ========================================================================= */
.topic-selector-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.topic-selector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.topic-selector-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topic-quick-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.topic-preset-btn {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  transition: all 0.15s;
}

.topic-preset-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.topic-preset-btn.active-preset {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #818cf8;
}

.topic-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.83rem;
  font-weight: 600;
  background: #f8fafc;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-chip:hover {
  border-color: #cbd5e1;
  background: #f1f5f9;
}

.topic-chip.selected {
  background: #eef2ff;
  color: #4338ca;
  border-color: #6366f1;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.topic-chip .chip-count {
  font-size: 0.74rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-weight: 700;
}

.topic-chip.selected .chip-count {
  background: #c7d2fe;
  color: #312e81;
}

.topic-chip .chip-check {
  font-size: 0.82rem;
  font-weight: 700;
}

/* In Modal setup */
.modal-topic-chips-grid {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background: #f8fafc;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 24px 20px;
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid #1e293b;
  margin-top: auto;
}
