/*
 * Food Truck Emplacements - Styles CSS
 * Version: 1.0.0
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
  --primary-color: #FF6B35;
  --primary-dark: #E55A2B;
  --primary-light: #FF8A5C;
  --text-dark: #2C3E50;
  --text-medium: #5D6D7E;
  --text-light: #85929E;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.12);
  --border-radius: 12px;
  --border-radius-small: 8px;
  --transition: all 0.3s ease;
}

/* ============================================
   SECTION PRINCIPALE
   ============================================ */
.foodtruck-map-section {
  padding: 2rem;
  max-width: 1400px;
  margin: 2rem auto;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
}

.foodtruck-map-section h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin: 0 0 2rem 0;
  position: relative;
}

.foodtruck-map-section h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

/* ============================================
   LAYOUT DEUX COLONNES
   ============================================ */
.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.emplacements-column {
  display: flex;
  flex-direction: column;
}

.map-column {
  position: sticky;
  top: 2rem;
}

/* ============================================
   CARTE
   ============================================ */
.map-container {
  position: relative;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-medium);
  height: 100%;
}

#map {
  height: 500px;
  width: 100%;
  border: none;
}

.map-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-medium);
}

.map-loader {
  width: 30px;
  height: 30px;
  border: 3px solid var(--bg-secondary);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ============================================
   LISTE DES EMPLACEMENTS
   ============================================ */
.liste-emplacements {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.liste-emplacements::-webkit-scrollbar {
  width: 4px;
}

.liste-emplacements::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 2px;
}

.liste-emplacements::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 2px;
}

.liste-emplacements li {
  background: var(--bg-primary);
  border-radius: var(--border-radius-small);
  padding: 0.6rem;
  box-shadow: var(--shadow-light);
  border-left: 3px solid var(--primary-color);
  transition: var(--transition);
  cursor: pointer;
}

.liste-emplacements li:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
  border-left-color: var(--primary-dark);
}

/* ============================================
   CONTENU DES EMPLACEMENTS
   ============================================ */
.emplacement-content {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.emplacement-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.emplacement-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.emplacement-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.emplacement-day {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin: 0;
  flex-shrink: 0;
}

.emplacement-time {
  font-weight: 500;
  color: var(--primary-color);
  font-size: 0.8rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.emplacement-address {
  color: var(--text-medium);
  font-size: 0.8rem;
  margin-top: 0;
}

/* ============================================
   JOURS DE REPOS
   ============================================ */
.jour-repos {
  opacity: 0.6;
  border-left-color: var(--text-light) !important;
}

.jour-repos .repos-icon {
  background: linear-gradient(135deg, var(--text-light), var(--text-medium)) !important;
}

.jour-repos .emplacement-day {
  color: var(--text-medium) !important;
}

.jour-repos .repos-text {
  color: var(--text-light) !important;
  font-style: italic;
}

.jour-repos .repos-subtext {
  color: var(--text-light) !important;
  font-size: 0.75rem;
}

/* ============================================
   POPUP CARTE
   ============================================ */
.leaflet-popup-content-wrapper {
  border-radius: var(--border-radius-small) !important;
  box-shadow: var(--shadow-medium) !important;
  border: none !important;
}

.leaflet-popup-content {
  margin: 0.75rem !important;
  color: var(--text-dark) !important;
}

.leaflet-popup-content strong {
  color: var(--primary-color) !important;
  font-weight: 600 !important;
  display: block !important;
  margin-bottom: 0.25rem !important;
}

/* ============================================
   ÉTATS VIDES
   ============================================ */
.no-locations {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-medium);
  grid-column: 1 / -1;
}

.no-locations-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.no-locations-text {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.no-locations-subtext {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablettes et mobiles (968px et moins) */
@media (max-width: 968px) {
  .content-wrapper {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .map-column {
    position: static !important;
    order: -1;
  }

  .emplacements-column {
    order: 1;
  }

  .liste-emplacements {
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0;
  }

  #map {
    height: 350px;
  }
}

/* Tablettes (768px et moins) */
@media (max-width: 768px) {
  .foodtruck-map-section {
    padding: 1.5rem 1rem;
    margin: 1rem;
  }

  .foodtruck-map-section h2 {
    margin-bottom: 1.5rem;
  }

  .content-wrapper {
    gap: 1.25rem;
  }

  #map {
    height: 300px;
  }

  .liste-emplacements {
    gap: 0.5rem;
  }

  .liste-emplacements li {
    padding: 0.65rem;
  }
}

/* Mobiles (480px et moins) */
@media (max-width: 480px) {
  .foodtruck-map-section {
    padding: 1rem;
    margin: 0.5rem;
  }

  .foodtruck-map-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .content-wrapper {
    gap: 1rem;
  }

  #map {
    height: 250px;
  }

  .emplacement-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .emplacement-content {
    gap: 0.5rem;
  }

  .emplacement-icon {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .liste-emplacements li {
    padding: 0.5rem;
    border-left-width: 2px;
  }

  .emplacement-day {
    font-size: 0.9rem;
  }

  .emplacement-time {
    font-size: 0.75rem;
  }

  .emplacement-address {
    font-size: 0.75rem;
  }

  .jour-repos .repos-subtext {
    font-size: 0.7rem;
  }
}

/* ============================================
   ACCESSIBILITÉ ET PRINT
   ============================================ */
.liste-emplacements li:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

@media print {
  .foodtruck-map-section {
    box-shadow: none;
    background: white;
  }

  #map {
    display: none;
  }

  .content-wrapper {
    grid-template-columns: 1fr;
  }
}
