/**
 * TCF INVITATION REWARDS — Styles des récompenses dopamine
 * Couleurs du mariage + Interactions enrichies + Enveloppe améliorée
 */

/* ═════════════════════════════════════════════════════════════════════════════
   WEDDING THEME COLORS — Variables dynamiques
   ═════════════════════════════════════════════════════════════════════════════ */

/* Les couleurs du mariage sont définies par JavaScript sur :root
   --tch-primary, --tch-secondary, --tch-accent, --tch-bg */

/* ═════════════════════════════════════════════════════════════════════════════
   ENVELOPE REWARDS — Améliorations de l'enveloppe
   ═════════════════════════════════════════════════════════════════════════════ */

/* Sceau avec effet hover */
.env2-seal {
  position: relative;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.env2-seal--hover {
  transform: scale(1.15);
  box-shadow: 0 0 30px color-mix(in srgb, var(--tch-primary, #1E2A5A) 60%, transparent);
}

.env2-seal--pulse {
  animation: seal-pulse 0.3s ease-out;
}

@keyframes seal-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Halo du sceau */
.env2-seal-halo {
  position: absolute;
  inset: -10px;
  border: 2px solid var(--tch-primary);
  border-radius: 50%;
  animation: halo-expand 1s ease-out forwards;
  pointer-events: none;
}

@keyframes halo-expand {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Portraits interactifs */
.env2-card__portrait {
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.env2-card__portrait:hover {
  transform: scale(1.1);
}

.env2-card__portrait:active {
  transform: scale(0.95);
}

/* ═════════════════════════════════════════════════════════════════════════════
   INTERACTION BADGES — Badges de récompense
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-interaction-badge {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tch-primary) 95%, transparent), color-mix(in srgb, var(--tch-primary) 90%, transparent));
  color: var(--tch-bg);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 10px 40px color-mix(in srgb, var(--tch-primary, #1E2A5A) 40%, transparent);
  z-index: 10001;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.inv-interaction-badge.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* ═════════════════════════════════════════════════════════════════════════════
   SECRET MESSAGES — Messages cachés
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-secret-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tch-primary) 95%, transparent), color-mix(in srgb, var(--tch-primary) 90%, transparent));
  color: var(--tch-bg);
  padding: 20px 40px;
  border-radius: 50px;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: 0 20px 60px color-mix(in srgb, var(--tch-primary, #1E2A5A) 50%, transparent);
  z-index: 10002;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inv-secret-message.is-visible {
  transform: translate(-50%, -50%) scale(1);
}

/* ═════════════════════════════════════════════════════════════════════════════
   MINI CONFETTI — Particules de récompense
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-mini-confetti,
.inv-wedding-confetti,
.chapter-micro-confetti {
  will-change: transform, opacity;
}

/* ═════════════════════════════════════════════════════════════════════════════
   BUTTON RIPPLE — Effet ripple sur les boutons
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-button-ripple {
  position: absolute;
  border-radius: 50%;
  opacity: 0.4;
  transform: scale(0);
  transition: transform 0.6s ease-out, opacity 0.6s ease-out;
  pointer-events: none;
}

.inv-button-ripple.is-animating {
  transform: scale(4);
  opacity: 0;
}

/* ═════════════════════════════════════════════════════════════════════════════
   CHAPTER BADGES — Badges de chapitre
   ═════════════════════════════════════════════════════════════════════════════ */

.chapter-badge-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.chapter-badge {
  background: linear-gradient(135deg, color-mix(in srgb, var(--tch-primary) 95%, transparent), color-mix(in srgb, var(--tch-primary) 90%, transparent));
  color: var(--tch-bg);
  padding: 12px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--tch-primary, #1E2A5A) 40%, transparent);
  transform: translateX(150%);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.chapter-badge.is-visible {
  transform: translateX(0);
  opacity: 1;
}

.chapter-badge i {
  margin-right: 6px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   CHAPTER COMPLETION — Overlay de complétion
   ═════════════════════════════════════════════════════════════════════════════ */

.chapter-completion-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--tch-primary, #1E2A5A) 95%, transparent);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.chapter-completion-overlay.is-visible {
  opacity: 1;
}

.chapter-completion-content {
  text-align: center;
  color: white;
  padding: 40px;
  transform: scale(0.8);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chapter-completion-overlay.is-visible .chapter-completion-content {
  transform: scale(1);
}

.chapter-completion-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: trophy-bounce 1s ease-in-out infinite;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.chapter-completion-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--tch-bg);
  margin-bottom: 12px;
}

.chapter-completion-text {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ═════════════════════════════════════════════════════════════════════════════
   COLOR PALETTE — Améliorations de la palette de couleurs
   ═════════════════════════════════════════════════════════════════════════════ */

.inv2-palette__swatch {
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inv2-palette__swatch:hover {
  transform: translateY(-5px);
}

.inv2-palette__swatch--copied {
  animation: swatch-copied 0.3s ease;
}

@keyframes swatch-copied {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.inv2-palette__swatch--copied .inv2-palette__circle::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  animation: check-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes check-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.inv2-palette__circle {
  position: relative;
  transition: box-shadow 0.3s ease;
}

.inv2-palette__swatch:hover .inv2-palette__circle {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ═════════════════════════════════════════════════════════════════════════════
   DIRECTIONAL PARTICLES — Particules directionnelles
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-directional-particle {
  will-change: transform, opacity;
}

/* ═════════════════════════════════════════════════════════════════════════════
   HEART PARTICLES — Particules de cœur
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-heart-particle {
  will-change: transform, opacity;
}

/* ═════════════════════════════════════════════════════════════════════════════
   MAGNETIC BUTTONS — Améliorations des boutons magnétiques
   ═════════════════════════════════════════════════════════════════════════════ */

.magnetic-btn {
  position: relative;
  overflow: hidden;
}

.magnetic-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.magnetic-btn:hover::before {
  opacity: 1;
}

/* ═════════════════════════════════════════════════════════════════════════════
   IMAGE HOVER REWARDS — Récompenses au survol des images
   ═════════════════════════════════════════════════════════════════════════════ */

.inv2-tenue__card-img,
.inv-hero__bg img {
  transition: transform 8s ease;
}

.inv2-tenue__card:hover .inv2-tenue__card-img img,
.inv-hero:hover .inv-hero__bg img {
  transform: scale(1.05);
}

/* ═════════════════════════════════════════════════════════════════════════════
   MUSIC PLAYER — Améliorations du lecteur de musique
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-music-player__btn {
  position: relative;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inv-music-player__btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 25px color-mix(in srgb, var(--tch-primary, #1E2A5A) 40%, transparent);
}

.inv-music-player__btn:active {
  transform: scale(0.95);
}

.inv-music-player__btn.playing {
  animation: music-pulse 2s ease-in-out infinite;
}

@keyframes music-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tch-primary, #1E2A5A) 40%, transparent); }
  50% { box-shadow: 0 0 20px 5px color-mix(in srgb, var(--tch-primary, #1E2A5A) 20%, transparent); }
}

/* ═════════════════════════════════════════════════════════════════════════════
   STREAK INDICATOR — Indicateur de série
   ═════════════════════════════════════════════════════════════════════════════ */

.inv-streak-indicator {
  position: fixed;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tch-primary) 95%, transparent), color-mix(in srgb, var(--tch-primary) 90%, transparent));
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  z-index: 9998;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.inv-streak-indicator.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.inv-streak-counter {
  font-size: 1.2rem;
  margin-right: 4px;
}

/* ═════════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Adaptations mobile
   ═════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .chapter-badge-container {
    top: auto;
    bottom: 100px;
    right: 10px;
    left: auto;
  }
  
  .chapter-badge {
    font-size: 0.75rem;
    padding: 10px 16px;
  }
  
  .inv-interaction-badge {
    font-size: 0.85rem;
    padding: 10px 20px;
  }
  
  .inv-secret-message {
    font-size: 1.2rem;
    padding: 16px 32px;
  }
  
  .chapter-completion-title {
    font-size: 1.5rem;
  }
  
  .chapter-completion-text {
    font-size: 1rem;
  }
}

/* ═════════════════════════════════════════════════════════════════════════════
   PREFERS REDUCED MOTION — Respect des préférences
   ═════════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .env2-seal--pulse,
  .env2-seal-halo,
  .chapter-badge,
  .inv-interaction-badge,
  .inv-secret-message,
  .inv-button-ripple,
  .chapter-completion-overlay,
  .chapter-completion-content,
  .trophy-bounce {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
  
  .inv-mini-confetti,
  .inv-wedding-confetti,
  .chapter-micro-confetti,
  .inv-directional-particle,
  .inv-heart-particle {
    display: none !important;
  }
}
