* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  height: 100vh;
}

#app {
  display: flex;
  height: 100vh;
}

#sidebar {
  width: 360px;
  background: #f7f7f7;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#sidebar section {
  padding: 16px;
}

#trip-section {
  border-bottom: 1px solid #ddd;
}

#trip-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#trip-list li {
  padding: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  border-radius: 6px;
}

#trip-list li:hover {
  background: #eaeaea;
}

#trip-list li.active {
  background: #d0e6ff;
  font-weight: bold;
}

#content-section {
  flex: 1;
  overflow-y: auto;
}

.placeholder {
  color: #666;
  font-style: italic;
}

.city {
  margin-bottom: 10px;
}
#content-section {
  scroll-behavior: smooth;
}

.city-wrapper {
  margin-bottom: 10px;
  transition: all 0.3s ease;
}
.city-card {
  position: relative;
  height: 212.6px; /*120px*/
  background-size: cover;
  background-position: center;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.city-header {
  padding: 10px;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.city-overlay {
  position: absolute;
  top: 0; left: 0; 
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  z-index: 1;
}
.city-header:hover {
  background: #eee;
}
.city-card:hover .city-overlay {
  background: rgba(0, 0, 0, 0.5);
}

.city-card:hover .city-name {
  color: #ffffff;
  text-shadow: none;
}
.city-name {
  position: relative;
  z-index: 2;
  color: #000;
  font-weight: 700;
  font-size: 1.2rem; 
  text-transform: none;
  text-shadow: 0 0 8px rgba(255,255,255,0.8);
  transition: color 0.3s ease;
}	
.city-gallery-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-out;
  background: #f9f9f9;
  border-radius: 0 0 12px 12px;
}
.city-gallery-container.active {
  max-height: none;
  background: #f0f2f5;
  border-left: 4px solid #ff0000;
  margin: 10px 0 20px 0;
  padding: 15px;
  border-radius: 0 0 10px 10px;
}
.city-gallery {
  margin-top: 8px;
  padding: 10px;
  background: white;
  border-radius: 6px;
}

.city-gallery img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.15s;
}
/* GESTION DES LABELS VILLES */
.city-label {
  background: transparent !important;
  border: none !important;
  opacity: 1; /* Par défaut visible */
  transition: opacity 0.3s ease; /* Transition douce */
}
/* Le style du texte dans le label (VOTRE STYLE ORIGINAL) */
.city-label span {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 13px;
  white-space: nowrap;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -110%);
  bottom: -120%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3); /* Petit ombrage pour la lisibilité */
}
/* Quand la carte a la classe "map-zoomed-out", on cache les labels */
.map-zoomed-out .city-label {
  opacity: 0;
  pointer-events: none; /* Empêche de cliquer dessus quand invisible */
}


.day-block {
  margin-bottom: 25px;
  background: white;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.day-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 10px;
  border-bottom: 2px solid #ff0000;
  display: inline-block;
  padding-bottom: 3px;
}
.photo-item {
  display: flex;
  flex-direction: column;
}
.photo-item img {
  height: auto !important; /* Laisse la hauteur s'adapter */
  max-height: 300px; /* Limite pour ne pas casser la page */
  object-fit: contain !important; /* Affiche l'image entière */
  width: 100%;
  image-orientation: from-image; /* Force le navigateur à respecter la rotation EXIF */
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #ddd;
  transition: transform 0.2s ease;
  /* OPTIMISATION PERF */
  content-visibility: auto;
  contain-intrinsic-size: 110px;
}
.photo-item img:hover {
  transform: scale(1.02);
  border-color: #ff0000;
}
.photo-grid-2-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.photo-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 10px;
}
.photo-grid-unified {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  padding: 10px;
}
.photo-item {
  border-bottom: 1px solid #f0f0f0;
  padding-bottom: 10px;
}
.photo-dot {
  width: 10px;
  height: 10px;
  background-color: #ffcc00;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,0.5);
}
.photo-desc {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  line-height: 1.2;
}

.city-gallery img:hover {
  transform: scale(1.05);
}

#map {
  flex: 1;
}
.custom-photo-popup .leaflet-popup-content {
  width: 600px !important;
}
.custom-photo-popup img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.leaflet-photo-popup {
  font-family: sans-serif;
}
.leaflet-photo-popup img {
  width: 100%;
  height: auto;
  max-height: 400px;
  display: block;
  border-radius: 4px;
}
.leaflet-popup-img {
  max-width: 500px !important;
  max-height: 400px !important;
  width: auto !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}
.popup-desc {
  font-weight: bold;
  margin-bottom: 6px;
}

.popup-img-wrapper {
  position: relative;
}

.popup-img-wrapper img {
  width: 100%;
  border-radius: 6px;
}

.popup-fullscreen-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
}

.popup-date {
  margin-top: 4px;
  font-size: 12px;
  color: #777;
  font-style: italic;
}

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.fullscreen-overlay img {
  max-width: 95%;
  max-height: 95%;
}

/* 2. STYLE HOTELS (Point 2) */
.custom-hotel-icon {
    background-color: white;
    border: 1.5px solid #333;
    border-radius: 4px; /* Carré légèrement arrondi */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
/* Style de la légende pour qu'elle soit plus discrète */
.info.legend {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px); /* Effet flou moderne */
    border: 1px solid #ccc;
    padding: 8px;
    font-weight: 500;
}
/* LEGENDE */
.info.legend i {
  width: 25px;       /* Plus large */
  height: 4px;       /* Très plat pour faire une ligne */
  border-radius: 2px;
  float: left;
  margin-right: 8px;
  margin-top: 7px;   /* Centrer verticalement par rapport au texte */
  opacity: 1;        /* Pleine couleur */
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
/* JOLIS MARQUEURS PHOTOS */
.photo-marker-icon {
    background: #007AFF; /* Bleu iOS/Moderne, plus élégant que le rouge */
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.7);
    cursor: pointer;
    transition: all 0.2s ease-out;
}
.photo-marker-icon:hover {
    filter: brightness(1.2);
}

.leaflet-control-layers input[type="range"] {
  width: 90%;
}


/* =========================================
   CUSTOM DROPDOWN (MODERNE)
   ========================================= */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
    margin-bottom: 20px;
    font-family: 'Segoe UI', sans-serif;
}
.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}
.custom-select-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px; /* Modifier le padding */
    height: 50px; /* Fixer une hauteur */
    font-size: 15px;
    font-weight: 500;
    color: #333;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.custom-select-trigger:hover {
    border-color: #007AFF;
    box-shadow: 0 4px 8px rgba(0,122,255,0.15);
}
.custom-options {
    position: absolute;
    top: 110%; /* Juste en dessous */
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-height: 300px;
    overflow-y: auto;
}
.custom-select.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}
.custom-option {
    position: relative;
    display: block;
    padding: 12px 15px;
    font-size: 14px;
    color: #444;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.2s;
}
.custom-option:last-child {
    border-bottom: none;
}
.custom-option:hover {
    background-color: #f0f7ff;
    color: #007AFF;
}
.custom-option.selected {
    background-color: #007AFF;
    color: #fff;
}
.arrow {
    font-size: 10px;
    transition: transform 0.3s;
    color: #888;
}
.custom-select.open .arrow {
    transform: rotate(180deg);
}



.trajet-popup-wrapper .leaflet-popup-content {
  margin: 0;
}

.trajet-popup {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  min-width: 280px;
  box-shadow: 0 12px 40px rgba(0,0,0,.18);
}

/* HEADER */
.trajet-header {
  padding: 14px 16px;
  font-size: 12px;
  letter-spacing: .08em;
  font-weight: 600;
  text-transform: uppercase;
  color: #fff;
}

.trajet-header.train   { background: #db0016; }
.trajet-header.avion   { background: #00dbc5; }
.trajet-header.bus     { background: #dbc500; color:#222; }
.trajet-header.voiture { background: #0016db; }
.trajet-header.bateau  { background: #0084db; }

/* BODY */
.trajet-body {
  padding: 16px;
}

.trajet-line {
  display: grid;
  grid-template-columns: 90px 1fr;
  font-size: 13px;
  margin-bottom: 6px;
}

.trajet-line span:first-child {
  color: #777;
}

.trajet-line span:last-child {
  color: #111;
  font-weight: 500;
}

/* SEPARATOR */
.trajet-separator {
  height: 1px;
  background: #eee;
  margin: 12px 0;
}

/* METRICS */
.trajet-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.trajet-metrics .label {
  display: block;
  font-size: 11px;
  color: #777;
}

.trajet-metrics .value {
  font-size: 15px;
  font-weight: 600;
  color: #111;
}

/* VOYAGE */
.trajet-voyage {
  margin-top: 14px;
  font-size: 12px;
  color: #666;
  border-top: 1px solid #eee;
  padding-top: 8px;
}
