/* Styles spécifiques aux composants */

/* Header / Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--primary-indigo);
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  overflow: hidden;
  padding: 4rem 0 6rem;
  text-align: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.4;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--glass-bg);
  border: 1px solid var(--border-primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 48rem;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Quiz Interface */
.quiz-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.quiz-header {
  text-align: center;
  margin-bottom: 2rem;
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.quiz-progress-bar {
  width: 100%;
  height: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
  overflow: hidden;
  margin: 1rem 0;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-indigo), var(--primary-cyan));
  transition: width 0.3s ease;
}

.quiz-timer {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-cyan);
  text-align: center;
  margin-bottom: 1rem;
}

.quiz-timer.warning {
  color: #f59e0b;
  animation: pulse 1s infinite;
}

.quiz-timer.danger {
  color: #ef4444;
  animation: pulse 0.5s infinite;
}

.question-card {
  background: var(--glass-bg);
  border-radius: 1.5rem;
  padding: 2rem;
  border: 1px solid var(--border-light);
  margin-bottom: 2rem;
}

.question-text {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  text-align: center;
}

.question-media {
  text-align: center;
  margin-bottom: 1.5rem;
}

.question-audio {
  width: 100%;
  max-width: 400px;
}

.choices-container {
  display: grid;
  gap: 1rem;
}

.choice-button {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--border-light);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-fast);
}

.choice-button:hover {
  border-color: var(--primary-indigo);
  background: rgba(99, 102, 241, 0.1);
}

.choice-button.selected {
  border-color: var(--primary-indigo);
  background: rgba(99, 102, 241, 0.2);
}

.choice-button.correct {
  border-color: var(--primary-emerald);
  background: rgba(16, 185, 129, 0.2);
}

.choice-button.incorrect {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.choice-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Leaderboard */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--glass-bg);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-table th {
  background: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-rank {
  font-weight: 800;
  font-size: 1.125rem;
}

.leaderboard-rank.top-1 { color: var(--gold); }
.leaderboard-rank.top-2 { color: var(--silver); }
.leaderboard-rank.top-3 { color: var(--bronze); }

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.leaderboard-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--primary-indigo);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: white;
}

.leaderboard-score {
  font-weight: 600;
  color: var(--primary-cyan);
}

/* Points et Catalogue */
.points-wallet {
  background: var(--glass-bg);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  text-align: center;
}

.points-balance {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-cyan);
  margin-bottom: 0.5rem;
}

.points-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.catalog-item {
  background: var(--glass-bg);
  border-radius: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-light);
  text-align: center;
  transition: var(--transition-fast);
}

.catalog-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-primary);
}

.catalog-item-image {
  width: 100%;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  margin-bottom: 1rem;
  display: grid;
  place-items: center;
  font-size: 3rem;
}

.catalog-item-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.catalog-item-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-cyan);
  margin-bottom: 1rem;
}

/* League Badge */
.league-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.league-badge.bronze {
  background: linear-gradient(135deg, var(--bronze), #b8691a);
  color: white;
}

.league-badge.silver {
  background: linear-gradient(135deg, var(--silver), #a0a0a0);
  color: #1f2937;
}

.league-badge.gold {
  background: linear-gradient(135deg, var(--gold), #e6c200);
  color: #1f2937;
}

.league-badge.platinum {
  background: linear-gradient(135deg, var(--platinum), #c5c4c2);
  color: #1f2937;
}

/* Notifications */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 50;
  max-width: 400px;
  animation: fadeIn 0.3s ease-out;
}

.notification.success {
  border-color: var(--primary-emerald);
}

.notification.error {
  border-color: #ef4444;
}

.notification.info {
  border-color: var(--primary-indigo);
}

/* Loading States */
.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--border-light);
  border-top: 2px solid var(--primary-indigo);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0.05) 25%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .nav-mobile-toggle {
    display: block;
  }
  
  .hero {
    padding: 2rem 0 4rem;
  }
  
  .quiz-container {
    padding: 1rem;
  }
  
  .question-card {
    padding: 1.5rem;
  }
  
  .leaderboard-table th,
  .leaderboard-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
  }
  
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

/* Profile Navigation Tabs */
.nav-tab {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.75rem;
}

.nav-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  text-decoration: none;
}

.nav-tab.active {
  background: var(--primary-indigo);
  color: white;
  font-weight: 500;
}

.nav-tab.active span:first-child {
  filter: brightness(1.2);
}

/* Responsive pour la navigation */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .nav-mobile-toggle {
    display: block;
  }
  
  .header-content {
    flex-wrap: wrap;
  }
  
  .header-content > div:last-child {
    order: -1;
    margin-bottom: 0.5rem;
  }
}

@media (max-width: 640px) {
  .header-content {
    padding: 0.75rem 0;
  }
  
  .logo {
    font-size: 0.875rem;
  }
  
  .logo-icon {
    width: 2rem;
    height: 2rem;
  }
}

/* ======================= REGISTRATION FORMS ======================= */
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 16px;
  transition: all 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input:invalid {
  border-color: var(--danger-red);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

/* Error Messages */
.error-message {
  color: var(--danger-red);
  font-size: 14px;
  margin-top: 4px;
  display: block;
}

.error-message:empty,
.error-message.hidden {
  display: none;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 1000;
  transform: translateX(100%) scale(0.9);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  max-width: 400px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 16px 16px 0 0;
}

.toast.show {
  transform: translateX(0) scale(1);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 1.5rem;
  animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.toast.toast-success {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
  color: #059669;
}

.toast.toast-success::before {
  background: linear-gradient(90deg, #10b981, #059669);
}

.toast.toast-error {
  border-color: #ef4444;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
  color: #dc2626;
}

.toast.toast-error::before {
  background: linear-gradient(90deg, #ef4444, #dc2626);
}

.toast.toast-info {
  border-color: #667eea;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(255, 255, 255, 0.95) 100%);
  color: #4f46e5;
}

.toast.toast-info::before {
  background: linear-gradient(90deg, #667eea, #4f46e5);
}

/* Spinner */
.spinner-sm {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(102, 126, 234, 0.2);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Enhanced Loading Button States */
.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

.btn.loading {
  position: relative;
  color: transparent;
}

.btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

/* Modern Button Styles */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 600;
  letter-spacing: 0.025em;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(102, 126, 234, 0.2);
  color: #667eea;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  transform: translateY(-1px);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-info {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: none;
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* Checkbox Styling */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}

input[type="checkbox"]:checked {
  background: var(--primary-indigo);
  border-color: var(--primary-indigo);
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* Registration Form Specific */
.registration-form {
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.checkbox-label {
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-label a {
  color: var(--primary-indigo);
  text-decoration: none;
}

.checkbox-label a:hover {
  text-decoration: underline;
}

/* Custom checkbox styling for forms */
.custom-checkbox {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer !important;
  border: 2px solid rgba(255,255,255,0.5) !important;
  border-radius: 4px !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  transition: all 0.3s ease !important;
}

.custom-checkbox:checked {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  border-color: #6366f1 !important;
}

.custom-checkbox:checked::after {
  content: '✓' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: white !important;
  font-size: 12px !important;
  font-weight: bold !important;
  line-height: 1 !important;
}

.custom-checkbox:hover {
  border-color: rgba(255,255,255,0.7) !important;
}

/* Custom radio button styling for forms */
.custom-radio {
  width: 18px !important;
  height: 18px !important;
  cursor: pointer !important;
  border: 2px solid rgba(255,255,255,0.5) !important;
  border-radius: 50% !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  position: relative !important;
  transition: all 0.3s ease !important;
}

.custom-radio:checked {
  background: transparent !important;
  border-color: #6366f1 !important;
}

.custom-radio:checked::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 8px !important;
  height: 8px !important;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
  border-radius: 50% !important;
}

.custom-radio:hover {
  border-color: rgba(255,255,255,0.7) !important;
}