/* Design System - AUC-60 MCQs BOYS */
:root {
  --font-arabic: 'Cairo', sans-serif;
  --font-english: 'Inter', 'Outfit', sans-serif;
  
  /* Color Palette - Premium Sleek Dark Mode */
  --bg-primary: #0a0f1d;
  --bg-secondary: #121829;
  --bg-card: rgba(22, 30, 53, 0.65);
  --bg-card-hover: rgba(30, 41, 73, 0.8);
  
  --accent-primary: #3b82f6;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --accent-glow: rgba(59, 130, 246, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-wrong: #ef4444;
  --color-wrong-bg: rgba(239, 68, 68, 0.15);
  
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & document settings */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-arabic);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

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

/* Animated Background Orbs */
.bg-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: float 25s infinite alternate ease-in-out;
}

.orb-1 {
  top: -10%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--accent-primary);
  animation-duration: 20s;
}

.orb-2 {
  bottom: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: var(--accent-secondary);
  animation-duration: 28s;
}

.orb-3 {
  top: 40%;
  left: 30%;
  width: 35vw;
  height: 35vw;
  background: var(--color-success);
  animation-duration: 24s;
  opacity: 0.08;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, -50px) scale(1.1); }
  100% { transform: translate(-30px, 40px) scale(0.9); }
}

/* Noise overlay */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  z-index: -1;
  pointer-events: none;
}

/* Prayer Banner */
.prayer-banner {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
}

.prayer-text {
  font-family: var(--font-arabic);
}

/* App Screens */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  min-height: calc(100vh - 40px);
  padding: 40px 20px;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Container limits */
.container {
  max-width: 960px;
  margin: 0 auto;
}

/* SETUP SCREEN */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.main-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 10px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.title-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 40px;
  font-weight: 500;
}

/* Setup Grid */
.setup-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

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

.setup-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 5px;
}

.column-icon {
  font-size: 1.5rem;
}

.section-heading {
  font-size: 1.3rem;
  font-weight: 700;
}

/* Category Checkbox Cards */
.sections-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-primary);
  opacity: 0;
  transition: var(--transition-smooth);
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.category-card.selected {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.15);
}

.category-card.selected::before {
  opacity: 1;
}

.category-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
}

.category-name {
  font-size: 1.15rem;
  font-weight: 700;
}

.category-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.checkbox-custom {
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-muted);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.category-card.selected .checkbox-custom {
  border-color: var(--accent-primary);
  background: var(--accent-primary);
}

.checkbox-custom::after {
  content: '✓';
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: var(--transition-smooth);
}

.category-card.selected .checkbox-custom::after {
  opacity: 1;
  transform: scale(1);
}

/* Settings Card */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-label {
  font-size: 1.05rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
}

.radio-option:hover {
  background: rgba(255, 255, 255, 0.03);
}

.radio-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: right;
  flex-grow: 1;
  padding-right: 12px;
}

.radio-label strong {
  font-size: 0.95rem;
}

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

.radio-option input {
  display: none;
}

.radio-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  position: relative;
  transition: var(--transition-smooth);
}

.radio-option input:checked + .radio-custom {
  border-color: var(--accent-primary);
}

.radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--accent-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: var(--transition-smooth);
}

.radio-option input:checked + .radio-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Total Counter Card */
.total-counter {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
  border: 1px dashed rgba(59, 130, 246, 0.3);
  padding: 20px;
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.counter-label {
  font-weight: 700;
  font-size: 1.05rem;
}

.counter-number {
  font-family: var(--font-english);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-primary);
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* Buttons */
.btn-start {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  padding: 20px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.3);
}

.btn-start:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(59, 130, 246, 0.45);
}

.btn-start:active {
  transform: translateY(-1px);
}

.btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-25deg);
  animation: shine 4s infinite linear;
}

@keyframes shine {
  0% { left: -100%; }
  35% { left: 150%; }
  100% { left: 150%; }
}

/* QUIZ SCREEN */
.quiz-container {
  max-width: 800px;
}

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

.quiz-meta {
  display: flex;
  gap: 12px;
}

.meta-badge {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.section-badge {
  color: var(--accent-primary);
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.number-badge {
  font-family: var(--font-arabic);
}

.number-badge strong {
  font-family: var(--font-english);
  font-size: 1rem;
}

.quiz-score-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 6px 18px;
  border-radius: 100px;
  font-family: var(--font-english);
  font-weight: 800;
  font-size: 1.05rem;
}

.score-correct { color: var(--color-success); }
.score-divider { color: var(--text-muted); }
.score-wrong { color: var(--color-wrong); }

/* Progress bar */
.progress-bar-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 35px;
}

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

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 100px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-info strong {
  font-family: var(--font-english);
  color: var(--text-primary);
}

/* Question Container */
.question-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 40px;
  border-radius: var(--border-radius-lg);
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(15px);
}

@media (max-width: 600px) {
  .question-container {
    padding: 25px;
  }
}

.question-text {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 35px;
  line-height: 1.5;
  font-family: var(--font-english);
  text-align: left; /* English MCQ texts usually look better LTR */
}

/* Options */
.options-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 18px 24px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-english);
  transition: var(--transition-smooth);
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color-hover);
  transform: translateX(4px);
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  font-family: var(--font-english);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-primary);
  flex-shrink: 0;
  transition: var(--transition-smooth);
}

.option-btn:hover .option-letter {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-primary);
}

/* States: Correct/Incorrect */
.option-btn.correct {
  background: var(--color-success-bg) !important;
  border-color: var(--color-success) !important;
}

.option-btn.correct .option-letter {
  background: var(--color-success) !important;
  border-color: var(--color-success) !important;
  color: var(--text-primary) !important;
}

.option-btn.wrong {
  background: var(--color-wrong-bg) !important;
  border-color: var(--color-wrong) !important;
  opacity: 0.8;
}

.option-btn.wrong .option-letter {
  background: var(--color-wrong) !important;
  border-color: var(--color-wrong) !important;
  color: var(--text-primary) !important;
}

.option-btn.disabled {
  pointer-events: none;
}

.option-btn.correct-reveal {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.5);
}

.option-btn.correct-reveal .option-letter {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--color-success);
}

/* Navigation Row */
.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.btn-nav {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 16px;
  border-radius: var(--border-radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition-smooth);
}

.btn-nav:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-color-hover);
}

.btn-next {
  background: var(--accent-gradient);
  border: none;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.btn-next:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.btn-finish {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-wrong);
  padding: 16px 24px;
  border-radius: var(--border-radius-md);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.btn-finish:hover {
  background: var(--color-wrong);
  color: var(--text-primary);
  border-color: var(--color-wrong);
}

/* RESULTS SCREEN */
.results-header {
  text-align: center;
  margin-bottom: 40px;
}

.trophy-icon {
  font-size: 4rem;
  margin-bottom: 15px;
  animation: bounce 2s infinite alternate ease-in-out;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.results-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.results-subtitle {
  color: var(--text-secondary);
}

/* Circular Score Ring */
.score-ring-container {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.score-ring {
  position: relative;
  width: 200px;
  height: 200px;
}

.score-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: url(#ring-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score-big {
  font-family: var(--font-english);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-primary);
}

.score-pct {
  font-family: var(--font-english);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Results Breakdown Cards */
.results-breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.result-card .result-icon {
  font-size: 1.6rem;
}

.result-number {
  font-family: var(--font-english);
  font-size: 2rem;
  font-weight: 900;
}

.result-card.result-correct .result-number { color: var(--color-success); }
.result-card.result-wrong .result-number { color: var(--color-wrong); }

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

/* Action Buttons */
.results-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-action-primary {
  width: 100%;
  background: var(--accent-gradient);
  border: none;
  padding: 18px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-action-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

.btn-action-secondary {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-hover);
}
