/* ===== CARTES DE DÉFIS (page defis.html) ===== */

.challenge-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.challenge-card__title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 700;
  width: 100%;
  color: var(--text);
}

.challenge-card__desc {
  margin: 0 0 16px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  width: 100%;
}

/* ===== TROPHÉES DANS LES CARTES DE DÉFIS ===== */

.challenge-trophy {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.challenge-trophy__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

/* Trophée verrouillé (grisé) */
.challenge-trophy--locked .challenge-trophy__img {
  filter: grayscale(100%) brightness(0.6) opacity(0.4);
}

/* Trophée débloqué (coloré et illuminé) */
.challenge-trophy--unlocked .challenge-trophy__img {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
  animation: trophyGlow 2s ease-in-out infinite;
}

/* Effet de lueur derrière le trophée débloqué */
.challenge-trophy__glow {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  animation: pulseGlow 2s ease-in-out infinite;
  z-index: 1;
}

/* ===== BARRE DE PROGRESSION ===== */

.challenge-progress {
  margin: 0 0 16px 0;
  width: 100%;
}

.challenge-progress__bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.challenge-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.challenge-progress__text {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

/* ===== STATUT ET BOUTON ===== */

.challenge-card__status--success {
  background: rgba(76, 175, 80, 0.2);
  color: #4caf50;
  border: 2px solid #4caf50;
  padding: 12px 20px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  width: 100%;
}

.challenge-card__btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.challenge-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===== ANIMATIONS ===== */

@keyframes trophyGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.9));
    transform: scale(1.05);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.5;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.2);
  }
}

/* Hover effect sur trophée débloqué */
.challenge-trophy--unlocked:hover .challenge-trophy__img {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.9));
}

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

@media (max-width: 768px) {
  .challenge-trophy {
    width: 70px;
    height: 70px;
  }

  .challenge-card__title {
    font-size: 18px;
  }

  .challenge-card__desc {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .challenge-card {
    padding: 16px;
  }

  .challenge-trophy {
    width: 60px;
    height: 60px;
  }

  .challenge-card__title {
    font-size: 16px;
  }

  .challenge-card__desc {
    font-size: 12px;
  }

  .challenge-progress__bar {
    height: 8px;
  }
}

/* ===== MODE CLAIR ===== */

body.light-mode .challenge-card {
  background: #ffffff;
  color: #111827;
  border-color: #e5e7eb;
}

body.light-mode .challenge-card__title {
  color: #111827;
}

body.light-mode .challenge-card__desc {
  color: #6b7280;
}

body.light-mode .challenge-progress__bar {
  background: #e5e7eb;
}

body.light-mode .challenge-progress__text {
  color: #6b7280;
}

body.light-mode .challenge-card__status--success {
  background: rgba(76, 175, 80, 0.1);
  color: #4caf50;
  border-color: #4caf50;
}
