@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700;800;900&display=swap');

/* ===== CSS RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0f5;
  --text-secondary: #a0a0b8;
  --text-muted: #6b6b80;
  --accent-tori: #f97316;
  --accent-tori-glow: rgba(249, 115, 22, 0.3);
  --accent-irodalom: #a855f7;
  --accent-irodalom-glow: rgba(168, 85, 247, 0.3);
  --accent-nyelvtan: #06b6d4;
  --accent-nyelvtan-glow: rgba(6, 182, 212, 0.3);
  --accent-matek: #22c55e;
  --accent-matek-glow: rgba(34, 197, 94, 0.3);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bg-gradient::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg-orb-1, rgba(249, 115, 22, 0.08)) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  animation: float 20s ease-in-out infinite;
}

.bg-gradient::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bg-orb-2, rgba(168, 85, 247, 0.06)) 0%, transparent 70%);
  bottom: -200px;
  left: -100px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(50px, -30px) scale(1.1);
  }

  50% {
    transform: translate(-20px, 40px) scale(0.95);
  }

  75% {
    transform: translate(30px, 20px) scale(1.05);
  }
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 20px 40px;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.navbar-brand span {
  background: linear-gradient(135deg, #f97316, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-links {
  display: flex;
  gap: 8px;
}

.navbar-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.navbar-links a:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.navbar-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

/* ===== HERO SECTION (INDEX) ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, #f97316, #ec4899, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 60px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

/* ===== SUBJECT CARDS GRID ===== */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 1100px;
  width: 100%;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.subject-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition);
  overflow: hidden;
  cursor: pointer;
}

.subject-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent);
  opacity: 0;
  transition: var(--transition);
}

.subject-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--card-glow) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}

.subject-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent);
  box-shadow: 0 20px 60px var(--card-glow);
}

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

.subject-card:hover::after {
  opacity: 1;
}

.subject-card>* {
  position: relative;
  z-index: 1;
}

.subject-card .card-icon {
  font-size: 2.5rem;
  margin-bottom: 20px;
  display: block;
}

.subject-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.subject-card .card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.subject-card .card-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--card-accent);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
}

/* Card accent colors */
.subject-card.tori {
  --card-accent: var(--accent-tori);
  --card-glow: var(--accent-tori-glow);
}

.subject-card.irodalom {
  --card-accent: var(--accent-irodalom);
  --card-glow: var(--accent-irodalom-glow);
}

.subject-card.nyelvtan {
  --card-accent: var(--accent-nyelvtan);
  --card-glow: var(--accent-nyelvtan-glow);
}

.subject-card.matek {
  --card-accent: var(--accent-matek);
  --card-glow: var(--accent-matek-glow);
}

/* ===== SECTION LABELS ===== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 64px;
  margin-bottom: 32px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  animation: fadeInUp 0.6s ease-out 0.25s both;
}

.section-label-icon {
  font-size: 1.2rem;
}

/* ===== FEATURE CARDS (HAMAROSAN) ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  max-width: 1100px;
  width: 100%;
  animation: fadeInUp 0.6s ease-out 0.4s both;
}

.feature-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: var(--transition);
  overflow: hidden;
  cursor: default;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(168, 85, 247, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(168, 85, 247, 0.3);
  box-shadow: 0 16px 48px rgba(168, 85, 247, 0.1);
}

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

.feature-card>* {
  position: relative;
  z-index: 1;
}

.feature-badge {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #a855f7;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.feature-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 16px;
  filter: grayscale(20%);
}

.feature-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Responsive features */
@media (max-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .feature-card {
    padding: 24px 16px;
  }

  .section-label {
    margin-top: 48px;
    margin-bottom: 24px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== TOPIC PAGE LAYOUT ===== */
.page-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 120px 40px 80px;
}

.page-header {
  margin-bottom: 48px;
  animation: fadeInUp 0.5s ease-out;
}

.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.page-header .breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.page-header .breadcrumb a:hover {
  color: var(--text-primary);
}

.page-header .breadcrumb .sep {
  color: var(--text-muted);
  opacity: 0.5;
}

.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 12px;
}

.page-header .subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* ===== TOPIC GROUPS ===== */
.topic-group {
  margin-bottom: 40px;
  animation: fadeInUp 0.5s ease-out;
}

.topic-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.topic-group-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tori-page .topic-group-number {
  background: var(--accent-tori-glow);
  color: var(--accent-tori);
}

.irodalom-page .topic-group-number {
  background: var(--accent-irodalom-glow);
  color: var(--accent-irodalom);
}

.nyelvtan-page .topic-group-number {
  background: var(--accent-nyelvtan-glow);
  color: var(--accent-nyelvtan);
}

.matek-page .topic-group-number {
  background: var(--accent-matek-glow);
  color: var(--accent-matek);
}

.topic-group-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

/* ===== TOPIC CARDS (details/summary) ===== */
.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.topic-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.topic-card[open] {
  border-color: rgba(255, 255, 255, 0.15);
  background: var(--bg-card-hover);
}

.topic-card summary {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  list-style: none;
  user-select: none;
  transition: var(--transition);
}

.topic-card summary::-webkit-details-marker {
  display: none;
}

.topic-card summary::marker {
  display: none;
  content: '';
}

.topic-card summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.topic-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.tori-page .topic-number {
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-tori);
}

.topic-summary-text {
  flex: 1;
}

.topic-theme {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.topic-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.topic-chevron {
  margin-top: 6px;
  flex-shrink: 0;
  transition: transform var(--transition);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.topic-card[open] .topic-chevron {
  transform: rotate(180deg);
}

/* ===== TOPIC CONTENT ===== */
.topic-content {
  padding: 0 24px 24px;
  padding-left: 72px;
  animation: slideDown 0.3s ease-out;
}

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

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

.topic-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 20px 0 10px;
}

.topic-content h3:first-child {
  margin-top: 0;
}

.topic-content p {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.topic-content ul {
  list-style: none;
  margin-bottom: 16px;
}

.topic-content ul li {
  position: relative;
  padding-left: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 4px;
}

.topic-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tori-page .topic-content ul li::before {
  background: var(--accent-tori);
}

.topic-content .highlight-box {
  background: rgba(249, 115, 22, 0.08);
  border-left: 3px solid var(--accent-tori);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 16px 0;
}

.topic-content .highlight-box p {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 0;
}

.topic-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.topic-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 16px 0;
  border: none;
}

/* ===== COMING SOON PAGE ===== */
.coming-soon {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.coming-soon .icon {
  font-size: 4rem;
  margin-bottom: 24px;
  opacity: 0.6;
}

.coming-soon h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.coming-soon p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 400px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 12px 28px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}

.back-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .navbar {
    padding: 16px 20px;
  }

  .navbar-links {
    gap: 4px;
  }

  .navbar-links a {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .hero {
    padding: 100px 20px 40px;
  }

  .subject-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .subject-card {
    padding: 28px 24px;
  }

  .page-wrapper {
    padding: 100px 20px 60px;
  }

  .topic-content {
    padding-left: 24px;
  }

  .topic-card summary {
    padding: 16px 18px;
  }
}

@media (max-width: 480px) {
  .navbar-brand {
    font-size: 1.2rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .page-header h1 {
    font-size: 1.75rem;
  }
}

/* ===== SCROLL PROGRESS (top bar) ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  z-index: 200;
  transition: width 0.1s linear;
}

/* ===== QUIZ BUTTON ===== */
.quiz-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent-tori), #ec4899);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
}

.quiz-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.quiz-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.35);
}

.quiz-btn:hover::before {
  transform: translateX(100%);
}

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

.quiz-btn .btn-icon {
  font-size: 1.1rem;
}

/* ===== QUIZ MODAL ===== */
.quiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px;
}

.quiz-overlay.active {
  opacity: 1;
  visibility: visible;
}

.quiz-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.quiz-overlay.active .quiz-modal {
  transform: scale(1) translateY(0);
}

.quiz-modal::-webkit-scrollbar {
  width: 6px;
}

.quiz-modal::-webkit-scrollbar-track {
  background: transparent;
}

.quiz-modal::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

.quiz-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.quiz-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Quiz Header */
.quiz-header {
  margin-bottom: 32px;
}

.quiz-header .quiz-topic-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-tori);
  background: var(--accent-tori-glow);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.quiz-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.quiz-header .quiz-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Progress Bar */
.quiz-progress {
  margin-bottom: 32px;
}

.quiz-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quiz-progress-info .current-q {
  font-weight: 600;
  color: var(--text-primary);
}

.quiz-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 100px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-tori), #ec4899);
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* Question */
.quiz-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Answer Options */
.quiz-answers {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.quiz-answer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', sans-serif;
  font-size: 0.925rem;
  color: var(--text-secondary);
  text-align: left;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.quiz-answer::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.quiz-answer:hover:not(.disabled) {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.quiz-answer .answer-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}

.quiz-answer:hover:not(.disabled) .answer-letter {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.quiz-answer .answer-text {
  flex: 1;
  line-height: 1.5;
}

/* Answer States */
.quiz-answer.selected {
  border-color: var(--accent-tori);
  background: rgba(249, 115, 22, 0.08);
  color: var(--text-primary);
}

.quiz-answer.selected .answer-letter {
  background: var(--accent-tori);
  color: #fff;
}

.quiz-answer.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: var(--text-primary);
}

.quiz-answer.correct .answer-letter {
  background: #22c55e;
  color: #fff;
}

.quiz-answer.correct::after {
  content: '✓';
  position: absolute;
  right: 20px;
  font-size: 1.2rem;
  color: #22c55e;
  font-weight: 700;
}

.quiz-answer.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: var(--text-primary);
}

.quiz-answer.wrong .answer-letter {
  background: #ef4444;
  color: #fff;
}

.quiz-answer.wrong::after {
  content: '✗';
  position: absolute;
  right: 20px;
  font-size: 1.2rem;
  color: #ef4444;
  font-weight: 700;
}

.quiz-answer.disabled {
  cursor: default;
  opacity: 0.5;
}

.quiz-answer.disabled.correct,
.quiz-answer.disabled.wrong,
.quiz-answer.disabled.selected {
  opacity: 1;
}

/* Explanation box */
.quiz-explanation {
  background: rgba(249, 115, 22, 0.06);
  border-left: 3px solid var(--accent-tori);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  animation: slideDown 0.3s ease-out;
  display: none;
}

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

.quiz-explanation strong {
  color: var(--text-primary);
}

/* Next Button */
.quiz-next-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--accent-tori), #ec4899);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
}

.quiz-next-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.quiz-next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.3);
}

/* ===== QUIZ RESULTS ===== */
.quiz-results {
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}

.quiz-results .result-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  display: block;
}

.quiz-results h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.quiz-results .result-score {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-tori), #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  line-height: 1.2;
}

.quiz-results .result-text {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-results .result-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 32px;
}

.quiz-results .stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px 28px;
  min-width: 120px;
}

.quiz-results .stat-card .stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.quiz-results .stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quiz-results .stat-card.correct-stat .stat-value {
  color: #22c55e;
}

.quiz-results .stat-card.wrong-stat .stat-value {
  color: #ef4444;
}

.quiz-results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.quiz-retry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent-tori), #ec4899);
  border: none;
  border-radius: 100px;
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.quiz-retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(249, 115, 22, 0.3);
}

.quiz-close-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.quiz-close-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ===== QUIZ RESPONSIVE ===== */
@media (max-width: 768px) {
  .quiz-modal {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
    max-height: 95vh;
  }

  .quiz-header h2 {
    font-size: 1.3rem;
  }

  .quiz-question {
    font-size: 1rem;
  }

  .quiz-answer {
    padding: 14px 16px;
  }

  .quiz-results .result-stats {
    flex-direction: column;
    align-items: center;
  }

  .quiz-results .stat-card {
    width: 100%;
    max-width: 200px;
  }

  .quiz-results .result-score {
    font-size: 2.5rem;
  }
}

.tori-page .scroll-progress {
  background: linear-gradient(90deg, var(--accent-tori), #ec4899);
}

/* ===== ACTIVE FEATURE CARDS ===== */
a.feature-card {
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
}

.feature-card.feature-active {
  border-color: rgba(34, 197, 94, 0.2);
}

.feature-card.feature-active:hover {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 16px 48px rgba(34, 197, 94, 0.1);
}

.feature-card.feature-active::before {
  background: radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.06) 0%, transparent 60%) !important;
}

.feature-badge-live {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(6, 182, 212, 0.15)) !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
  color: #22c55e !important;
}

/* ===== NOTES SYSTEM ===== */
.note-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

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

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

.note-saved {
  font-size: 0.75rem;
  font-weight: 600;
  color: #22c55e;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.note-saved.visible {
  opacity: 1;
}

.note-textarea {
  width: 100%;
  min-height: 80px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  line-height: 1.7;
  resize: vertical;
  transition: var(--transition);
  outline: none;
}

.note-textarea::placeholder {
  color: var(--text-muted);
}

.note-textarea:focus {
  border-color: var(--accent-tori);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

/* ===== FLASHCARD TOPIC SELECTOR ===== */
.flashcard-topic-selector {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-width: 700px;
}

.fc-topic-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

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

.fc-topic-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-tori);
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.fc-topic-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.fc-topic-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  flex-shrink: 0;
}

/* ===== FLASHCARD ===== */
.flashcard-container {
  max-width: 600px;
}

.flashcard-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.flashcard-wrapper {
  perspective: 1000px;
  cursor: pointer;
  margin-bottom: 24px;
}

.flashcard {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard.flipped {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 280px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.flashcard-front {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(236, 72, 153, 0.05));
  border-color: rgba(249, 115, 22, 0.2);
}

.flashcard-back {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(6, 182, 212, 0.05));
  border-color: rgba(34, 197, 94, 0.2);
  transform: rotateY(180deg);
}

.fc-side-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 20px;
  padding: 4px 14px;
  border-radius: 100px;
}

.flashcard-front .fc-side-label {
  color: var(--accent-tori);
  background: rgba(249, 115, 22, 0.1);
}

.flashcard-back .fc-side-label {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.fc-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text-primary);
}

.flashcard-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.fc-btn {
  padding: 12px 24px;
  border-radius: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-primary);
}

.fc-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.fc-shuffle {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.15));
  border-color: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

.fc-shuffle:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.25)) !important;
}

.fc-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.fc-back-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ===== PROGRESS TRACKER ===== */
.progress-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.overview-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  transition: var(--transition);
}

.overview-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.overview-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.overview-value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.overview-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Overall progress bar */
.overall-progress-section {
  margin-bottom: 40px;
}

.overall-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.overall-progress-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.overall-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-tori), #ec4899, #a855f7);
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Topic progress cards */
.progress-topics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
  gap: 16px;
}

.progress-topic-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.progress-topic-card.perfect {
  border-left: 3px solid #22c55e;
}

.progress-topic-card.good {
  border-left: 3px solid var(--accent-tori);
}

.progress-topic-card.started {
  border-left: 3px solid #eab308;
}

.pt-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.pt-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-tori);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.pt-info {
  min-width: 0;
}

.pt-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pt-note-badge {
  font-size: 0.75rem;
}

.pt-stats {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.pt-stats strong {
  color: var(--text-secondary);
}

.pt-not-started {
  color: var(--text-muted);
  font-style: italic;
}

.pt-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pt-status-icon {
  font-size: 1.2rem;
}

.pt-bar {
  width: 80px;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.pt-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-tori), #ec4899);
  border-radius: 100px;
  transition: width 0.6s ease;
}

/* Notes summary */
.notes-summary-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border);
}

.notes-summary-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.notes-summary-item {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}

.notes-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.notes-item-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(249, 115, 22, 0.15);
  color: var(--accent-tori);
  font-size: 0.75rem;
  font-weight: 700;
}

.notes-item-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Progress reset */
.progress-reset-section {
  margin-top: 40px;
  text-align: center;
}

.progress-reset-btn {
  padding: 10px 24px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 100px;
  color: #ef4444;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.progress-reset-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

/* ===== RESPONSIVE: NEW FEATURES ===== */
@media (max-width: 768px) {

  .flashcard-front,
  .flashcard-back {
    min-height: 220px;
    padding: 32px 24px;
  }

  .flashcard {
    min-height: 220px;
  }

  .fc-text {
    font-size: 1rem;
  }

  .flashcard-controls {
    flex-wrap: wrap;
  }

  .fc-btn {
    padding: 10px 18px;
    font-size: 0.8rem;
  }

  .progress-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .overview-card {
    padding: 18px 12px;
  }

  .overview-value {
    font-size: 1.5rem;
  }

  .pt-bar {
    width: 50px;
  }

  .pt-title {
    max-width: 200px;
  }

  .progress-topic-card {
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .progress-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .overview-value {
    font-size: 1.3rem;
  }

  .pt-right {
    gap: 8px;
  }

  .pt-bar {
    width: 40px;
  }

  .flashcard-front,
  .flashcard-back {
    min-height: 200px;
    padding: 24px 20px;
  }

  .flashcard {
    min-height: 200px;
  }
}