* {
  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;
}

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

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

#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-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-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;
}
/* 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-desc {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  line-height: 1.2;
}

#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;
}



/* Conteneur pour permettre de superposer un cadenas si besoin */
.img-wrapper {
  position: relative;
  overflow: hidden;
  /*background: #000;*/ /* Fond noir pour le flou */
}

/* La classe qui floute l'image */
.photo-blurred {
  filter: blur(35px) brightness(0.3) grayscale(0.5);
  transform: scale(1.1); /* Évite les bords blancs dus au flou */
  pointer-events: none; /* Empêche de cliquer sur la photo floue */
  transition: filter 0.4s ease;
}

/* =========================================
   TOAST DISCRET (easter egg "Voyages")
   ========================================= */
.secret-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 10px);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 8px 16px;
  border-radius: 4px;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  opacity: 0;
  z-index: 10001;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.secret-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}


/* =========================================================
   GALERIE V2 — OVERRIDES UNIQUEMENT
   À placer à la fin de style.css
   Aucun changement HTML / JS nécessaire.
   ========================================================= */

/* Le conteneur ouvert devient une vraie zone éditoriale */
.city-gallery-container.active {
  background: linear-gradient(180deg, #f5f7fa 0%, #eef1f5 100%);
  border-left: 0;
  margin: 8px 0 24px;
  padding: 14px;
  border-radius: 0 0 16px 16px;
}

/* Chaque journée devient un petit "chapitre" de galerie */
.day-block {
  margin: 0 0 22px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.day-block:last-child {
  margin-bottom: 2px;
}

/* Date : plus légère et plus moderne */
.day-title {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 0 11px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.10);
  color: #1f2937;
  font-size: 0.78rem;
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-transform: none;
}

.day-title::before {
  content: "";
  width: 4px;
  height: 18px;
  margin-right: 9px;
  border-radius: 999px;
  background: #007AFF;
}

/* Grille : plus compacte, plus photo-centrée */
.photo-grid-2-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

/* Carte photo */
.photo-item {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.06),
    0 5px 16px rgba(15, 23, 42, 0.08);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.photo-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 3px 6px rgba(15, 23, 42, 0.08),
    0 10px 22px rgba(15, 23, 42, 0.12);
}

/* Image : cadrage homogène */
.photo-item img {
  display: block;
  width: 100%;
  height: 148px !important;
  max-height: none;
  object-fit: cover !important;
  object-position: center;
  border: 0;
  border-radius: 0;
  background: #e9edf2;
  cursor: pointer;
  transition:
    transform 0.45s cubic-bezier(.2,.7,.2,1),
    filter 0.25s ease;
}

.photo-item:hover img {
  transform: scale(1.035);
}

/* Quelques formats variés pour éviter l'effet grille monotone */
.photo-grid-2-cols .photo-item:nth-child(5n + 1) img {
  height: 190px !important;
}

.photo-grid-2-cols .photo-item:nth-child(7n + 2) img {
  height: 132px !important;
}

/* Première photo du jour mise légèrement en avant */
.photo-grid-2-cols .photo-item:first-child {
  grid-column: span 2;
}

.photo-grid-2-cols .photo-item:first-child img {
  height: 220px !important;
}

/* Description : vrai bandeau de légende */
.photo-desc {
  margin: 0;
  padding: 8px 10px 9px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.96);
  font-size: 10.5px;
  line-height: 1.35;
  font-weight: 500;
}

/* Les photos sans description restent parfaitement propres */
.photo-item img:last-child {
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}

.photo-item:not(:has(.photo-desc)) img {
  border-radius: 12px;
}

/* Séparation plus naturelle entre les journées */
.day-block + .day-block {
  padding-top: 6px;
}

/* Mode privé / photos floutées */
.photo-blurred {
  filter: blur(24px) brightness(0.38) grayscale(0.35);
  transform: scale(1.08);
}

.photo-item:hover .photo-blurred {
  transform: scale(1.08);
}

/* Scrollbar de la sidebar plus discrète */
#content-section::-webkit-scrollbar {
  width: 7px;
}

#content-section::-webkit-scrollbar-track {
  background: transparent;
}

#content-section::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.28);
  border-radius: 999px;
}

#content-section::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.42);
}

/* Petit effet d'apparition lorsque la galerie s'ouvre */
.city-gallery-container.active .day-block {
  animation: galleryDayIn 0.42s ease both;
}

.city-gallery-container.active .day-block:nth-child(2) {
  animation-delay: 0.04s;
}

.city-gallery-container.active .day-block:nth-child(3) {
  animation-delay: 0.08s;
}

.city-gallery-container.active .day-block:nth-child(4) {
  animation-delay: 0.12s;
}

@keyframes galleryDayIn {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile : la galerie reste respirante */
@media (max-width: 520px) {
  .city-gallery-container.active {
    padding: 11px;
  }

  .photo-grid-2-cols {
    gap: 8px;
  }

  .photo-item img {
    height: 126px !important;
  }

  .photo-grid-2-cols .photo-item:nth-child(5n + 1) img,
  .photo-grid-2-cols .photo-item:nth-child(7n + 2) img {
    height: 126px !important;
  }

  .photo-grid-2-cols .photo-item:first-child img {
    height: 178px !important;
  }

  .photo-desc {
    padding: 7px 8px 8px;
    font-size: 10px;
  }
}
