/* STYLES MODAL ISOCHRONES - VERSION CORRIGÉE COMPLÈTE */

/* Réduction de l'espacement général */
.modal-body {
  padding: 1rem;
}

.iso-config-section {
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background-color: #f8f9fa;
}

.iso-config-section.compact-section {
  padding: 0.5rem;
  margin-bottom: 0.5rem;
}

.iso-config-section h6 {
  color: #495057;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}

/* Styles des onglets compacts */
.nav-tabs-compact {
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 0;
}

.nav-tabs-compact .nav-item {
  margin-bottom: -1px;
}

.nav-tabs-compact .nav-link {
  border: 1px solid transparent;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #495057;
  background-color: transparent;
  border-color: #dee2e6 #dee2e6 #fff;
}

.nav-tabs-compact .nav-link:hover {
  border-color: #e9ecef #e9ecef #dee2e6;
  isolation: isolate;
}

.nav-tabs-compact .nav-link.active {
  color: #495057;
  background-color: #fff;
  border-color: #dee2e6 #dee2e6 #fff;
}

.tab-content {
  border: none;
}

/* Layout pour mode calcul et transport sur la même ligne */
.calculation-transport-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.calculation-section,
.transport-section {
  flex: 1;
}

.calculation-section h6,
.transport-section h6 {
  margin-bottom: 0.4rem;
  font-size: 0.85rem;
}

/* Style spécial pour la section Mode de calcul avec fond gris */
.calculation-section {
  background-color: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
  padding: 0.75rem;
}

/* Options de transport */
.transport-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
}

.transport-option {
  position: relative;
  flex: 0 0 auto;
}

.transport-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

.transport-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  min-width: 85px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  user-select: none;
  text-align: center;
}

/* Boutons transport compacts */
.transport-button.compact {
  padding: 8px 12px;
  min-width: 70px;
  gap: 4px;
}

.transport-button.compact .transport-icon {
  font-size: 20px;
}

.transport-button.compact .transport-text {
  font-size: 12px;
}

.transport-icon {
  font-size: 24px;
  line-height: 1;
  color: #495057;
}

.transport-text {
  font-weight: 600;
  font-size: 13px;
  color: #212529;
}

.transport-button small {
  font-size: 11px;
  color: #6c757d;
  font-weight: 400;
}

/* États des radio buttons */
.transport-option input[type="radio"]:checked + .transport-button {
  background: #007bff;
  color: white;
  border-color: #007bff;
  box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.transport-option input[type="radio"]:checked + .transport-button .transport-icon {
  color: white;
}

.transport-option input[type="radio"]:checked + .transport-button .transport-text {
  color: white;
}

.transport-option input[type="radio"]:checked + .transport-button small {
  color: rgba(255, 255, 255, 0.8);
}

.transport-button:hover {
  border-color: #007bff;
  background: #f0f8ff;
}

/* Champs de zones compacts */
.zones-input-container {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.zone-input-wrapper {
  flex: 1;
  min-width: 80px;
}

.zone-input-wrapper label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #666;
  margin-bottom: 3px;
  text-align: center;
}

.zone-input-wrapper input {
  width: 100%;
  text-align: center;
  font-size: 13px;
  padding: 4px 6px;
  height: 32px;
}

/* Boutons de valeurs rapides compacts */
.quick-values {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.compact-quick-values {
  margin-bottom: 6px;
}

.quick-value-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  border: 1px solid #dee2e6;
  background: white;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.quick-value-btn.small {
  padding: 3px 6px;
  font-size: 0.7rem;
}

.zone-count-btn.active {
  background-color: #007bff;
  color: white;
  border-color: #007bff;
}

.zone-count-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.zone-count-btn.active:hover {
  background-color: #0056b3;
  border-color: #0056b3;
}

.quick-value-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

/* Status compact */
.status-info {
  font-size: 0.8rem;
  color: #6c757d;
  margin-top: 0.25rem;
  font-style: italic;
}

.compact-status {
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

/* Texte d'explication plus compact */
.alert.mb-3 {
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

/* Footer plus compact */
.modal-footer {
  padding: 0.75rem;
}

/* Alert compact pour les notes */
.compact-alert {
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  margin-bottom: 0;
}

.compact-alert small {
  font-size: 0.7rem;
}

/* STYLES POUR LA LÉGENDE DES ZONES */
.zones-legend {
  position: fixed;
  top: 100px;
  right: 20px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 15px;
  max-height: 500px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zones-legend h5 {
  margin: 0 0 10px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

/* STYLES POUR LES ÉLÉMENTS DE LÉGENDE */
.layer-item {
  margin-bottom: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 8px;
  background: #fafafa;
  transition: all 0.2s ease;
}

.layer-item:hover {
  background: #f0f0f0;
  border-color: #ddd;
}

.layer-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-indicator {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid #333;
  flex-shrink: 0;
}

.layer-item .name {
  flex-grow: 1;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.layer-controls {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.layer-controls input[type="color"] {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
}

.layer-controls button {
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 11px;
  color: #666;
  transition: all 0.2s ease;
  line-height: 1;
}

.layer-controls button:hover {
  background: #f0f0f0;
  border-color: #999;
  color: #333;
}

.layer-controls button:hover i {
  color: #dc3545;
}

/* ÉDITEUR DE STYLES */
.style-editor {
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
}

.style-editor .form-group {
  margin-bottom: 18px;
}

.style-editor label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.style-editor input, 
.style-editor select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.style-editor input:focus, 
.style-editor select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.style-editor input[type="range"] {
  padding: 0;
  height: 6px;
  background: #ddd;
  border-radius: 3px;
}

.style-editor input[type="color"] {
  height: 40px;
  padding: 4px;
  cursor: pointer;
}

/* VALEURS D'APERÇU POUR LES SLIDERS */
#stroke-width-value,
#stroke-opacity-value,
#fill-opacity-value {
  display: inline-block;
  margin-left: 8px;
  font-weight: 600;
  color: #007bff;
  font-size: 13px;
  min-width: 30px;
}

/* BARRE DE PROGRESSION */
.progress-container {
  margin-top: 1rem;
  display: none;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .calculation-transport-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .transport-options {
    justify-content: center;
    gap: 15px;
  }
  
  .transport-button {
    min-width: 80px;
    padding: 12px 15px;
  }
  
  .zones-legend {
    position: fixed;
    top: 10px;
    right: 10px;
    left: 10px;
    width: auto;
    min-width: auto;
  }
  
  .quick-values {
    justify-content: center;
  }
  
  .zones-input-container {
    flex-direction: column;
  }
  
  .zone-input-wrapper {
    min-width: auto;
  }
}

@media (max-width: 576px) {
  .modal-dialog {
    margin: 0.5rem;
  }
  
  .transport-button.compact {
    min-width: 60px;
    padding: 6px 8px;
  }
  
  .transport-button.compact .transport-icon {
    font-size: 18px;
  }
  
  .transport-button.compact .transport-text {
    font-size: 11px;
  }
  
  .transport-options {
    flex-direction: column;
  }
  
  .transport-button {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
    text-align: left;
  }
  
  .transport-icon {
    font-size: 24px;
  }
}