/* ==========================================================================
   StudyTwin — Personal AI Study Buddy Modern Stylesheet
   ========================================================================== */

:root {
  --bg-primary: #0c101d;
  --bg-secondary: #13182c;
  --card-bg: #181f39;
  --card-border: #263056;
  --card-hover: #1e2749;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent: #8b5cf6;
  --accent-light: rgba(139, 92, 246, 0.15);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.3);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.3);

  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.3);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TYPOGRAPHY & UTILITIES
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.gradient-text {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ==========================================================================
   NAVBAR
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 16, 29, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.brand-logo {
  font-size: 1.8rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.25rem 0.5rem;
  box-shadow: var(--shadow-sm);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  padding: 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--card-border);
  gap: 0.25rem;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #fff;
}

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.nav-actions {
  display: flex;
  align-items: center;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-pill:hover {
  border-color: var(--primary);
  background: var(--card-bg);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-online {
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-offline {
  background-color: var(--warning);
  box-shadow: 0 0 8px var(--warning);
}

.status-checking {
  background-color: var(--text-dim);
  animation: pulse 1.2s infinite;
}

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

/* ==========================================================================
   HERO SECTION
   ========================================================================== */

.hero-section {
  max-width: 1000px;
  margin: 3rem auto 2.5rem;
  padding: 0 1.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  border: 1px solid rgba(139, 92, 246, 0.35);
  color: #c084fc;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.18;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 1.75rem;
  font-weight: 400;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

/* ==========================================================================
   DEDICATION CARD (BUILD FOR A FRIEND THEME)
   ========================================================================== */

.friend-dedication-card {
  background: linear-gradient(135deg, rgba(24, 31, 57, 0.9) 0%, rgba(30, 39, 73, 0.8) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: left;
  position: relative;
  overflow: hidden;
}

.friend-dedication-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #c084fc, #10b981);
}

.dedication-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dedication-avatar {
  font-size: 2rem;
  background: var(--primary-light);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
}

.dedication-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #a5b4fc;
}

.dedication-heading {
  font-size: 1.25rem;
  font-weight: 700;
}

.highlight-friend {
  color: #38bdf8;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

.icon-btn-inline {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  margin-left: 0.4rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.icon-btn-inline:hover {
  opacity: 1;
}

.dedication-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

.dedication-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: #e2e8f0;
  display: block;
  margin-bottom: 0.25rem;
}

.dedication-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */

.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--card-hover);
  border-color: #3f4e82;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--card-border);
}
.btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
}
.btn-accent:hover {
  background: #7c3aed;
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-input-action {
  white-space: nowrap;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.3rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.main-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  font-size: 1rem;
  font-family: inherit;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.main-input::placeholder {
  color: var(--text-dim);
}

.input-sm {
  padding: 0.55rem 0.85rem;
  font-size: 0.875rem;
}

.input-wrapper {
  display: flex;
  gap: 0.6rem;
  position: relative;
}

.select-wrapper {
  position: relative;
}

.main-select {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #fff;
  outline: none;
  cursor: pointer;
}

.main-select option {
  background: var(--bg-secondary);
  color: #fff;
}

/* ==========================================================================
   WORKSPACE TABS & CARDS
   ========================================================================== */

.study-workspace {
  max-width: 1080px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
  width: 100%;
}

.workspace-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: #fff;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-sm);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.panel-card {
  padding: 2rem;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.45rem;
  margin-bottom: 0.35rem;
}

.panel-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* STYLE TOGGLE (RADIO PILLS) */

.style-toggle-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.style-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.radio-pills {
  display: flex;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  padding: 0.25rem;
  gap: 0.2rem;
}

.radio-pill {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.radio-pill span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.radio-pill input:checked + span {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* CHIPS */

.chips-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.chips-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.chips-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  color: #fff;
  border-color: var(--primary);
  background: var(--card-hover);
}

/* ==========================================================================
   RESULT AREA & MARKDOWN FORMATTING
   ========================================================================== */

.result-area {
  margin-top: 2rem;
  border-top: 1px solid var(--card-border);
  padding-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.badge-success {
  background: var(--success-bg);
  color: #34d399;
  border: 1px solid var(--success-border);
}

.badge-info {
  background: var(--primary-light);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-neutral {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--card-border);
}

.badge-accent {
  background: var(--accent-light);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.explanation-body {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  color: #e2e8f0;
  font-size: 1rem;
  line-height: 1.7;
}

/* Clean markdown formatting */
.markdown-rendered h1,
.markdown-rendered h2,
.markdown-rendered h3,
.markdown-rendered h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.65rem;
  color: #fff;
}

.markdown-rendered h1:first-child,
.markdown-rendered h2:first-child,
.markdown-rendered h3:first-child {
  margin-top: 0;
}

.markdown-rendered p {
  margin-bottom: 1rem;
}

.markdown-rendered ul, 
.markdown-rendered ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.markdown-rendered li {
  margin-bottom: 0.4rem;
}

.markdown-rendered strong {
  color: #38bdf8;
}

.markdown-rendered code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: #f43f5e;
}

.markdown-rendered pre {
  background: #090d18;
  border: 1px solid #232c4f;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.markdown-rendered pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #a5b4fc;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ==========================================================================
   QUIZ PLAYGROUND & STEPPER
   ========================================================================== */

.quiz-playground {
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.quiz-stepper-header {
  margin-bottom: 1.5rem;
}

.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.quiz-topic-indicator {
  font-weight: 700;
  color: #38bdf8;
  font-size: 0.95rem;
}

.quiz-step-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.progress-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.35s ease;
}

.quiz-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.quiz-question-text {
  font-size: 1.25rem;
  margin-bottom: 1.75rem;
  line-height: 1.45;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.quiz-option-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.quiz-option-card:hover {
  background: var(--card-hover);
  border-color: #4b588e;
}

.quiz-option-card.selected {
  background: rgba(99, 102, 241, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.option-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.quiz-option-card.selected .option-badge {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.option-text {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 500;
}

/* FEEDBACK BOX */

.question-feedback-box {
  background: rgba(24, 31, 57, 0.95);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.feedback-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.feedback-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.quiz-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quiz-hint-msg {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

/* ==========================================================================
   QUIZ RESULTS & DETAILED REVIEW
   ========================================================================== */

.quiz-results-screen {
  margin-top: 1.5rem;
  animation: fadeIn 0.35s ease;
}

.results-summary-card {
  text-align: center;
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  margin-bottom: 2rem;
}

.results-score-badge {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
}

.results-title {
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
}

.results-score-text {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.results-score-text strong {
  color: #38bdf8;
  font-size: 1.5rem;
}

.results-feedback-message {
  font-size: 1.05rem;
  color: #e2e8f0;
  max-width: 500px;
  margin: 0 auto 1.75rem;
}

.results-cta-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* REVIEW LIST */

.results-review-container {
  margin-top: 2rem;
}

.review-header {
  margin-bottom: 1.25rem;
}

.review-header h3 {
  font-size: 1.35rem;
  margin-bottom: 0.35rem;
}

.review-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.review-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.review-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.review-card.correct {
  border-left: 4px solid var(--success);
}

.review-card.incorrect {
  border-left: 4px solid var(--danger);
}

.review-question-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.review-question-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.review-outcome-pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.review-card.correct .review-outcome-pill {
  background: var(--success-bg);
  color: #34d399;
  border: 1px solid var(--success-border);
}

.review-card.incorrect .review-outcome-pill {
  background: var(--danger-bg);
  color: #f87171;
  border: 1px solid var(--danger-border);
}

.review-answers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.review-answer-box {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}

.review-answer-box.user-choice {
  border: 1px solid var(--card-border);
}

.review-answer-box.correct-choice {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: #34d399;
}

.review-explanation-box {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.review-explanation-box strong {
  color: #e2e8f0;
}

/* ==========================================================================
   SECTION 3: STUDY TIPS & RETENTION
   ========================================================================== */

.tips-generator-box {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.tips-gen-title {
  font-size: 1.05rem;
  margin-bottom: 0.85rem;
}

.tips-result-box {
  background: var(--bg-secondary);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 2rem;
  animation: fadeIn 0.3s ease;
}

.tips-result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tips-target-topic {
  font-weight: 700;
  color: #38bdf8;
}

.tips-rendered-content {
  line-height: 1.65;
  color: #e2e8f0;
}

.tips-frameworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.framework-card {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.framework-card:hover {
  transform: translateY(-2px);
  border-color: #3e4c80;
}

.framework-icon {
  font-size: 1.85rem;
  margin-bottom: 0.75rem;
}

.framework-title {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.framework-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.framework-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #a5b4fc;
  background: var(--primary-light);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

/* POMODORO TIMER */

.pomodoro-widget {
  background: linear-gradient(135deg, #181f39 0%, #151a30 100%);
  border: 1px solid var(--card-border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.pomodoro-left h4 {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.pomodoro-left p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pomodoro-timer-display {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.05em;
}

.pomodoro-controls {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #181f3a;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-icon {
  font-size: 1.35rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 1.5rem;
}

.modal-status-box {
  background: var(--bg-secondary);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.status-indicator-big {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.modal-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-field {
  margin-bottom: 1.25rem;
}

.modal-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.modal-instructions {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-instructions h4 {
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.modal-instructions ol {
  padding-left: 1.25rem;
}

.modal-instructions li {
  margin-bottom: 0.35rem;
}

.modal-instructions code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: #38bdf8;
}

.modal-footer {
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--card-border);
  background: rgba(12, 16, 29, 0.7);
  padding: 1.5rem 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-left {
  display: flex;
  flex-direction: column;
}

.footer-left strong {
  color: #fff;
}

.footer-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.privacy-tag {
  color: #34d399;
  font-weight: 500;
}

/* ==========================================================================
   SPINNER
   ========================================================================== */

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE FRIENDLY)
   ========================================================================== */

@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 1rem;
  }
  .nav-links {
    display: none; /* Mobile can use workspace tabs */
  }
  .workspace-tabs {
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.75rem;
  }
  .tab-btn {
    font-size: 0.875rem;
    padding: 0.6rem 0.9rem;
  }
  .dedication-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .panel-card {
    padding: 1.25rem;
  }
  .input-wrapper {
    flex-direction: column;
  }
  .btn-input-action {
    width: 100%;
  }
  .quiz-card {
    padding: 1.25rem;
  }
  .review-answers-grid {
    grid-template-columns: 1fr;
  }
  .pomodoro-widget {
    flex-direction: column;
    text-align: center;
  }
}
