/* === Base === */
body {
  background: linear-gradient(135deg, #7ee8fa, #80ff72);
  font-family: "Poppins", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

/* === Splash Screen === */
#splash-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #7ee8fa, #80ff72);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeOut 1s ease forwards;
  animation-delay: 2.5s;
}
#splash-logo { font-size: 60px; color: #28a745; animation: bounceIn 1s ease; }
#splash-title { margin-top: 10px; font-weight: bold; color: white; letter-spacing: 1px; font-size: 1.3rem; opacity: 0; animation: fadeInText 1.2s ease 0.8s forwards; }
.loader { margin-top: 20px; width: 50px; height: 50px; border: 5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes bounceIn { 0% {transform:scale(0.3);opacity:0;} 60%{transform:scale(1.1);opacity:1;} 100%{transform:scale(1);} }
@keyframes fadeInText { to {opacity:1;} }
@keyframes spin { to {transform:rotate(360deg);} }
@keyframes fadeOut { to {opacity:0;visibility:hidden;} }

/* === Dashboard === */
.profile-img {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); border: 3px solid #fff;
  margin: 15px auto; display: block; animation: fadeInUp 0.8s ease;
}
@keyframes fadeInUp { from {opacity:0;transform:translateY(20px);} to {opacity:1;transform:translateY(0);} }

.card {
  border: none; border-radius: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.card.show { opacity: 1; transform: translateY(0); }

.progress { height: 10px; border-radius: 5px; }
.progress-bar { width: 0; transition: width 1.2s ease-in-out; }

section {
  flex-grow: 1;
  padding: 30px 15px 70px;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
section.active-section { display: block; opacity: 1; }

/* === Niveaux scrollables === */
.levels-container {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 10px 0 15px;
}
.levels-container::-webkit-scrollbar {
  display: none;
}

/* ⚠️ Correction : alignement et largeur totale pour permettre le scroll complet */
.levels-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  padding: 10px;
  justify-content: flex-start; /* évite que les cartes soient centrées, sinon le scroll se bloque */
  min-width: max-content; /* assure que le scroll horizontal fonctionne */
}

/* === Carte de niveau === */
.level-card {
  flex: 0 0 auto;
  width: 120px;
  background: #fff;
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  padding: 15px 10px;
  position: relative;
  transform: translateY(30px);
  opacity: 0;
  animation: slideUp 0.6s ease forwards;
}

@keyframes slideUp {
  0% { transform: translateY(40px) scale(0.95); opacity: 0; }
  60% { transform: translateY(-5px) scale(1.05); opacity: 1; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

/* === Niveau actuel === */
.level-card.current {
  border: 3px solid #28a745 !important;
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(40,167,69,0.4);
  opacity: 1 !important;
  background: linear-gradient(145deg, #f8fff8, #e7ffe7);
  position: relative;
  z-index: 5;
}

/* Étoile du niveau actuel */
.level-card.current::after {
  content: "⭐";
  position: absolute;
  top: -10px;
  right: -8px;
  font-size: 1.3rem;
}

/* === Niveau verrouillé === */
.level-card.locked {
  opacity: 0.6;
}

/* === Icône du niveau === */
.level-icon {
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  background: #fff;
}
.level-card.locked .level-icon {
  background: #ddd;
}

/* === Image de récompense === */
.reward-img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  padding: 5px;
  transition: transform 0.3s ease;
}

.level-card.current .reward-img {
  transform: scale(1.15);
}

.level-card.locked .reward-img {
  filter: grayscale(100%);
  opacity: 0.6;
}

/* === Navbar === */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #fff; border-radius: 25px 25px 0 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
  display: flex; justify-content: space-around;
  padding: 8px 0; z-index: 1000;
}
.bottom-nav a {
  color: #888; text-decoration: none; font-size: 20px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px; transition: color .25s, transform .25s;
}
.bottom-nav a.active { color: #28a745; animation: bounce 0.4s ease; }
@keyframes bounce { 0%{transform:translateY(0);}30%{transform:translateY(-6px);}60%{transform:translateY(2px);}100%{transform:translateY(0);} }

footer { background: transparent; color: #fff; text-align: center; padding-bottom: 80px; font-size: 14px; }

/* === Notifications === */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.notification {
  background: #fff;
  color: #333;
  border-left: 6px solid #28a745;
  padding: 15px 20px;
  margin-bottom: 10px;
  border-radius: 14px;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.5s ease forwards;
  cursor: pointer;
  min-width: 250px;
  max-width: 320px;
  transition: transform 0.2s ease;
}
.notification:hover { transform: scale(1.03); }

.notification.bonus {
  background: linear-gradient(135deg, #fff3cd, #ffeeba);
  border-left-color: #f39c12;
  font-weight: bold;
}

@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(100%); } }

/* === Classement - Images des vendeurs === */
.leaderboard-img {
  width: 90px; height: 90px; border-radius: 50%;
  object-fit: cover; border: 3px solid #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}
.leaderboard-img:hover { transform: scale(1.1); }

/* === Animation Fade-Up === */
.fade-up {
  opacity: 0; transform: translateY(20px);
  animation: fadeUp 0.8s ease forwards;
}
.fade-up:nth-child(1){animation-delay:0.2s;}
.fade-up:nth-child(2){animation-delay:0.4s;}
@keyframes fadeUp { to {opacity:1;transform:translateY(0);} }

/* === Dashboard amélioration visuelle === */
#dashboard h5 {
  margin-top: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* === Progress Card === */
.progress-card {
  background: #ffffffcc;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  animation: fadeUp 0.6s ease;
  padding: 15px;
  text-align: center;
}
.gift-img {
  width: 40px; height: 40px;
  border-radius: 8px; object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.progress-card .progress {
  border-radius: 20px;
  overflow: hidden;
}
.progress-card small {
  display: block;
  margin-top: 5px;
  font-size: 0.85rem;
  color: #333;
}
