/* Design System - Violet et Or Mode Sombre */
:root {
  /* Base colors in HSL */
  --background: 224 71% 4%;
  --foreground: 213 31% 91%;
  --muted: 223 47% 11%;
  --muted-foreground: 215 20% 65%;
  --card: 224 71% 4%;
  --card-foreground: 213 31% 91%;
  --popover: 224 71% 4%;
  --popover-foreground: 215 20% 65%;
  --border: 216 34% 17%;
  --input: 216 34% 17%;
  --primary: 263 70% 50%;
  --primary-foreground: 210 20% 98%;
  --secondary: 216 34% 17%;
  --secondary-foreground: 210 20% 98%;
  --accent: 45 93% 58%;
  --accent-foreground: 222 47% 11%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 210 20% 98%;
  --ring: 263 70% 50%;
  --radius: 0.5rem;

  /* Custom design tokens */
  --primary-glow: 263 85% 70%;
  --accent-glow: 45 100% 75%;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(var(--accent)), hsl(var(--accent-glow)));
  --gradient-card: linear-gradient(145deg, hsl(var(--card)) 0%, hsl(var(--muted)) 100%);
  --gradient-glow: radial-gradient(circle, hsl(var(--primary)) 0%, hsl(var(--primary-glow)) 70%);
  
  /* Shadows */
  --shadow-elegant: 0 10px 30px -10px hsl(var(--primary) / 0.3);
  --shadow-glow: 0 0 40px hsl(var(--primary-glow) / 0.4);
  
  /* Transitions */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.6;
}

/* Typography */
.font-arabic {
  font-family: "Amiri", "Times New Roman", "Arial Unicode MS", serif;
  direction: rtl;
}

.arabic-main {
  font-size: 3.125rem; /* 50px */
  line-height: 1.4;
}

.arabic-choice {
  font-size: 2.5rem; /* 40px */
  line-height: 1.4;
}

/* Gradient Classes */
.gradient-primary {
  background: var(--gradient-primary);
}

.gradient-card {
  background: var(--gradient-card);
  border: 1px solid hsl(var(--border));
}

.gradient-glow {
  background: var(--gradient-glow);
}

.bg-clip-text {
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Utility Classes */
.text-accent { color: hsl(var(--accent)); }
.text-primary { color: hsl(var(--primary)); }
.text-foreground { color: hsl(var(--foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }

.border-primary { border-color: hsl(var(--primary)); }
.border-accent { border-color: hsl(var(--accent)); }

.bg-primary\/10 { background-color: hsl(var(--primary) / 0.1); }
.bg-primary\/20 { background-color: hsl(var(--primary) / 0.2); }
.bg-accent\/10 { background-color: hsl(var(--accent) / 0.1); }
.bg-muted\/30 { background-color: hsl(var(--muted) / 0.3); }

/* Layout Classes */
.min-h-screen { min-height: 100vh; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.w-full { width: 100%; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-6 > * + * { margin-left: 1.5rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-1 { margin-top: 0.25rem; }

.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-full { border-radius: 9999px; }

.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Text sizes */
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.leading-relaxed { line-height: 1.625; }

/* Quiz Options Styling */
.quiz-options {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 32px auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-label {
    color: hsl(var(--accent));
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
}

.option-select {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--accent) / 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    color: hsl(var(--foreground));
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    z-index: 10;
}

.option-select:hover {
    border-color: hsl(var(--accent) / 0.5);
    background: hsl(var(--accent) / 0.08);
}

.option-select:focus {
    outline: none;
    border-color: hsl(var(--accent));
    box-shadow: 0 0 0 3px hsl(var(--accent) / 0.2);
}

.option-select option {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    border: none;
}

/* Interactive elements */
button {
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.choice-button {
  width: 100%;
  padding: 1rem;
  text-align: left;
  border: 1px solid hsl(var(--primary) / 0.3);
  background: transparent;
  color: hsl(var(--foreground));
  border-radius: 0.5rem;
  transition: var(--transition-smooth);
}

.choice-button:hover:not(:disabled) {
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.5);
}

.choice-button.correct {
  background: hsl(142 76% 36% / 0.2);
  border-color: hsl(142 76% 36% / 0.5);
  color: hsl(142 85% 85%);
}

.choice-button.incorrect {
  background: hsl(0 63% 31% / 0.2);
  border-color: hsl(0 63% 31% / 0.5);
  color: hsl(0 86% 90%);
}

.choice-button.disabled {
  opacity: 0.5;
  border-color: hsl(var(--muted));
}

.choice-content {
  display: flex;
  align-items: flex-start;
  width: 100%;
  gap: 0.75rem;
}

.choice-letter {
  color: hsl(var(--accent));
  font-weight: 500;
  margin-top: 0.25rem;
  min-width: 1.5rem;
}

.choice-text {
  flex: 1;
  line-height: 1.4;
  font-family: "Amiri", "Times New Roman", "Arial Unicode MS", serif;
  direction: rtl;
  text-align: right;
}

.choice-icon {
  margin-left: 0.5rem;
  width: 1.25rem;
  height: 1.25rem;
}

.hidden { display: none !important; }

.transition-opacity { transition-property: opacity; }
.transition-colors { transition-property: color, background-color, border-color; }
.transition-all { transition-property: all; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }
.ease-out { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); }

.hover\:opacity-90:hover { opacity: 0.9; }
.hover\:bg-primary\/10:hover { background-color: hsl(var(--primary) / 0.1); }

/* Back Button */
.back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: hsl(var(--accent));
  background: transparent;
  border: 1px solid hsl(var(--accent) / 0.3);
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: var(--transition-smooth);
  font-size: 0.875rem;
}

.back-button:hover {
  background: hsl(var(--accent) / 0.1);
  border-color: hsl(var(--accent) / 0.5);
}

/* Mobile Header */
.mobile-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .max-w-2xl, .max-w-4xl {
    max-width: 100%;
  }
  
  .arabic-main {
    font-size: 2rem; /* 32px pour mobile */
  }
  
  .arabic-choice {
    font-size: 1.75rem; /* 28px pour mobile */
  }
  
  .mobile-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .mobile-header > * {
    text-align: center;
  }
  
  .choice-button {
    padding: 0.75rem;
  }
  
  .quiz-options {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .arabic-main {
    font-size: 1.75rem; /* 28px pour très petit mobile */
  }
  
  .arabic-choice {
    font-size: 1.5rem; /* 24px pour très petit mobile */
  }
  
  .p-4 {
    padding: 0.75rem;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .arabic-main {
    font-size: 2.75rem; /* 44px pour tablette */
  }
  
  .arabic-choice {
    font-size: 2.25rem; /* 36px pour tablette */
  }
}


        /* Floating Home Button */
.home-btn {
  position: fixed;
  left: 24px;
  bottom: 40px;
  width: 50px;
  height: 50px;
  background: rgb(104, 2, 104);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-smooth);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px hsl(var(--primary) / 0.5);
}