/**
 * 🗺️ CARTE INTERACTIVE CUISINIERS
 * Styles pour la carte Leaflet et les filtres
 */

/* Section principale */
.map-section {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  margin: 3rem 0;
  min-height: 600px;
}

/* Panel de filtres */
.filters-panel {
  background: var(--surface-card, white);
  border: 1px solid var(--border-subtle, #E2E8DD);
  border-radius: var(--radius-card, 12px);
  padding: 2rem;
  box-shadow: var(--shadow-md, 0 2px 8px rgba(0, 0, 0, 0.1));
  height: fit-content;
  position: sticky;
  top: 2rem;
}

.filters-panel h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.5rem;
  color: var(--text-dark, #333);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-gray, #555);
  font-size: 0.95rem;
}

.filter-group label i {
  color: var(--primary, #06C167);
  margin-right: 0.3rem;
}

.filter-input,
.filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: var(--primary, #06C167);
  box-shadow: var(--shadow-focus-soft, 0 0 0 3px rgba(6, 193, 103, 0.14));
}

.filter-input::placeholder {
  color: #999;
}

.filter-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--primary, #06C167) 0%, var(--primary-dark, #047A45) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.filter-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary, #06C167);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.filter-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--primary, #06C167);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-location {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--primary, #06C167), var(--primary-dark, #047A45));
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-location:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 193, 103, 0.24);
}

.btn-location:active {
  transform: translateY(0);
}

.btn-location i {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.location-status {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
}

.location-status.success {
  background: #d4edda;
  color: #155724;
}

.location-status.error {
  background: #f8d7da;
  color: #721c24;
}

.btn-reset {
  width: 100%;
  padding: 0.75rem;
  background: #f5f5f5;
  color: var(--text-gray, #666);
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.btn-reset:hover {
  background: #e0e0e0;
  border-color: #ccc;
}

.results-count {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: var(--primary-dark, #047A45);
}

/* Conteneur de la carte */
.map-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  height: 600px;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.chef-map-marker {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--primary, #06C167);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 16px;
}

.map-legend {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  display: flex;
  gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.legend-marker {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Section cuisiniers */
.cuisiniers-section {
  margin-top: 3rem;
}

.cuisiniers-section h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
  text-align: center;
}

/* Popup personnalisée */
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 1rem;
  min-width: 250px;
}

.popup-chef {
  text-align: center;
}

.popup-chef-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
  border: 3px solid var(--primary, #06C167);
}

.popup-chef-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.popup-chef-specialties {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.75rem;
}

.popup-chef-rating {
  display: inline-block;
  background: var(--primary-soft, #EAFBF3);
  color: var(--primary-dark, #047A45);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 1rem;
}

.popup-chef-dishes {
  max-height: 150px;
  overflow-y: auto;
  margin: 1rem 0;
  text-align: left;
  padding: 0.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.popup-dish {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.popup-dish:last-child {
  border-bottom: none;
}

.popup-dish-name {
  font-weight: 600;
  color: #333;
  display: block;
}

.popup-dish-category {
  font-size: 0.85rem;
  color: #666;
}

.popup-dish-price {
  float: right;
  color: var(--primary-dark, #047A45);
  font-weight: 700;
}

.popup-empty,
.popup-dishes-title {
  display: block;
  text-align: center;
}

.popup-empty {
  margin: 0;
  color: var(--text-light, #999);
}

.popup-dishes-title {
  margin-bottom: 0.5rem;
}

.btn-view-chef {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, var(--primary, #06C167), var(--primary-dark, #047A45));
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

.btn-view-chef:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 193, 103, 0.24);
}

/* Responsive */
@media (max-width: 968px) {
  .map-section {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    position: static;
  }

  .map-container {
    height: 400px;
  }
}

@media (max-width: 576px) {
  .filters-panel {
    padding: 1.5rem;
  }

  .filters-panel h2 {
    font-size: 1.3rem;
  }

  .map-container {
    height: 350px;
  }

  .map-legend {
    bottom: 10px;
    right: 10px;
    padding: 0.75rem;
    font-size: 0.85rem;
  }
}

/* Animation de chargement */
.loading {
  text-align: center;
  padding: 3rem;
  color: #666;
  font-size: 1.2rem;
}

/* Marker cluster personnalisé */
.marker-cluster {
  background: rgba(255, 107, 53, 0.6);
  border-radius: 50%;
  text-align: center;
  color: white;
  font-weight: 700;
}

.marker-cluster div {
  background: rgba(255, 107, 53, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
