/* ============================================
   AYT Matematik - PWA Çalışma Uygulaması
   Dark Theme + Glassmorphism + Responsive
   ============================================ */

/* ===== CSS Custom Properties ===== */
:root {
  --bg-primary: #07070f;
  --bg-secondary: #0d0d1a;
  --bg-tertiary: #12122a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-strong: rgba(255, 255, 255, 0.1);

  --text-primary: #e8ecf4;
  --text-secondary: #8b92a8;
  --text-muted: #5a6178;
  --text-accent: #a78bfa;

  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-orange: #f59e0b;
  --accent-pink: #ec4899;

  --gradient-primary: linear-gradient(135deg, #7c3aed, #06b6d4);
  --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
  --gradient-danger: linear-gradient(135deg, #ef4444, #f59e0b);
  --gradient-warm: linear-gradient(135deg, #f59e0b, #ec4899);
  --gradient-cool: linear-gradient(135deg, #3b82f6, #7c3aed);

  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.3);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--safe-top);
  padding-bottom: calc(70px + var(--safe-bottom));
}

/* Background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input, select { font-family: inherit; color: inherit; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ===== App Container ===== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 16px;
  margin: 0 -16px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.header-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.header-logo h1 {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-hover);
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(7, 7, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding-bottom: var(--safe-bottom);
}

.bottom-nav-inner {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  padding: 8px 0 6px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-item.active {
  color: var(--accent-purple);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
}

.nav-item-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-item-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.nav-item.active .nav-item-label {
  color: var(--accent-purple);
}

/* ===== Page Sections ===== */
.page-section {
  display: none;
  padding: 20px 0;
  animation: fadeIn 0.3s ease;
}

.page-section.active {
  display: block;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}


/* ===== Subject Toggle Bar ===== */
.subject-toggle-bar {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 4px;
  gap: 6px;
  margin-bottom: 20px;
}

.subject-toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.subject-toggle-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.35);
}

.subject-toggle-btn[data-subject="fizik"].active {
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

/* ===== Dashboard Subject Cards ===== */
.dashboard-subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.dash-subject-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.dash-subject-card.math {
  border-left: 4px solid var(--accent-blue);
}

.dash-subject-card.physics {
  border-left: 4px solid var(--accent-red);
}

.dash-subject-card:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.dash-subject-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.dash-subject-card.math .dash-subject-icon {
  background: rgba(59, 130, 246, 0.15);
}

.dash-subject-card.physics .dash-subject-icon {
  background: rgba(239, 68, 68, 0.15);
}

.dash-subject-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dash-subject-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.dash-subject-arrow {
  margin-left: auto;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.dash-subject-card:hover .dash-subject-arrow {
  transform: translateX(4px);
  color: var(--text-primary);
}

/* Header branch button */
.header-btn.branch-btn {
  width: auto;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  gap: 6px;
  display: inline-flex;
}

.header-btn.branch-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

/* ===== Dashboard ===== */
/* Overall Progress Card */
.progress-overview {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.progress-overview::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

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

.progress-overview-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.progress-overview-percentage {
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.progress-bar-container {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 1s ease-out;
  width: 0;
}

.progress-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.progress-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.progress-stat-dot.correct { background: var(--accent-green); }
.progress-stat-dot.wrong { background: var(--accent-red); }
.progress-stat-dot.blank { background: var(--accent-orange); }

/* Weak Points Section */
.weak-points-section {
  margin-bottom: 24px;
}

.weak-points-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.weak-point-card {
  background: var(--bg-glass);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-normal);
}

.weak-point-card:hover {
  background: var(--bg-glass-strong);
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateX(4px);
}

.weak-point-indicator {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.weak-point-indicator.low {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.weak-point-indicator.medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.weak-point-info {
  flex: 1;
  min-width: 0;
}

.weak-point-topic {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.weak-point-subtopic {
  font-weight: 600;
  font-size: 0.95rem;
}

.weak-point-btn {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.weak-point-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Recent Activity */
.recent-section {
  margin-bottom: 24px;
}

.recent-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition-fast);
}

.recent-item:hover {
  background: var(--bg-glass-strong);
}

.recent-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.recent-info {
  flex: 1;
  min-width: 0;
}

.recent-info-title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-info-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.recent-net {
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.recent-net.good { color: var(--accent-green); }
.recent-net.ok { color: var(--accent-orange); }
.recent-net.bad { color: var(--accent-red); }

/* ===== Topics Grid ===== */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.topic-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--topic-color, var(--gradient-primary));
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.topic-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.topic-card:hover::before {
  opacity: 1;
}

.topic-card:active {
  transform: translateY(-2px);
}

.topic-card-icon {
  font-size: 2.2rem;
  margin-bottom: 10px;
  display: block;
}

.topic-card-name {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.topic-card-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.topic-card-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease-out;
  background: var(--topic-color, var(--gradient-primary));
}

.topic-card-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===== Flashcards Page ===== */
.flashcard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.back-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--bg-glass-strong);
}

.flashcard-topic-name {
  font-size: 1.3rem;
  font-weight: 800;
}

.subtopic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.subtopic-chip {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.subtopic-chip.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.subtopic-chip:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-hover);
}

/* Card Stack */
.card-stack-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.flashcard {
  width: 100%;
  max-width: 500px;
  min-height: 280px;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  position: relative;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.flashcard:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.flashcard-number {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.flashcard-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-accent);
}

.flashcard-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.flashcard-formula {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  font-size: 1.2rem;
}

.flashcard-formula .katex {
  font-size: 1.3rem;
}

.flashcard-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.flashcard-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all var(--transition-fast);
}

.flashcard-nav-btn:hover {
  background: var(--bg-glass-strong);
  border-color: var(--border-hover);
}

.flashcard-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.flashcard-dots {
  display: flex;
  gap: 6px;
}

.flashcard-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all var(--transition-fast);
}

.flashcard-dot.active {
  background: var(--accent-purple);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.5);
}

/* ===== Quiz Page ===== */
.quiz-setup {
  max-width: 500px;
  margin: 0 auto;
}

.quiz-setup-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
}

.quiz-setup-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.quiz-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  appearance: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238b92a8' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

.quiz-select:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.quiz-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.quiz-count-options {
  display: flex;
  gap: 10px;
}

.quiz-count-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  text-align: center;
}

.quiz-count-btn.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.quiz-count-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.quiz-difficulty-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quiz-diff-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-strong);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  text-align: center;
}

.quiz-diff-btn.active {
  border-color: var(--accent-purple);
}

.quiz-diff-btn.active[data-diff="kolay"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.quiz-diff-btn.active[data-diff="orta"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.quiz-diff-btn.active[data-diff="zor"] {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.quiz-diff-btn.active[data-diff="hepsi"] {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-purple);
  color: var(--accent-purple);
}

.quiz-diff-btn:hover {
  background: var(--bg-card-hover);
}

.timer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.timer-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-full);
  transition: all var(--transition-normal);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: all var(--transition-normal);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-purple);
}

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

.quiz-start-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--gradient-primary);
  color: white;
  font-size: 1.05rem;
  font-weight: 700;
  transition: all var(--transition-normal);
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.quiz-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.quiz-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Quiz Active */
.quiz-active-container {
  max-width: 600px;
  margin: 0 auto;
}

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

.quiz-progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.quiz-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  padding: 6px 14px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: var(--radius-full);
}

.quiz-timer.warning { color: var(--accent-orange); background: rgba(245, 158, 11, 0.1); }
.quiz-timer.danger { color: var(--accent-red); background: rgba(239, 68, 68, 0.1); animation: pulse 1s ease infinite; }

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

.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 24px;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.question-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.question-difficulty {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.question-difficulty.kolay {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.question-difficulty.orta {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.question-difficulty.zor {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 20px;
}

.question-text .katex {
  font-size: 1.1rem;
}

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

.option-btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-strong);
  border: 2px solid var(--border-color);
  text-align: left;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-btn:hover {
  transform: translateX(4px);
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.option-btn.selected {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.option-btn.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
}

.option-btn.wrong {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.option-btn.selected .option-letter {
  background: var(--accent-purple);
  color: white;
}

.option-btn.correct .option-letter {
  background: var(--accent-green);
  color: white;
}

.option-btn.wrong .option-letter {
  background: var(--accent-red);
  color: white;
}

.option-text {
  flex: 1;
}

.option-text .katex {
  font-size: 1rem;
}

.quiz-nav-btns {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.quiz-nav-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  text-align: center;
}

.quiz-nav-btn.secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
}

.quiz-nav-btn.secondary:hover {
  background: var(--bg-glass-strong);
}

.quiz-nav-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.quiz-nav-btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.quiz-nav-btn.finish {
  background: var(--gradient-success);
}

.quiz-skip-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 8px;
  transition: all var(--transition-fast);
}

.quiz-skip-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ===== Results Page ===== */
.results-container {
  max-width: 600px;
  margin: 0 auto;
}

.results-hero {
  text-align: center;
  padding: 30px 20px;
  margin-bottom: 24px;
  position: relative;
}

.results-emoji {
  font-size: 4rem;
  margin-bottom: 12px;
  display: block;
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.results-message {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.results-net {
  font-size: 2.5rem;
  font-weight: 900;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.results-net-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.result-stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
}

.result-stat-number {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.result-stat-number.correct { color: var(--accent-green); }
.result-stat-number.wrong { color: var(--accent-red); }
.result-stat-number.blank { color: var(--accent-orange); }

.result-stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* AI Analysis */
.ai-analysis {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.ai-analysis::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-cool);
}

.ai-analysis-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.ai-analysis-icon {
  font-size: 1.5rem;
}

.ai-analysis-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.ai-insight {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  font-size: 0.9rem;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.ai-insight.positive {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--accent-green);
}

.ai-insight.negative {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--accent-red);
}

.ai-insight.neutral {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--accent-blue);
}

.ai-insight.tip {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent-orange);
}

.ai-insight-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.results-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.results-action-btn {
  flex: 1;
  min-width: 140px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
  text-align: center;
}

.results-action-btn.primary {
  background: var(--gradient-primary);
  color: white;
}

.results-action-btn.secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
}

.results-action-btn:hover {
  transform: translateY(-2px);
}

/* ===== Analytics Page ===== */
.analytics-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.analytics-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.analytics-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.analytics-card-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.topic-performance {
  margin-bottom: 24px;
}

.topic-perf-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.topic-perf-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.topic-perf-item:last-child {
  border-bottom: none;
}

.topic-perf-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.topic-perf-info {
  flex: 1;
  min-width: 0;
}

.topic-perf-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.topic-perf-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.topic-perf-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease-out;
}

.topic-perf-bar-fill.good { background: var(--accent-green); }
.topic-perf-bar-fill.ok { background: var(--accent-orange); }
.topic-perf-bar-fill.bad { background: var(--accent-red); }

.topic-perf-percentage {
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  width: 45px;
  text-align: right;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 300px;
  margin: 0 auto 20px;
}

.empty-state-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-normal);
}

.empty-state-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ===== Settings Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-glass-strong);
}

.settings-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-label {
  font-weight: 600;
  margin-bottom: 4px;
}

.settings-item-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.reset-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  font-weight: 600;
  margin-top: 16px;
  transition: all var(--transition-fast);
}

.reset-btn:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* ===== Responsive ===== */

/* iPad */
@media (min-width: 768px) {
  .app-container {
    padding: 0 24px;
  }

  .topics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .results-stats {
    gap: 16px;
  }

  .analytics-overview {
    grid-template-columns: repeat(4, 1fr);
  }

  .quiz-setup {
    max-width: 560px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .topics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .progress-overview {
    padding: 32px;
  }

  .app-header {
    padding: 16px 24px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  html {
    font-size: 14px;
  }

  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .results-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .quiz-count-options {
    gap: 6px;
  }
}

/* ===== KaTeX Overrides ===== */
.katex {
  font-size: 1em;
}

.katex-display {
  margin: 8px 0;
}

/* ===== Loading State ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent-purple);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== Confetti Container ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
}

/* ===== Toast Notifications ===== */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 250;
  opacity: 0;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

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

/* Answer Review */
.review-answers {
  margin-bottom: 24px;
}

.review-answers-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.review-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 8px;
}

.review-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.review-item-num {
  font-weight: 700;
  font-size: 0.85rem;
}

.review-item-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.review-item-badge.correct {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.review-item-badge.wrong {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.review-item-badge.blank {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.review-item-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.review-item-answer {
  font-size: 0.85rem;
}

.review-item-explanation {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-left: 3px solid var(--accent-blue);
}

/* Standalone mode (PWA) */
@media (display-mode: standalone) {
  body {
    padding-top: calc(var(--safe-top) + 8px);
  }
}


.update-banner { background: var(--accent-cyan); color: #000; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 0.9rem; border-radius: 8px; margin: 10px 16px; box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); } .update-banner button { background: #000; color: #fff; border: none; padding: 6px 12px; border-radius: 4px; font-weight: bold; cursor: pointer; }


.booklet-container { display: flex; flex-direction: column; gap: 16px; padding: 10px 0; overflow-y: auto; max-height: calc(100vh - 200px); }
.booklet-section { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: all 0.3s ease; }
.booklet-section:hover { border-color: rgba(255,255,255,0.18); transform: translateY(-2px); }
.booklet-title { font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.booklet-content { color: var(--text-secondary); line-height: 1.75; font-size: 0.95rem; word-wrap: break-word; }
.booklet-content b, .booklet-content strong { color: var(--text-primary); font-weight: 600; }
.booklet-content svg { max-width: 100%; height: auto; display: block; margin: 12px auto; }
.booklet-formula { margin-top: 16px; background: rgba(0,0,0,0.3); padding: 14px; border-radius: 12px; color: var(--accent-cyan); text-align: center; overflow-x: auto; border: 1px solid rgba(6,182,212,0.15); }

/* Subject card hover effect */
.subject-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.subject-card:active { transform: translateY(-1px); }

/* ===== AI Generated Questions Notification Banner ===== */
.ai-generated-banner {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  animation: slideIn 0.4s ease;
}

.ai-gen-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.ai-gen-info .ai-gen-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.ai-gen-info .ai-gen-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* AI Question Generator Counter Card in Analytics */
.ai-gen-stat-card {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.ai-gen-stat-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.ai-gen-stat-info h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ai-gen-stat-info p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ===== Difficulty Breakdown Grid ===== */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.diff-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
}

.diff-card-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.diff-card-pct {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 2px;
}

.diff-card-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== Quiz History List ===== */
.quiz-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.quiz-history-item {
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-fast);
}

.quiz-history-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

.quiz-history-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-history-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
}

.quiz-history-badge.math {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.quiz-history-badge.physics {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.quiz-history-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quiz-history-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.quiz-history-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.quiz-history-net {
  font-size: 0.9rem;
  font-weight: 700;
}

.quiz-history-btn {
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-color);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quiz-history-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
}

/* ===== Retake Comparison Card ===== */
.retake-comparison-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
  animation: slideIn 0.4s ease;
}

.retake-comp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--accent-green);
  font-size: 1rem;
}

.retake-comp-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.retake-stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.retake-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.retake-stat-val {
  font-size: 1.3rem;
  font-weight: 800;
}

.retake-stat-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
}

.retake-comp-badge {
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-green);
  width: fit-content;
  margin: 0 auto 8px;
}

.retake-comp-badge.negative {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.retake-comp-desc {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
