@media (max-width: 500px) {
	.results-container {
		max-height: 250px !important;
	}
}

.maplibregl-popup-content {
	margin: px 2px 2px 2px !important;
	border-radius: 12px;
	padding: 0px 0px 0px 0px !important;
	width: 450px !important;
	max-height: 600px;
	overflow-y: auto;
}

.maplibregl-popup-close-button{
	position: absolute !important;
	top: 12px !important;
	right: 16px !important;
	background: rgba(255,255,255,0.2) !important;
	border: none !important;
	color: white !important;
	font-size: 18px !important;
	cursor: pointer !important;
	width: 24px !important;
	height: 24px !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

.maplibregl-popup-close-button:hover {
	background: rgba(255,255,255,0.4)!important;
}

.mapboxgl-popup, .maplibregl-popup {
z-index:999 !important;
}

@media (max-width: 500px) {
.maplibregl-popup-content {
	width: 350px !important;
	max-height: 80% !important;
	}	
}

.popup-container {
	max-height: 600px;
	background: white;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.15);
	overflow: hidden;
}

.popup-header {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 16px 20px 0px;
	position: relative;
}

.route-info {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 8px;
}

.route-meta {
	font-size: 14px;
	opacity: 0.9;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.summary-stats {
	background: #eff1f2;
	padding: 8px;
}

.stats-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 12px;
	text-align: center;
}

.stat-item {
	font-size: 12px;
}

.stat-label {
	color: #666;
	font-size: 0.9rem;
	margin-bottom: 4px;
}

.stat-value {
	font-size: 16px;
	font-weight: 600;
	color: #0066cc;
}

.results-container {
	max-height: 400px;
	overflow-y: auto;
}

.train-card {
	transition: background-color 0.2s ease;
    cursor: pointer;
    margin-top: 0.5rem;
    border-left: 4px solid #3b82f6;
    border-radius: 0.5rem;
    background-color: #e0f2fe;
	padding-bottom: 0.5rem;
}

.train-card:last-child {
	border-bottom: none;
}

.train-card.selected {
	background-color: #d5ebff;
}

.train-header {
	padding: 2px 20px;
}

.time-route {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 5px;
}

.time-info {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 16px;
	font-weight: 600;
}

.duration {
	color: #666;
	font-size: 13px;
	font-weight: normal;
}

.train-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.train-types {
	display: flex;
	gap: 6px;
}

.train-type {
	display: none;
	color: white;
	padding: 3px 6px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
}

.train-type.seg1 {
	background: #4caf50;
}
.train-type.seg2 {
	background: #0066cc;
}

.connection-info {
    color: #856404;
    display: flex;
    align-items: center;
    gap: 6px;
    background-color: #fff8e1;
    border-radius: 20px;
    padding: 0.2em 0.5em;
    font-size: 0.9rem;
}
.connection-via {
	font-weight: bold;
	color: #000000;
}

.price-options {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.price-card {
	flex: 1;
	min-width: 80px;
	background: #ffffff;
	border: 1px solid #e9ecef;
	margin-top: 5px;
	border-radius: 6px;
	padding: 5px 10px;
	text-align: center;
	transition: all 0.2s ease;
	user-select: none
}


.price-class {
	font-size: 11px;
	color: #666;
	margin-bottom: 2px;
}

.price-value {
	font-size: 14px;
	font-weight: 600;
	color: #0066cc;
}

.price-range {
	font-size: 13px;
	font-weight: 600;
	color: #0066cc;
	
}

.details-panel {
	display: none;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-left: 2.5rem;
    margin-right: 2.5rem;
    padding-right: 16px;
	padding-left: 16px;
    padding-bottom: 6px;
	padding-top: 6px;
	border-radius: 0.5rem;}

.details-panel.active {
	display: block;
	background-color: #e6f3ff;
	
}

.segment-header {
	font-size: 14px;
	font-weight: 600;
	color: #0066cc;
}

.journey-step {
	display: flex;
	gap: 12px;
	position: relative;
	padding-left: 8px;
}

.step-time {
	font-weight: 600;
	min-width: 40px;
	font-size: 13px;
}

.step-icon {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-top: 2px;
	position: relative;
	z-index: 1;
}
.step-icon.seg1{
	background: #0066cc;
}
.step-icon.seg2{
	background: #00b894;
}

.step-info {
	flex: 1;
	font-size: 13px;
}

.step-station {
	font-weight: 600;
}

.step-details {
	color: #666;
	font-size: 12px;
}

/* Grille flexible pour afficher les cartes de prix côte à côte */
.segment-price-options {
	display: flex;
	gap: 8px; /* Espace entre les cartes de prix */
	justify-content: center;
	margin-bottom: 6px; /* Espace avant le nom du transporteur */
}

/* Style pour chaque carte de prix individuelle (ex: 2nde, 1ère) */
.segment-price-card {
	flex: 1; /* Permet aux cartes de prendre une largeur égale */
	min-width: 80px;
	background: white;
	border: 1px solid #dee2e6;
	border-radius: 4px;
	padding: 6px 8px;
	text-align: center;
	transition: all 0.2s ease;
}

/* Style pour le nom de la classe (2nde, 1ère) */
.segment-price-class {
	font-size: 11px;
	color: #666;
	margin-bottom: 2px;
}

/* Style pour la fourchette de prix */
.segment-price-range {
	font-size: 13px;
	font-weight: 600;
	color: #0066cc;
}

/* Style pour le nom du transporteur (ex: TGV INOUI) */
.segment-provider {
	font-size: 12px;
	color: #666;
	text-align: center;
}

.segment-price-value {
	font-weight: 600;
	color: #0066cc;
	text-align: center;	
}

.connection-break {
	background: #fff3cd;
	border-radius: 4px;
	padding: 6px 8px;
	margin: 8px 0;
	font-size: 12px;
	color: #856404;
	text-align: center;
}

/* Scrollbar styling */
.results-container::-webkit-scrollbar {
	width: 4px;
}

.results-container::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.results-container::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 2px;
}

.button-add-to-backpack{
  width: 40px;
  height: 40px;
  background: #6d5bb8;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  border:None;
  cursor:pointer;
  position: relative; 
  transform: translateY(8px);
}

.plus-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #e74c3c;
  color: white;
  font-size: 1.2em;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
}