/* 🎨 PREDIKTO V2 - CSS FINAL COMPLET */
/* Version complète avec collecte préventive des infos de livraison */

/* ===== VARIABLES CSS ===== */
:root {
  /* Couleurs principales Predikto */
  --primary-purple: #8b5cf6;
  --primary-blue: #6366f1;
  --primary-dark: #7c3aed;
  
  /* Couleurs secondaires */
  --success-green: #10b981;
  --warning-orange: #f59e0b;
  --error-red: #ef4444;
  --info-blue: #3b82f6;
  
  /* Couleurs neutres */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Dégradés */
  --gradient-primary: linear-gradient(135deg, var(--primary-purple), var(--primary-blue));
  --gradient-success: linear-gradient(135deg, var(--success-green), #059669);
  --gradient-warning: linear-gradient(135deg, var(--warning-orange), #d97706);
  --gradient-dark: linear-gradient(135deg, var(--gray-800), var(--gray-900));
  
  /* Espacements */
  --space-xs: 0.25rem;    /* 4px */
  --space-sm: 0.5rem;     /* 8px */
  --space-md: 1rem;       /* 16px */
  --space-lg: 1.5rem;     /* 24px */
  --space-xl: 2rem;       /* 32px */
  --space-2xl: 3rem;      /* 48px */
  --space-3xl: 4rem;      /* 64px */
  
  /* Rayons */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-2xl: 1.5rem;   /* 24px */
  
  /* Ombres */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.3);
  
  /* Typographie */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', monospace;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 400ms ease-in-out;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  color: #ffffff;
  background: var(--gray-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== UTILITAIRES ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(139, 92, 246, 0.5); }
  50% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.8), 0 0 30px rgba(139, 92, 246, 0.6); }
}

.animate-fadeIn { animation: fadeIn 0.6s ease-out; }
.animate-slideInUp { animation: slideInUp 0.5s ease-out; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-glow { animation: glow 2s infinite; }

/* ===== HEADER ===== */
.app-header {
  background: var(--gradient-primary);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-md);
  min-height: 80px;
}

.nav-brand h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  background: linear-gradient(45deg, #ffffff, #f0f9ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-brand .tagline {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: -2px;
  display: block;
}

.main-nav {
  display: flex;
  gap: var(--space-lg);
}

.nav-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  transform: translateY(-1px);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #ffffff;
  border-radius: 1px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.points-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xl);
  font-weight: 700;
  font-size: 0.875rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-fast);
}

.points-badge:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.user-avatar:hover {
  transform: scale(1.1);
}

.user-avatar::before {
  content: '👤';
}

/* ===== MAIN CONTENT ===== */
.main-content {
  min-height: calc(100vh - 80px);
  padding: var(--space-2xl) 0;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
  animation: fadeIn 0.5s ease-in-out;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  text-align: center;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--gray-400);
  margin-bottom: var(--space-xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== BALANCE CARDS ===== */
.balance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.balance-card {
  padding: var(--space-xl);
  border-radius: var(--radius-2xl);
  text-align: center;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.balance-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.balance-card-primary {
  background: var(--gradient-primary);
}

.balance-card-success {
  background: var(--gradient-success);
}

.balance-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.balance-label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.balance-amount {
  font-size: 2.5rem;
  font-weight: 800;
  margin: var(--space-sm) 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.balance-subtext {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* ===== WARNING CONTAINER ===== */
.warning-container {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning-orange);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-xl) 0;
  text-align: center;
}

.warning-content {
  color: var(--warning-orange);
  font-weight: 600;
}

/* ===== MATCHES ===== */
.matches-grid {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.match-card {
  background: var(--gray-700);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.match-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.match-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.league-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.league-flag {
  font-size: 1.2rem;
}

.league-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary-purple);
  background: rgba(139, 92, 246, 0.1);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.match-time {
  font-size: 0.875rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-lg);
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning-orange);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.team-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: transform var(--transition-fast);
}

.team-logo:hover {
  transform: scale(1.1);
}

.team-name {
  font-weight: 600;
  text-align: center;
  font-size: 1rem;
  color: #ffffff;
}

.vs-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.vs-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-400);
  padding: var(--space-md);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}

.odds-section {
  margin-top: var(--space-xl);
}

.odds-title {
  text-align: center;
  color: var(--gray-400);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

.odds-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.odd-button {
  background: var(--gray-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}

.odd-button:hover {
  background: var(--primary-purple);
  border-color: var(--primary-purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.odd-button:active {
  transform: translateY(0);
}

.odd-label {
  font-size: 1rem;
  font-weight: 700;
}

.odd-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success-green);
}

/* ===== LOADING STATES ===== */
.loading-matches,
.loading-rewards {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--gray-400);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(139, 92, 246, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-purple);
  animation: spin 1s ease-in-out infinite;
  margin: 0 auto var(--space-md);
}

.no-matches {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--gray-400);
}

.no-matches-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
}

/* ===== WALLET ===== */
.wallet-balance {
  background: var(--gray-700);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  text-align: center;
  margin-bottom: var(--space-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-title {
  color: var(--gray-400);
  font-size: 1.125rem;
  margin-bottom: var(--space-md);
}

.wallet-amount {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  margin: var(--space-md) 0;
}

.gains-display {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.gains-label {
  color: var(--success-green);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.gains-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success-green);
}

.gains-subtext {
  font-size: 0.875rem;
  opacity: 0.8;
  color: var(--success-green);
}

.purchase-section {
  background: var(--gray-700);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.purchase-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: #ffffff;
}

.purchase-subtitle {
  color: var(--gray-400);
  margin-bottom: var(--space-xl);
}

.purchase-form {
  max-width: 400px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--gray-300);
  margin-bottom: var(--space-sm);
}

.form-input {
  width: 100%;
  background: var(--gray-800);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  color: #ffffff;
  font-size: 1.125rem;
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.conversion-display {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  color: var(--success-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.transaction-section {
  background: var(--gray-700);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.transaction-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  color: #ffffff;
}

.transaction-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md);
  background: var(--gray-800);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.transaction-type {
  font-weight: 600;
  color: #ffffff;
}

.transaction-amount {
  font-weight: 700;
  color: var(--success-green);
}

.transaction-date {
  font-size: 0.875rem;
  color: var(--gray-400);
}

/* ===== REWARDS ===== */
.rewards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.reward-card {
  background: var(--gray-700);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-normal);
}

.reward-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.reward-available {
  border-color: var(--success-green);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(16, 185, 129, 0.3);
}

.reward-locked {
  opacity: 0.8;
}

.reward-header {
  padding: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--gray-800);
}

.reward-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.reward-badge {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-xl);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-available {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-green);
  border: 1px solid var(--success-green);
}

.badge-locked {
  background: rgba(107, 114, 128, 0.2);
  color: var(--gray-400);
  border: 1px solid var(--gray-400);
}

.reward-content {
  padding: var(--space-xl);
}

.reward-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: #ffffff;
}

.reward-description {
  color: var(--gray-400);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}

.reward-cost {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--warning-orange);
  margin-bottom: var(--space-lg);
}

.reward-progress {
  margin-bottom: var(--space-lg);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--gray-600);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.progress-fill {
  height: 100%;
  background: var(--gradient-success);
  border-radius: var(--radius-lg);
  transition: width var(--transition-normal);
}

.progress-text {
  font-size: 0.875rem;
  color: var(--gray-400);
  text-align: center;
}

.reward-actions {
  padding: var(--space-xl);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vip-section {
  background: var(--gradient-dark);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.vip-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: #ffffff;
}

.vip-subtitle {
  color: var(--gray-400);
  margin-bottom: var(--space-xl);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== COLLECTE PRÉVENTIVE DES INFOS DE LIVRAISON ===== */

/* Section d'informations de livraison */
.delivery-info-section {
  margin: var(--space-lg) 0;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

/* Mode prévisualisation (gains insuffisants) */
.delivery-info-section.preview-mode {
  background: rgba(139, 92, 246, 0.05);
  border: 1px dashed rgba(139, 92, 246, 0.3);
}

/* Mode actif (gains suffisants) */
.delivery-info-section.active-mode {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* En-tête de section */
.delivery-header {
  margin-bottom: var(--space-lg);
  text-align: center;
}

.delivery-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  color: #ffffff;
}

.delivery-subtitle {
  font-size: 0.875rem;
  color: var(--gray-400);
  margin: 0;
  line-height: 1.4;
}

.preview-mode .delivery-title {
  color: var(--primary-purple);
}

.active-mode .delivery-title {
  color: var(--success-green);
}

/* Champs de livraison */
.delivery-field {
  margin-bottom: var(--space-lg);
}

.delivery-field:last-child {
  margin-bottom: 0;
}

.delivery-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--gray-300);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
}

.preview-badge {
  background: rgba(139, 92, 246, 0.2);
  color: var(--primary-purple);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Inputs de livraison */
.delivery-input {
  width: 100%;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  color: #ffffff;
  font-size: 1rem;
  transition: all var(--transition-fast);
  resize: vertical;
  font-family: inherit;
}

/* Input en mode prévisualisation */
.preview-input {
  background: rgba(139, 92, 246, 0.1);
  border: 1px dashed rgba(139, 92, 246, 0.3);
}

.preview-input:focus {
  outline: none;
  border-color: var(--primary-purple);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Input en mode actif */
.active-input {
  background: var(--gray-800);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.active-input:focus {
  outline: none;
  border-color: var(--success-green);
  background: rgba(16, 185, 129, 0.05);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.delivery-input::placeholder {
  color: var(--gray-400);
  font-style: italic;
}

.delivery-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Helper text sous les inputs */
.input-helper {
  margin-top: var(--space-sm);
  font-size: 0.75rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.preview-mode .input-helper {
  color: rgba(139, 92, 246, 0.8);
}

.active-mode .input-helper {
  color: rgba(16, 185, 129, 0.8);
}

/* Animation de sauvegarde */
.saved-animation {
  border-color: var(--success-green) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3) !important;
  animation: save-flash 1s ease-out;
}

@keyframes save-flash {
  0% { 
    background: rgba(16, 185, 129, 0.2);
  }
  100% { 
    background: var(--gray-800);
  }
}

/* Avantages en mode prévisualisation */
.preview-benefits {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  color: rgba(139, 92, 246, 0.9);
}

.benefit-item:last-child {
  margin-bottom: 0;
}

/* Actions en mode progression */
.progress-action {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.btn-continue {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-size: 0.95rem;
}

.progress-percentage {
  font-size: 0.875rem;
  color: var(--primary-purple);
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  background: rgba(139, 92, 246, 0.1);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Bouton d'échange final */
.btn-claim {
  width: 100%;
  font-size: 1.125rem;
  padding: var(--space-lg);
  background: var(--gradient-success);
  position: relative;
  overflow: hidden;
}

.btn-claim::before {
  content: '🎁';
  position: absolute;
  left: 20px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
  60% { transform: translateY(-3px); }
}

/* ===== POPUP DE SUCCÈS DE COMMANDE ===== */

.order-success-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: popup-fadeIn 0.3s ease-out;
  backdrop-filter: blur(5px);
}

.order-success-content {
  background: var(--gray-800);
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  text-align: center;
  max-width: 400px;
  margin: var(--space-md);
  border: 1px solid rgba(16, 185, 129, 0.3);
  box-shadow: var(--shadow-xl), 0 0 30px rgba(16, 185, 129, 0.2);
  animation: popup-slideIn 0.5s ease-out;
}

.order-success-icon {
  font-size: 4rem;
  margin-bottom: var(--space-lg);
  animation: success-bounce 1s ease-out;
}

.order-success-content h3 {
  color: var(--success-green);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.order-success-content p {
  color: #ffffff;
  margin-bottom: var(--space-sm);
}

.order-success-content p:last-of-type {
  color: var(--gray-400);
  font-size: 0.875rem;
  font-family: monospace;
  background: var(--gray-700);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-lg);
}

.order-success-content button {
  background: var(--gradient-success);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.order-success-content button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Animations */
@keyframes popup-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popup-slideIn {
  from { 
    opacity: 0;
    transform: scale(0.8) translateY(30px);
  }
  to { 
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes success-bounce {
  0%, 20%, 50%, 80%, 100% { 
    transform: translateY(0) scale(1);
  }
  10% { 
    transform: translateY(-10px) scale(1.1);
  }
  30% { 
    transform: translateY(-5px) scale(1.05);
  }
  40% { 
    transform: translateY(-3px) scale(1.02);
  }
  60% { 
    transform: translateY(-2px) scale(1.01);
  }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transition: all var(--transition-normal);
  transform: translate(-50%, -50%);
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-success {
  background: var(--gradient-success);
  color: #ffffff;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-warning {
  background: var(--gradient-warning);
  color: #ffffff;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

.btn-disabled {
  background: var(--gray-600) !important;
  color: var(--gray-400) !important;
  cursor: not-allowed !important;
  opacity: 0.7;
  font-size: 0.875rem;
}

.btn-disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

.btn-purchase {
  width: 100%;
  font-size: 1.125rem;
  padding: var(--space-lg);
}

/* ===== CTA SECTION ===== */
.cta-section {
  text-align: center;
  margin-top: var(--space-3xl);
  padding: var(--space-2xl);
  background: var(--gray-700);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-section h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.cta-section p {
  color: var(--gray-400);
  margin-bottom: var(--space-xl);
}

/* ===== FOOTER ===== */
.app-footer {
  background: var(--gray-900);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: var(--space-3xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.footer-section h3,
.footer-section h4 {
  color: var(--primary-purple);
  margin-bottom: var(--space-md);
}

.footer-section p {
  color: var(--gray-400);
  margin-bottom: var(--space-md);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--primary-purple);
}

.social-links {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.social-link {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.social-link:hover {
  color: var(--primary-purple);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  color: var(--gray-400);
}

.app-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-version {
  background: rgba(139, 92, 246, 0.1);
  color: var(--primary-purple);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-md);
  font-weight: 600;
}

/* ===== PWA BANNER ===== */
.pwa-banner {
  position: fixed;
  bottom: var(--space-lg);
  left: var(--space-lg);
  right: var(--space-lg);
  background: var(--gradient-success);
  color: white;
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 1000;
  animation: slideInUp 0.5s ease-out;
}

.pwa-banner.show {
  display: flex;
}

.pwa-content {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.pwa-icon {
  font-size: 2rem;
}

.pwa-title {
  font-weight: bold;
  margin-bottom: var(--space-xs);
}

.pwa-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
}

.pwa-actions {
  display: flex;
  gap: var(--space-md);
}

.pwa-button {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.pwa-button-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.pwa-button-primary {
  background: rgba(255, 255, 255, 0.9);
  color: var(--success-green);
}

.pwa-button:hover {
  transform: translateY(-1px);
}

/* ===== NOTIFICATIONS ===== */
.notification {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--transition-normal);
  max-width: 400px;
  min-width: 300px;
  margin-bottom: var(--space-md);
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification > div {
  background: var(--gray-800);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-success > div {
  border-left: 4px solid var(--success-green);
}

.notification-error > div {
  border-left: 4px solid var(--error-red);
}

.notification-warning > div {
  border-left: 4px solid var(--warning-orange);
}

.notification-info > div {
  border-left: 4px solid var(--info-blue);
}

.notification-close {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.notification-close:hover {
  color: #ffffff;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--space-lg);
  }
  
  .main-nav {
    gap: var(--space-md);
  }
}

@media (max-width: 768px) {
  .app-header .container {
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
  }
  
  .main-nav {
    order: 2;
    width: 100%;
    justify-content: center;
  }
  
  .user-info {
    order: 1;
    justify-content: center;
    width: 100%;
  }
  
  .nav-link {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
  }
  
  .section-title {
    font-size: 1.5rem;
  }
  
  .balance-cards {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .match-teams {
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-md);
  }
  
  .team-logo {
    width: 50px;
    height: 50px;
  }
  
  .team-name {
    font-size: 0.875rem;
  }
  
  .odds-container {
    gap: var(--space-sm);
  }
  
  .odd-button {
    padding: var(--space-md) var(--space-sm);
  }
  
  .rewards-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
  
  .pwa-banner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-md);
  }
  
  .pwa-actions {
    width: 100%;
    justify-content: center;
  }
  
  .delivery-info-section {
    padding: var(--space-md);
  }
  
  .delivery-label {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }
  
  .preview-badge {
    align-self: flex-start;
  }
  
  .delivery-input {
    font-size: 16px; /* Évite le zoom sur iOS */
  }
  
  .progress-action {
    gap: var(--space-sm);
  }
  
  .btn-continue {
    font-size: 0.875rem;
    padding: var(--space-md);
  }
  
  .order-success-content {
    margin: var(--space-lg);
    padding: var(--space-xl);
  }
  
  .order-success-icon {
    font-size: 3rem;
  }
  
  .order-success-content h3 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  :root {
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
  }
  
  .nav-brand h1 {
    font-size: 1.5rem;
  }
  
  .balance-amount {
    font-size: 2rem;
  }
  
  .wallet-amount {
    font-size: 2.5rem;
  }
  
  .reward-title {
    font-size: 1.125rem;
  }
  
  .team-logo {
    width: 40px;
    height: 40px;
  }
  
  .notification {
    left: var(--space-md);
    right: var(--space-md);
    max-width: none;
  }
  
  .pwa-banner {
    left: var(--space-md);
    right: var(--space-md);
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .app-header,
  .app-footer,
  .pwa-banner,
  .notification,
  .btn {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .match-card,
  .balance-card,
  .reward-card {
    background: white !important;
    color: black !important;
    border: 1px solid #000 !important;
    box-shadow: none !important;
  }
}

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

.focus-visible:focus {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-800);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-purple);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ===== SELECTION ===== */
::selection {
  background: var(--primary-purple);
  color: white;
}

::-moz-selection {
  background: var(--primary-purple);
  color: white;
}

/* États visuels améliorés */
.reward-card.reward-available .delivery-info-section {
  border-color: var(--success-green);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.1);
}

.reward-card.reward-locked .delivery-info-section {
  border-color: rgba(139, 92, 246, 0.3);
}

/* Animation subtile pour les champs actifs */
.active-mode .delivery-input:focus {
  animation: input-focus 0.3s ease-out;
}

@keyframes input-focus {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Indicateur de completion */
.delivery-field.completed::after {
  content: '✓';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--success-green);
  font-weight: bold;
}

.delivery-field {
  position: relative;
}

/* Style pour les récompenses prêtes */
.reward-available .delivery-header {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
