/* === FORMULAIRE Igloups - Styles personnalisés === */

/* Masquer le titre WordPress par défaut */
.entry-title {
  display: none !important;
}

/* Conteneur centré */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1em;
}

/* Titre global du formulaire */
.form-title {
  font-size: 1.4rem; /* Réduit */
  font-weight: bold;
  text-align: center;
  margin: 0.5em 0 0.8em 0;
  color: #333;
}

/* === Barre de progression avec icônes === */
/* ✅ Support des deux syntaxes : .steps-progress ET .igloups-steps-progress */
.steps-progress,
.igloups-steps-progress {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap; /* On force une seule ligne */
  max-width: 100%;
  margin: 0 auto 1.5em;
  text-align: center;
}

/* ✅ Support des deux syntaxes : .step-item ET .igloups-step-item */
.step-item,
.igloups-step-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ✅ Support des deux syntaxes pour les cercles */
.step-circle,
.igloups-step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ccc; /* ← Couleur grise par défaut */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4em;
  transition: background 0.3s ease;
}

/* ✅ RÈGLE ACTIVE - Support des deux syntaxes */
.step-item.active .step-circle,
.step-item.active .igloups-step-circle,
.igloups-step-item.active .step-circle,
.igloups-step-item.active .igloups-step-circle {
  background: #0056b3; /* Couleur bleue pour l'étape active */
}

/* ✅ Support des deux syntaxes pour le texte */
.step-text,
.igloups-step-text {
  font-size: 0.85rem;
  color: #333;
}

/* Ajoute la numérotation via data-step */
.step-text::before,
.igloups-step-text::before {
  content: attr(data-step) ". ";
  font-weight: bold;
  margin-right: 2px;
}

/* === Responsive pour mobile === */
@media (max-width: 480px) {
  .steps-progress,
  .igloups-steps-progress {
    gap: 0.3em;
  }
  .step-circle,
  .igloups-step-circle {
    width: 28px;
    height: 28px;
  }
  .step-text,
  .igloups-step-text {
    font-size: 0.7rem;
  }
}

/* === Champs du formulaire === */
#igloups-releve-form input[type="text"],
#igloups-releve-form input[type="number"],
#igloups-releve-form select,
#igloups-releve-form textarea {
  width: auto;
  max-width: 140px;
  padding: 0.5em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

#igloups-releve-form input[type="datetime-local"] {
  width: 16em;
  min-width: 12em;
  padding: 0.5em;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Largeurs spécifiques */
#igloups-releve-form input.shortest { width: 8ch; }
#igloups-releve-form input.short    { width: 10ch; }
#igloups-releve-form input.medium   { width: 16ch; }
#igloups-releve-form input.long,
#igloups-releve-form select.long    { width: 200px; }
#igloups-releve-form input[type="datetime-local"].long { width: 250px; }

/* Organisation verticale */
#igloups-releve-form p {
  display: flex;
  flex-direction: column;
  margin-bottom: 1em;
}

/* Labels */
#igloups-releve-form label {
  margin-bottom: 0.25em;
  font-weight: bold;
  font-size: 0.95em;
}

/* Groupes horizontaux */
#igloups-releve-form .form-col {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1em;
  margin-bottom: 1em;
}

/* Latitude et longitude */
#latitude,
#longitude {
  width: 12ch;
}

/* Boutons */
#igloups-releve-form button {
  background: #0056b3;
  color: #fff;
  border: none;
  padding: 0.6em 1.2em;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  margin-top: 0.5em;
}
#igloups-releve-form button:hover {
  background: #003f8a;
}

/* === STYLES BOUTONS OVERPASS AMÉLIORÉS === */

/* Container en grid pour les boutons */
.overpass-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75em;
  margin-bottom: 1.5em;
}

/* Style de base des boutons de sélection */
.overpass-item {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  color: #495057;
  padding: 0.75em 1em;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Effet hover sur les boutons */
.overpass-item:hover {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

/* Style du bouton sélectionné */
.overpass-item.selected-overpass-item {
  background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
  border-color: #1976d2;
  color: white;
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.overpass-item.selected-overpass-item:hover {
  background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
  border-color: #1565c0;
  color: white;
}

/* Bouton de réinitialisation */
.clear-overpass-selection {
  background: #fff3e0;
  border: 2px solid #ffb74d;
  color: #e65100;
  padding: 0.6em 1.2em;
  border-radius: 6px;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1em;
  /* ✅ MASQUÉ par défaut */
  opacity: 0;
  transform: translateY(-10px);
  visibility: hidden;
  max-height: 0;
  overflow: hidden;
}

/* ✅ Visible quand classe 'show' ajoutée */
.clear-overpass-selection.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  max-height: 50px;
}

.clear-overpass-selection:hover {
  background: #ffe0b2;
  border-color: #ff9800;
  color: #bf360c;
  transform: translateY(-1px);
}

/* Animation d'apparition du bouton réinitialiser */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.clear-overpass-selection.show {
  animation: slideInUp 0.3s ease-out;
}

/* === Responsive design === */
@media (max-width: 600px) {
  .overpass-buttons-grid {
    grid-template-columns: 1fr;
    gap: 0.5em;
  }
  
  .overpass-item {
    padding: 0.6em 0.8em;
    font-size: 0.85em;
    min-height: 42px;
  }
  
  .clear-overpass-selection {
    padding: 0.5em 1em;
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  .overpass-buttons-grid {
    margin-bottom: 1em;
  }
  
  .overpass-item {
    padding: 0.5em 0.7em;
    font-size: 0.8em;
    min-height: 40px;
  }
}

/* === Container Overpass avec style amélioré === */
#overpass-results-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.2em;
  margin: 1em 0;
  border-left: 4px solid #17a2b8;
}

#overpass-results-container:empty {
  display: none;
}

/* Animation pour l'apparition du container */
#overpass-results-container {
  animation: fadeInScale 0.4s ease-out;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Message quand aucun résultat */
#overpass-results-container p:only-child {
  margin: 0;
  text-align: center;
  color: #6c757d;
  font-style: italic;
}

/* === Amélioration générale des boutons du formulaire === */
#igloups-releve-form button:not(.overpass-item):not(.clear-overpass-selection) {
  transition: all 0.3s ease;
}

#igloups-releve-form button:not(.overpass-item):not(.clear-overpass-selection):hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 86, 179, 0.3);
}