/* ============================================
   THÈME "MILLE ET UNE NUITS" - Halal-Meeting
   ============================================ */

:root {
  /* Couleurs principales */
  --gold: #D4AF37;
  --gold-light: #F4E4BC;
  --gold-dark: #B8962E;
  --gold-glow: rgba(212, 175, 55, 0.6);
  
  --deep-blue: #0A1929;
  --midnight: #1a2a4a;
  --night-sky: #0d1b36;
  
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  
  /* Effets */
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.4);
  --shadow-gold-strong: 0 0 30px rgba(212, 175, 55, 0.6);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.5);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================
   FONDS ANIMÉS "NUIT ÉTOILÉE"
   ============================================ */

body {
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--midnight) 50%, var(--night-sky) 100%);
  position: relative;
  overflow-x: hidden;
}

/* Étoiles scintillantes */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 40px 70px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 50px 160px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 90px 40px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 130px 80px, #fff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 160px 120px, #fff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: twinkle 5s ease-in-out infinite;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.5; }
}

/* Motif arabesque subtil en overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4AF37' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

/* Contenu au-dessus des effets */
.container, header, main, .content-wrapper {
  position: relative;
  z-index: 1;
}

/* ============================================
   BOUTONS "OR BRILLANT"
   ============================================ */

button, .btn, .nav-btn {
  position: relative;
  overflow: hidden;
  transition: all var(--transition-medium);
}

button::before, .btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: rotate(45deg);
  transition: all var(--transition-slow);
  opacity: 0;
}

button:hover::before, .btn:hover::before {
  opacity: 1;
  left: 100%;
}

button:hover, .btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}

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

/* Boutons dorés */
.btn-gold, .btn-primary, .btn-apply, .btn-upgrade {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--deep-blue);
  border: none;
  position: relative;
}

.btn-gold:hover, .btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  box-shadow: var(--shadow-gold-strong);
}

/* Boutons contour doré */
.btn-outline, .btn-back, .nav-btn {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}

.btn-outline:hover, .btn-back:hover, .nav-btn:hover {
  background: var(--gold);
  color: var(--deep-blue);
  box-shadow: var(--shadow-gold);
}

/* ============================================
   CARTES "LUXE ORIENTAL"
   ============================================ */

.profile-card, .match-item, .settings-card, .modal-content {
  background: linear-gradient(
    145deg,
    rgba(26, 42, 74, 0.98),
    rgba(10, 25, 41, 0.98)
  );
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-medium);
  position: relative;
  overflow: hidden;
}

.profile-card::before, .match-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  opacity: 0;
  transition: opacity var(--transition-medium);
}

.profile-card:hover, .match-item:hover {
  border-color: var(--gold);
  transform: translateY(-5px);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6), var(--shadow-gold);
}

.profile-card:hover::before, .match-item:hover::before {
  opacity: 1;
}

/* ============================================
   EN-TÊTE "PALAIS ORIENTAL"
   ============================================ */

header {
  background: linear-gradient(
    180deg,
    rgba(10, 25, 41, 0.98) 0%,
    rgba(26, 42, 74, 0.95) 100%
  );
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5), 0 0 20px var(--gold-glow);
  backdrop-filter: blur(10px);
}

.logo {
  text-shadow: 0 0 10px var(--gold-glow);
  transition: all var(--transition-medium);
}

.logo:hover {
  text-shadow: 0 0 20px var(--gold-glow), 0 0 30px var(--gold);
  transform: scale(1.05);
}

/* ============================================
   NAVIGATION "LANTERNE MAGIQUE"
   ============================================ */

.nav-btn {
  position: relative;
  border-radius: 25px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--gold);
  transition: width var(--transition-medium);
  border-radius: 2px;
}

.nav-btn:hover::after, .nav-btn.active::after {
  width: 80%;
}

.nav-btn.active {
  background: var(--gold);
  color: var(--deep-blue);
  box-shadow: var(--shadow-gold);
}

/* ============================================
   MODALS "COUPOLE ORIENTALE"
   ============================================ */

.modal-content {
  border: 3px solid var(--gold);
  box-shadow: 0 0 50px rgba(212, 175, 55, 0.3), var(--shadow-card);
  animation: modalEnter var(--transition-medium) ease;
}

@keyframes modalEnter {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-close {
  background: var(--danger);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: #c0392b;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 0 25px rgba(231, 76, 60, 0.8);
}

/* ============================================
   TOAST NOTIFICATIONS "MESSAGE ROYAL"
   ============================================ */

.toast-notification {
  background: linear-gradient(135deg, var(--deep-blue), var(--midnight));
  border: 2px solid var(--gold);
  border-radius: 15px;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), var(--shadow-gold);
  backdrop-filter: blur(10px);
  animation: toastEnter var(--transition-medium) ease;
}

@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-notification.success {
  border-color: var(--success);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(46, 204, 113, 0.4);
}

.toast-notification.error {
  border-color: var(--danger);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(231, 76, 60, 0.4);
}

.toast-notification.warning {
  border-color: var(--warning);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(243, 156, 18, 0.4);
}

/* ============================================
   CHARGEMENT "ROUE D'OR"
   ============================================ */

.loading .spinner {
  border: 4px solid rgba(212, 175, 55, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite, glow 2s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 10px var(--gold-glow);
  }
  50% {
    box-shadow: 0 0 25px var(--gold), 0 0 35px var(--gold-glow);
  }
}

/* ============================================
   AVATARS "MÉDAILLON D'OR"
   ============================================ */

.avatar, .user-avatar, .profile-avatar-large {
  border: 3px solid var(--gold-light);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  transition: all var(--transition-medium);
}

.avatar:hover, .user-avatar:hover {
  box-shadow: 0 0 30px var(--gold), 0 0 50px var(--gold-glow);
  transform: scale(1.05);
}

/* Voyant online avec pulsation */
.online-indicator, .online-dot {
  background: var(--success);
  border: 2px solid var(--gold-light);
  box-shadow: 0 0 10px var(--success);
  animation: pulse-online 2s ease-in-out infinite;
}

@keyframes pulse-online {
  0%, 100% {
    box-shadow: 0 0 10px var(--success);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 20px var(--success), 0 0 30px rgba(46, 204, 113, 0.5);
    transform: scale(1.1);
  }
}

/* ============================================
   TEXTES "CALLIGRAPHIE"
   ============================================ */

h1, h2, h3, .section-title, .logo {
  font-family: 'Cormorant Garamond', serif;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.section-title {
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '✦ ✦ ✦';
  display: block;
  text-align: center;
  color: var(--gold);
  font-size: 1rem;
  margin-top: 0.5rem;
  opacity: 0.6;
}

/* ============================================
   INPUTS "COFFRE PRÉCIEUX"
   ============================================ */

input, select, textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(212, 175, 55, 0.3);
  border-radius: 12px;
  transition: all var(--transition-fast);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 15px var(--gold-glow);
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   SCROLLBAR "RIVIÈRE D'OR"
   ============================================ */

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--deep-blue);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold), var(--gold-dark));
  border-radius: 5px;
  border: 2px solid var(--deep-blue);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 10px var(--gold-glow);
}

/* ============================================
   ANIMATIONS GÉNÉRALES
   ============================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Application des animations */
.section {
  animation: fadeIn var(--transition-medium) ease;
}

.profile-card, .match-item {
  animation: scaleIn var(--transition-medium) ease;
}

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */

@media (max-width: 768px) {
  :root {
    --transition-fast: 0.15s ease;
    --transition-medium: 0.25s ease;
  }
  
  .nav-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
  }
  
  .profile-card, .modal-content {
    border-radius: 15px;
  }
  
  .toast-notification {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* ============================================
   MODE SOMBRE PROFOND
   ============================================ */

@media (prefers-color-scheme: dark) {
  :root {
    --deep-blue: #050d1a;
    --midnight: #0f1f3a;
    --night-sky: #0a1525;
  }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   EFFET DE LUEUR SUR LES ÉLÉMENTS IMPORTANTS
   ============================================ */

.glow-effect {
  position: relative;
}

.glow-effect::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(45deg, var(--gold), var(--gold-light), var(--gold));
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  filter: blur(10px);
  transition: opacity var(--transition-medium);
}

.glow-effect:hover::after {
  opacity: 0.5;
}