/* ----------------------------- */
/* Reset et styles de base */
/* ----------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'papyrus', sans-serif;
  line-height: 1.6;
}

/* ----------------------------- */
/* Styles pour la page configurateur */
/* ----------------------------- */
.body-configurateur {
  background: url('img/fond.png') no-repeat center center fixed ;
  min-height: 100vh;
  background-size: cover;
  background-size: 120%;
    padding: 20px;
  color: white;
}

.body-configurateur h1 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.accueil {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .accueil {
    flex-direction: row-reverse;
    align-items: flex-start;
    justify-content: center;
  }
}

/* ----------------------------- */
/* Preview du personnage */
/* ----------------------------- */
.preview-index {
  position: relative;
  width: 282.51px;
  height: 808.65px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 5%;
}

#playerName {
  position: absolute;
  top: 20px;
  left: 17%;
  transform: translateY(-110%);
  z-index: 10;
  color: #ffffff;
  font-weight: bold;
  font-size: 24px;
  text-align: center;
  padding: 10px 20px;
  min-width: 150px;
}

.layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ----------------------------- */
/* Formulaire de configuration */
/* ----------------------------- */
.config {
  background: rgba(49, 135, 143, 0.303);
  border-radius: 20px;
  padding: 30px;
  border: 2px solid rgb(225, 96, 26);
  min-width: 300px;
  max-width: 400px;
  margin-top: 8%;
}

.config label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  color: white;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.config input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  color: #333;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.config input[type="text"]:focus {
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.5);
}

/* ----------------------------- */
/* Palettes de couleurs */
/* ----------------------------- */
.palette {
  display: flex;
  gap: 10px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.color-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.color-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.color-btn.active {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px white, 0 4px 12px rgba(0,0,0,0.4);
}

.color-btn[data-color]::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.color-btn.active[data-color]::after {
  border-color: white;
}

/* Styles spécifiques pour les boutons de couleur personnalisée */
.color-btn:not([data-color]) {
  background-color: #764ba2;
  color: white;
  font-weight: bold;
}

/* ----------------------------- */
/* Inputs de couleur cachés */
/* ----------------------------- */
input[type="color"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* ----------------------------- */
/* Bouton d'envoi */
/* ----------------------------- */
.submit-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  background: linear-gradient(135deg, #ff7979, #f9691e);
}

.submit-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* ----------------------------- */
/* Styles pour la page d'affichage */
/* ----------------------------- */
.body-affichage {
  background: url('img/fond_configurateur.png') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: 100vh;
}

/* Container principal */
#charactersContainer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

h2{
  color: white;
  text-align: center;
  margin-bottom: 20px;
  font-size: 24px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 20px;
  border-radius: 12px;
  display: inline-block;
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 100;
}
/* Carte de personnage */
.character-card {
  position: absolute;
}

/* Plans et animations */
@keyframes marchePlan1 {
  0% { 
    transform: translateX(-200px) translateY(540px) scale(1); 
    opacity: 1; 
  }
  100% { 
    transform: translateX(110vw) translateY(540px) scale(1); 
    opacity: 1; 
  }
}

@keyframes marchePlan2 {
  0% { 
    transform: translateX(-200px) translateY(450px) scale(0.8); 
    opacity: 1; 
  }
  100% { 
    transform: translateX(110vw) translateY(450px) scale(0.8); 
    opacity: 1; 
  }
}
/* Appliquer l’animation selon le plan */
.character-card.plan1 {
  animation: marchePlan1 20s linear infinite;
}

.character-card.plan2 {
  animation: marchePlan2 25s linear infinite;
}

/* Animation balancement marche du SVG */
.svg-container {
  animation: balancementMarche 0.8s ease-in-out infinite;
  width: 80px; /* taille du personnage */
  height: 120px;
}

@keyframes balancementMarche {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  25% { transform: translateY(-3px) rotate(1deg); }
  50% { transform: translateY(0) rotate(-1deg); }
  75% { transform: translateY(-2px) rotate(1deg); }
}

/* Indicateur de chargement */
.loading-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  z-index: 10000;
  font-size: 14px;
}

.loading-indicator::after {
  content: ' 🔄';
}

.loading-indicator.loaded::after {
  content: ' ✅';
}