:root {
  --bg-primary: #070d1a;
  --bg-secondary: #0e1628;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.16);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --accent-gold: #f59e0b;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #f59e0b, #ef4444);
  --gradient-blue: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-green: linear-gradient(135deg, #10b981, #3b82f6);
  --glow-gold: 0 0 30px rgba(245, 158, 11, 0.25);
  --glow-blue: 0 0 30px rgba(59, 130, 246, 0.25);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 13, 26, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 15px 0;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
  width: 100%;
}

.lang-switcher {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 4px;
  border: 1px solid var(--border);
}

.lang-switcher button {
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
}

.lang-switcher button.active {
  background: var(--gradient-blue);
  color: white;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}

.nav-hamburger {
  display: none;
  font-size: 1.5rem;
  background: transparent;
  color: var(--text-primary);
}

/* Hero Section */
.hero {
  padding: 100px 0 60px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.5;
  animation: float 10s infinite ease-in-out;
}

.orb-1 {
  width: 300px;
  height: 300px;
  background: var(--accent-gold);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 250px;
  height: 250px;
  background: var(--accent-purple);
  bottom: -50px;
  right: -50px;
  animation-delay: -3s;
}

.orb-3 {
  width: 200px;
  height: 200px;
  background: var(--accent-blue);
  top: 40%;
  left: 60%;
  animation-delay: -6s;
}

.hero-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-gold);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 24px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  animation: fadeInUp 0.8s forwards;
}

.hero-title {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.8s 0.1s forwards opacity 0;
  opacity: 0;
}

.hero-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 30px;
  animation: fadeInUp 0.8s 0.2s forwards opacity 0;
  opacity: 0;
}

.hero-date {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
  animation: fadeInUp 0.8s 0.3s forwards opacity 0;
  opacity: 0;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

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

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-daily { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-weekly { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-monthly { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); border: 1px solid rgba(139, 92, 246, 0.3); }

.badge-topic {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  text-align: center;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--glow-gold);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.4);
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-hover);
}
.btn-secondary:hover {
  background: var(--border-hover);
}

/* Featured Section */
.featured-section {
  margin-top: -30px;
  z-index: 10;
  position: relative;
}

.featured-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5), inset 0 0 20px rgba(245, 158, 11, 0.05);
}
.featured-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 10px 40px rgba(0,0,0,0.6), inset 0 0 30px rgba(245, 158, 11, 0.1);
}
.fc-content h2 { font-size: 2rem; margin: 10px 0; }
.fc-content p { color: var(--text-secondary); margin-bottom: 20px; }

/* Stats Row */
.stats-section { padding: 60px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat-card {
  text-align: center;
  padding: 30px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.stat-num { font-size: 2.5rem; font-weight: 800; color: var(--accent-blue); margin-bottom: 8px; }
.stat-label { color: var(--text-secondary); font-weight: 500; }

/* Quizzes Tabs & Grid */
.quizzes-section { padding: 40px 0 80px; }
.section-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  justify-content: center;
}
.tab-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  transition: var(--transition);
}
.tab-btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.tab-btn.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--accent-blue);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.quiz-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.quiz-card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 8px; }
.quiz-card-meta { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 16px; display: flex; gap: 10px;}
.quiz-card-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; flex-grow: 1; }

/* Quiz Main & Mode Select */
.quiz-main { padding: 60px 0; flex-grow: 1; }
.quiz-wrapper { max-width: 800px; margin: 0 auto; }
.mode-select-screen { text-align: center; animation: fadeInUp 0.5s; }
.mode-select-screen h2 { font-size: 2.5rem; margin-bottom: 40px; }
.mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.mode-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 30px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.mode-quiz:hover { border-color: var(--accent-gold); box-shadow: var(--glow-gold); transform: scale(1.05); }
.mode-mock:hover { border-color: var(--accent-blue); box-shadow: var(--glow-blue); transform: scale(1.05); }
.mode-icon { font-size: 4rem; margin-bottom: 20px; }
.mode-card h3 { font-size: 1.75rem; margin-bottom: 12px; }
.mode-card p { color: var(--text-secondary); margin-bottom: 24px; min-height: 48px; }

/* Active Quiz Interface */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.quiz-progress-container {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 40px;
}
.quiz-progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.4s ease;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  margin-bottom: 30px;
  animation: slideIn 0.4s;
}
.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 30px;
  line-height: 1.4;
}

.options-list { display: flex; flex-direction: column; gap: 16px; }
.option-btn {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: var(--transition);
}
.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
}
.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border-radius: 50%;
  margin-right: 16px;
  font-weight: 700;
  color: var(--text-muted);
  transition: var(--transition);
}
.option-btn:hover:not(:disabled) .option-letter {
  color: var(--text-primary);
  background: var(--border-hover);
}

.option-btn.option-correct {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-green);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}
.option-btn.option-correct .option-letter {
  background: var(--accent-green);
  color: white;
}
.option-btn.option-wrong {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--accent-red);
}
.option-btn.option-wrong .option-letter {
  background: var(--accent-red);
  color: white;
}
.option-btn:disabled { cursor: default; }

.explanation-panel {
  background: rgba(245, 158, 11, 0.05);
  border-left: 4px solid var(--accent-gold);
  padding: 24px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-top: 30px;
  display: none;
  animation: slideIn 0.4s;
}
.explanation-panel.show { display: block; }
.explanation-title {
  color: var(--accent-gold);
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 30px;
}
.next-btn { display: none; }
.next-btn.show { display: inline-flex; animation: slideIn 0.3s; }

/* Results Screen */
.results-screen { text-align: center; animation: fadeInUp 0.6s; }
.score-circle-container {
  width: 200px;
  height: 200px;
  margin: 0 auto 30px;
  position: relative;
}
.score-circle {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.score-circle-bg {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 12;
}
.score-circle-progress {
  fill: none;
  stroke: var(--accent-blue);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 251;
  stroke-dashoffset: 251;
  /* animated via JS setting style */
}
.score-text-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-text { font-size: 3rem; font-weight: 800; color: var(--text-primary); line-height: 1; }
.score-total { color: var(--text-secondary); font-size: 1.2rem; }
.score-message { font-size: 1.5rem; font-weight: 700; margin-bottom: 10px; }
.score-submessage { color: var(--text-secondary); margin-bottom: 40px; }

.results-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
}

/* Loading */
.loading-screen {
  text-align: center;
  padding: 60px 0;
}
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Archive Page */
.archive-main { padding: 40px 0 80px; }
.archive-header { margin-bottom: 40px; text-align: center; }
.archive-header h1 { font-size: 3rem; margin-bottom: 10px; }
.archive-subtitle { color: var(--text-secondary); font-size: 1.2rem; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 40px;
  align-items: center;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.filter-select {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}
.topic-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.topic-chip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}
.topic-chip:hover, .topic-chip.active {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

/* Animations */
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-15px)} }
@keyframes pulse-glow { 0%,100%{box-shadow:0 0 15px rgba(245,158,11,0.2)} 50%{box-shadow:0 0 30px rgba(245,158,11,0.5)} }
@keyframes fadeInUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideIn { from{opacity:0;transform:translateX(-10px)} to{opacity:1;transform:translateX(0)} }
@keyframes scoreCount { from{stroke-dashoffset:251} to{stroke-dashoffset:var(--target-offset)} }
@keyframes shimmer { 0%{background-position:-200%} 100%{background-position:200%} }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-secondary) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 30px 0;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .mode-cards { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.show { display: flex; }
  .nav-hamburger { display: block; }
  .featured-card { flex-direction: column; text-align: center; gap: 20px; }
  .quiz-grid { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: 1fr; }
  .results-actions { flex-direction: column; }
}
