/* ============================================
   DASHBOARD MWR LIFE - STYLES GAMIFICATION
   ============================================ */

:root {
  /* Couleurs principales */
  --bg-dark: #0D1117;
  --bg-darker: #010409;
  --bg-card: #161B22;
  --text-light: #E6EDF3;
  --text-muted: #8B949E;

  /* Couleurs accent */
  --accent-gold: #FFD700;
  --accent-green: #00FF7F;
  --accent-blue: #1e90ff;
  --accent-purple: #BB86FC;
  --accent-red: #FF4444;
  --accent-orange: #FF6B35;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.1);
  --border-strong: rgba(255,255,255,0.2);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(1,4,9,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(30,144,255,0.2);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay p {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ============================================
   NOTIFICATIONS TOAST
   ============================================ */

.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.toast:hover {
  transform: translateX(-5px);
}

.toast.level-up {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255,215,0,0.1), var(--bg-card));
}

.toast.quest-complete {
  border-color: var(--accent-green);
  background: linear-gradient(135deg, rgba(0,255,127,0.1), var(--bg-card));
}

.toast.badge-unlock {
  border-color: var(--accent-purple);
  background: linear-gradient(135deg, rgba(187,134,252,0.1), var(--bg-card));
}

.toast .toast-icon {
  font-size: 2rem;
}

.toast .toast-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.toast .toast-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================
   HEADER
   ============================================ */

.dashboard-header {
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-section h1 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(30,144,255,0.1);
  border: 1px solid rgba(30,144,255,0.3);
  border-radius: 8px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-button:hover {
  background: linear-gradient(135deg, var(--accent-blue), rgba(30,144,255,0.8));
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(30,144,255,0.3);
}

.nav-button .icon {
  font-size: 1.2rem;
}

.logout-btn {
  background: rgba(255,68,68,0.1);
  border-color: rgba(255,68,68,0.3);
}

.logout-btn:hover {
  background: linear-gradient(135deg, var(--accent-red), rgba(255,68,68,0.8));
  border-color: var(--accent-red);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.dashboard-main {
  padding: 2rem;
  min-height: calc(100vh - 200px);
}

.dashboard-container {
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

/* ============================================
   CARDS
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom: 1%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 1.5rem;
}

/* ============================================
   PROFILE SECTION
   ============================================ */

.profile-section {
  grid-column: 1 / -1;
  max-width: 100%;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-avatar {
  position: relative;
}

.avatar-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  border: 4px solid var(--bg-card);
  box-shadow: 0 0 20px rgba(30,144,255,0.4);
}

.profile-level-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-gold), #FFA500);
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #000;
  box-shadow: 0 2px 10px rgba(255,215,0,0.5);
}

.profile-details h3 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.profile-title {
  font-size: 1.2rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
  font-weight: 600;
}

.profile-stats {
  font-size: 1rem;
  color: var(--text-muted);
}

/* Barre XP */
.xp-section {
  background: rgba(30,144,255,0.05);
  border: 1px solid rgba(30,144,255,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.xp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 1rem;
}

.xp-label {
  color: var(--text-light);
}

.xp-amount {
  color: var(--accent-blue);
  font-weight: 600;
}

.xp-bar {
  height: 30px;
  background: rgba(0,0,0,0.3);
  border-radius: 15px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 10px;
}

.xp-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
  border-radius: 15px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: 0 0 15px rgba(30,144,255,0.6);
}

.xp-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.xp-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Position Leaderboard */
.leaderboard-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,165,0,0.05));
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 12px;
  padding: 1rem;
  font-size: 1.1rem;
}

.leaderboard-position .icon {
  font-size: 1.8rem;
}

.leaderboard-position strong {
  color: var(--accent-gold);
}

/* ============================================
   QUESTS SECTION
   ============================================ */

.quests-section {
  grid-column: 1 / -1;
}

.quest-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-button {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-button:hover {
  background: rgba(30,144,255,0.1);
  border-color: rgba(30,144,255,0.3);
  color: var(--text-light);
}

.tab-button.active {
  background: linear-gradient(135deg, var(--accent-blue), rgba(30,144,255,0.8));
  border-color: var(--accent-blue);
  color: white;
}

.quests-container {
  min-height: 300px;
}

.quest-tab-content {
  display: none;
}

.quest-tab-content.active {
  display: block;
}

.quest-item {
  background: rgba(30,144,255,0.05);
  border: 1px solid rgba(30,144,255,0.2);
  border-radius: 12px;
  padding: 1.2rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.quest-item:hover {
  background: rgba(30,144,255,0.1);
  border-color: rgba(30,144,255,0.4);
  transform: translateX(5px);
}

.quest-item.completed {
  opacity: 0.6;
  background: rgba(0,255,127,0.05);
  border-color: rgba(0,255,127,0.3);
}

.quest-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-blue);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.quest-item.completed .quest-checkbox {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.quest-checkbox::after {
  content: '✓';
  color: white;
  font-size: 1rem;
  font-weight: 700;
  display: none;
}

.quest-item.completed .quest-checkbox::after {
  display: block;
}

.quest-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.quest-details {
  flex: 1;
}

.quest-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.quest-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quest-progress-bar {
  height: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}

.quest-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-green));
  border-radius: 3px;
  transition: width var(--transition-normal);
}

.quest-reward {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--accent-gold);
  flex-shrink: 0;
}

/* ============================================
   STATS SECTION
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: rgba(30,144,255,0.05);
  border: 1px solid rgba(30,144,255,0.2);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  background: rgba(30,144,255,0.1);
  border-color: rgba(30,144,255,0.4);
  transform: translateY(-4px);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-blue);
}

/* ============================================
   LEADERBOARD SECTION
   ============================================ */

.leaderboard-message {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.leaderboard-message p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.members-count {
  font-size: 1.3rem;
  color: var(--accent-blue);
}

.podium-section {
  margin-bottom: 3rem;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem;
  padding: 2rem 0;
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.podium-place.first {
  order: 2;
}

.podium-place.second {
  order: 1;
}

.podium-place.third {
  order: 3;
}

.podium-medal {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: bounce 1s ease infinite;
}

.podium-place.first .podium-medal {
  animation-delay: 0s;
}

.podium-place.second .podium-medal {
  animation-delay: 0.1s;
}

.podium-place.third .podium-medal {
  animation-delay: 0.2s;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.podium-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  box-shadow: 0 4px 20px rgba(30,144,255,0.4);
}

.podium-place.first .podium-avatar {
  width: 100px;
  height: 100px;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--accent-gold), #FFA500);
}

.podium-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.podium-level {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.podium-score {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.top10-section h3 {
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--accent-blue);
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(30,144,255,0.05);
  border: 1px solid rgba(30,144,255,0.2);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  transition: all var(--transition-fast);
}

.leaderboard-item:hover {
  background: rgba(30,144,255,0.1);
  border-color: rgba(30,144,255,0.4);
  transform: translateX(5px);
}

.leaderboard-item.your-position {
  background: linear-gradient(135deg, rgba(255,215,0,0.1), rgba(255,165,0,0.05));
  border-color: var(--accent-gold);
}

.leaderboard-position-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-blue);
  min-width: 40px;
  text-align: center;
}

.leaderboard-name {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
}

.leaderboard-level {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.leaderboard-score {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.separator-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: 2rem 0;
}

/* ============================================
   UPDATE STATS SECTION
   ============================================ */

.update-stats-section .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.toggle-form-btn {
  background: rgba(255,215,0,0.1);
  border: 1px solid rgba(255,215,0,0.3);
  color: var(--accent-gold);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.toggle-form-btn:hover {
  background: rgba(255,215,0,0.2);
  border-color: var(--accent-gold);
}

.update-stats-desc {
  background: rgba(187,134,252,0.1);
  border-left: 4px solid var(--accent-purple);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  color: rgba(255,255,255,0.85);
}

.update-stats-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-section {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1.5rem;
}

.form-section h3 {
  color: var(--accent-gold);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.form-hint {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-icon {
  font-size: 1.2rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-gold);
  background: rgba(255,255,255,0.08);
}

.form-group input:hover,
.form-group select:hover {
  border-color: rgba(255,215,0,0.4);
}

.form-group small {
  display: block;
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
  color: var(--bg-darker);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,215,0,0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}

/* ============================================
   BADGES SECTION
   ============================================ */

.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem;
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem;
  background: rgba(30,144,255,0.05);
  border: 1px solid rgba(30,144,255,0.2);
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.badge-item:hover {
  background: rgba(30,144,255,0.1);
  border-color: rgba(30,144,255,0.4);
  transform: translateY(-4px);
}

.badge-item.locked {
  opacity: 0.4;
  filter: grayscale(100%);
}

.badge-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.badge-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
}

/* ============================================
   FOOTER
   ============================================ */

.dashboard-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-subtle);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ============================================
   UTILITIES
   ============================================ */

.loading-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 2rem;
}

.hidden {
  display: none !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1200px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: 1rem;
  }

  .dashboard-header {
    padding: 1rem;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-nav {
    width: 100%;
    flex-direction: column;
  }

  .nav-button {
    width: 100%;
    justify-content: center;
  }

  .profile-info {
    flex-direction: column;
    text-align: center;
  }

  .podium {
    flex-direction: column;
    align-items: center;
  }

  .podium-place {
    order: initial !important;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .quest-item {
    flex-direction: column;
    text-align: center;
  }

  .badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .notification-container {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .avatar-circle {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }

  .profile-level-badge {
    width: 35px;
    height: 35px;
    font-size: 0.9rem;
  }

  .card-header h2 {
    font-size: 1.2rem;
  }

  .quest-tabs {
    flex-direction: column;
  }

  .tab-button {
    width: 100%;
  }
}

/* ============================================
   DUAL TEAM CARD
   ============================================ */

.palier-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 140, 0, 0.05) 100%);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.palier-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
}

.palier-icon {
  font-size: 4rem;
  line-height: 1;
}

.palier-info h3 {
  font-size: 1.8rem;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.palier-info p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.dual-team-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.team-bar {
  width: 100%;
}

.team-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}

.team-bar .progress-bar {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.team-bar .progress-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.left-progress {
  background: linear-gradient(90deg, #1e90ff, #4da6ff);
}

.right-progress {
  background: linear-gradient(90deg, #ff4444, #ff6b6b);
}

/* Alerte niveau bloqué */
.niveau-bloque-alert {
  margin-top: 20px;
  padding: 20px;
  background: rgba(255, 140, 0, 0.1);
  border: 1px solid rgba(255, 140, 0, 0.3);
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Boutons Dual Team */
.dual-team-actions {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.btn-dual-team {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-left {
  background: linear-gradient(135deg, #1e90ff, #4da6ff);
  color: white;
}

.btn-left:hover {
  background: linear-gradient(135deg, #4da6ff, #1e90ff);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(30, 144, 255, 0.4);
}

.btn-right {
  background: linear-gradient(135deg, #ff4444, #ff6b6b);
  color: white;
}

.btn-right:hover {
  background: linear-gradient(135deg, #ff6b6b, #ff4444);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 68, 68, 0.4);
}

.btn-dual-team:active {
  transform: translateY(0);
}

.btn-dual-team span:first-child {
  font-size: 1.5rem;
}

/* ============================================
   QUEST CHECKBOXES
   ============================================ */

.quest-checkbox-container {
  margin-right: 15px;
  position: relative;
}

.quest-checkbox-input {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  background: transparent;
}

.quest-checkbox-input:hover:not(:disabled) {
  border-color: #1e90ff;
  box-shadow: 0 0 8px rgba(30, 144, 255, 0.3);
}

.quest-checkbox-input:checked {
  background: linear-gradient(135deg, #00FF7F, #32CD32);
  border-color: #00FF7F;
}

.quest-checkbox-input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.quest-checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 24px;
  pointer-events: none;
}

.quest-checkbox-label .checkmark {
  position: absolute;
  left: 4px;
  top: 0px;
  font-size: 18px;
  color: #fff;
  font-weight: bold;
}

.quest-item.validating {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.quest-item.validating::after {
  content: '⏳';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.quest-item.completed {
  opacity: 0.7;
  background: rgba(0, 255, 127, 0.05);
  border-left: 3px solid #00FF7F;
}

/* ============================================
   RESPONSIVE DUAL TEAM
   ============================================ */

@media (max-width: 768px) {
  .palier-display {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  .palier-icon {
    font-size: 3rem;
  }

  .palier-info h3 {
    font-size: 1.5rem;
  }

  .team-bar-header {
    font-size: 0.85rem;
  }

  .quest-checkbox-input,
  .quest-checkbox-label {
    width: 20px;
    height: 20px;
  }

  .quest-checkbox-label .checkmark {
    font-size: 16px;
    left: 3px;
  }
}

/* ============================================
   SECTION FILLEULS - PARRAINAGE
   ============================================ */

.filleuls-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.filleul-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 20px;
  transition: var(--transition-fast);
}

.filleul-card:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.filleul-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.filleul-info {
  flex: 1;
}

.filleul-nom {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 5px;
}

.filleul-email {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.filleul-meta {
  display: flex;
  gap: 15px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.filleul-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.filleul-statut-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filleul-statut-badge.en-attente {
  background: rgba(255, 165, 0, 0.2);
  color: #ffa500;
  border: 1px solid #ffa500;
}

.filleul-statut-badge.valide {
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  border: 1px solid #00ff88;
}

.filleul-statut-badge.refuse {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
  border: 1px solid #ff4444;
}

.filleul-statut-badge.bloque {
  background: rgba(150, 150, 150, 0.2);
  color: #999;
  border: 1px solid #999;
}

.filleul-actions {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-subtle);
}

.filleul-actions button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filleul-actions button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-valider {
  background: linear-gradient(135deg, #00ff88, #00cc6a);
  color: #000;
}

.btn-valider:hover {
  background: linear-gradient(135deg, #00ff88, #00ff88);
}

.btn-refuser {
  background: rgba(255, 68, 68, 0.2);
  color: #ff4444;
  border: 1px solid #ff4444 !important;
}

.btn-refuser:hover {
  background: rgba(255, 68, 68, 0.3);
}

.btn-bloquer {
  background: rgba(150, 150, 150, 0.2);
  color: #999;
  border: 1px solid #999 !important;
}

.btn-bloquer:hover {
  background: rgba(150, 150, 150, 0.3);
}

.btn-debloquer {
  background: rgba(30, 144, 255, 0.2);
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue) !important;
}

.btn-debloquer:hover {
  background: rgba(30, 144, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .filleul-card-header {
    flex-direction: column;
    gap: 15px;
  }

  .filleul-actions {
    flex-direction: column;
  }

  .filleul-actions button {
    width: 100%;
  }

  .filleul-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* ============================================
   R�ORGANISATION DES SECTIONS
   ============================================
   Structure :
   1. Profil (pleine largeur)
   2. Grid 3 colonnes : Dual Team | Code Invitation | Mes Filleuls
   3. Vos Qu�tes (pleine largeur)
   4. Grid 6 colonnes : Stats | Badges | Leaderboard | MAJ Stats | Mes Groupes | Communaut�
   ============================================ */

/* 1. PROFIL - Pleine largeur en haut */
.profile-section {
  order: 1;
  grid-column: 1 / -1;
}

/* === PREMIER GRID (3 colonnes) === */

/* 2. DUAL TEAM */
.palier-card {
  order: 2;
}

/* 3. CODE D'INVITATION */
.dashboard-container > section:nth-of-type(3) {
  order: 3;
}

/* 4. MES FILLEULS */
.dashboard-container > section:nth-of-type(4) {
  order: 4;
}

/* 5. VOS QU�TES - Pleine largeur */
.quests-section {
  order: 5;
  grid-column: 1 / -1;
}

/* === DEUXI�ME GRID (6 colonnes) === */

/* 6. STATISTIQUES */
.stats-section {
  order: 6;
}

/* 7. BADGES */
.badges-section {
  order: 7;
}

/* 8. LEADERBOARD */
.dashboard-container > section:nth-of-type(8) {
  order: 8;
}

/* 9. METTRE � JOUR STATS */
.dashboard-container > section:nth-of-type(7) {
  order: 9;
}

/* 10. MES GROUPES (parrains) */
#sectionMesGroupes {
  order: 10;
}

/* 11. COMMUNAUT� (filleuls) - Derni�re colonne du deuxi�me grid */
#sectionGroupesParrain {
  order: 11;
}

/* ============================================
   MODAL CHOIX DE BRANCHE
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-light);
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.modal-body {
  padding: 20px;
}

.btn-branche {
  border: none;
  outline: none;
  font-family: inherit;
  position: relative;
}

.btn-branche:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-branche.selected {
  border-width: 3px;
  box-shadow: 0 0 20px currentColor;
}

#btnBrancheGauche.selected {
  border-color: #1e90ff;
  background: rgba(30, 144, 255, 0.2);
  box-shadow: 0 0 20px rgba(30, 144, 255, 0.5);
}

#btnBrancheDroite.selected {
  border-color: #00ff7f;
  background: rgba(0, 255, 127, 0.2);
  box-shadow: 0 0 20px rgba(0, 255, 127, 0.5);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   CONTENEUR DE VALIDATION INLINE
   ============================================ */

.validation-container {
  background: rgba(30, 144, 255, 0.05);
  border: 2px solid rgba(30, 144, 255, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.validation-header h3 {
  color: #1e90ff;
  font-size: 1.1rem;
  margin-bottom: 20px;
  text-align: center;
}

.mwr-link-section {
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.3);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 20px;
}

.btn-mwr-link {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35, #ffa500);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s;
  box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
}

.btn-mwr-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.4);
}

.branche-selection {
  margin-bottom: 20px;
}

.branche-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 15px;
}

.btn-branche-choice {
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  font-family: inherit;
  color: #fff;
}

.btn-branche-choice:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-branche-choice.selected {
  border-width: 3px;
  box-shadow: 0 0 20px currentColor;
}

.btn-branche-choice[data-branche="gauche"].selected {
  border-color: #1e90ff;
  background: rgba(30, 144, 255, 0.2);
  box-shadow: 0 0 25px rgba(30, 144, 255, 0.5);
}

.btn-branche-choice[data-branche="droite"].selected {
  border-color: #00ff7f;
  background: rgba(0, 255, 127, 0.2);
  box-shadow: 0 0 25px rgba(0, 255, 127, 0.5);
}

.branche-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.branche-label {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.branche-count {
  font-size: 0.85rem;
  color: #aaa;
}

.conseil-box {
  background: rgba(255, 165, 0, 0.1);
  border: 1px solid rgba(255, 165, 0, 0.2);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  color: #ffa500;
}

.validation-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.btn-annuler-validation {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.95rem;
}

.btn-annuler-validation:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-confirmer-validation {
  padding: 10px 20px;
  background: linear-gradient(135deg, #00ff7f, #00bfff);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
}

.btn-confirmer-validation:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 255, 127, 0.4);
}

.btn-confirmer-validation:disabled {
  cursor: not-allowed;
}

/* ============================================
   TOGGLE SWITCHES - CONTRÔLES DE VISIBILITÉ
   ============================================ */

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  border-radius: 26px;
  transition: 0.3s;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--accent-gold);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.toggle-switch:hover .toggle-slider {
  opacity: 0.9;
}
