* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
}

/* Classe commune pour l'ombre légère */
.shadow-light {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Bannière de don */
.donation-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #FFF5B3;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

/* Mode WebView : masquer complètement la bannière de donation */
.webview-mode .donation-banner {
    display: none !important;
}

.banner-text {
    text-align: center;
    flex: 1;
}

.coffee-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFDD00;
    border: none;
    border-radius: 20px;
    padding: 0;
    min-width: 36px;
    height: 36px;
}

.coffee-btn img {
    height: 32px;
    width: auto;
    padding: 4px;
}

/* Conteneur de la carte */
#map {
    width: 100vw;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* Layer Top Bar (générique pour tous les layers) */
.layer-top-bar {
    position: fixed;
    top: 72px; /* 8px (padding donation banner) + 36px (hauteur banner) + 8px (padding) + 20px (padding au-dessus) */
    left: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;
}

/* Mode WebView : ajuster la topbar sans la bannière de donation */
.webview-mode .layer-top-bar {
    top: 20px; /* Padding réduit sans la bannière */
}

/* Transition d'opacité pour les layers OpenLayers - transition plus douce */
.ol-layer {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}


/* Layer selector button - intégré dans la top bar */
.layer-selector-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-left: auto; /* Pousse le layer selector à droite */
    position: relative; /* Pour le positionnement fixe quand custom-route-active */
}

/* Petit rond rouge sur le bord du cercle */
.layer-selector-button::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #FF0000;
    border-radius: 50%;
    z-index: 1001;
}

.layer-selector-button .layer-icon {
    width: 50px;
    height: 50px;
    object-fit: fill;
    display: block;
}

/* Layer selector button déplacé en dessous quand un trajet personnalisé est actif */
.layer-selector-button.custom-route-active {
    position: fixed;
    top: 138px; /* 72px (top bar) + 50px (hauteur) + 16px (padding) */
    right: 20px;
    margin-left: 0; /* Réinitialise le margin-left */
    z-index: 1001; /* S'assurer qu'il est au-dessus */
}

/* Mode WebView : ajuster le bouton layer selector avec custom route active */
.webview-mode .layer-selector-button.custom-route-active {
    top: 86px; /* 20px (top bar) + 50px (hauteur) + 16px (padding) */
}

.layer-selector-button .close-icon {
    display: none;
    width: 50px;
    height: 50px;
    object-fit: fill;
}

.layer-selector-button:hover {
    background: #f5f5f5;
}

.layer-selector-button.open {
    position: fixed;
    top: 72px; /* Même top que la top bar */
    right: 20px; /* Sur desktop : reste à droite */
    left: auto;
    transform: none; /* Pas de centrage sur desktop */
    z-index: 2002; /* Au-dessus du panel (z-index 2000) et de l'overlay */
    margin-left: 0; /* Réinitialise le margin-left quand ouvert */
    opacity: 1; /* Pas de grisage */
    pointer-events: auto; /* Cliquable */
}

/* Mode WebView : ajuster le bouton layer selector */
.webview-mode .layer-selector-button.open {
    top: 20px; /* Même top que la top bar en mode WebView */
}

.layer-selector-button.open .layer-icon {
    display: none;
}

.layer-selector-button.open .close-icon {
    display: block;
}

@media (max-width: 768px) {
    .layer-top-bar {
        top: 72px; /* 10px (padding donation banner mobile) + 36px (hauteur banner) + 10px (padding) + 16px (padding au-dessus) */
        left: 12px;
        right: 12px;
        gap: 6px;
    }
    
    .layer-selector-button {
        width: 50px;
        height: 50px;
    }
    
    .layer-selector-button.open {
        position: fixed;
        top: 72px; /* Même top que la top bar */
        right: 12px; /* Reste à droite sur mobile */
        left: auto;
        transform: none; /* Pas de centrage sur mobile */
        z-index: 2002; /* Au-dessus du panel et de l'overlay */
        margin-left: 0; /* Réinitialise le margin-left quand ouvert */
    }
    
    .layer-selector-button.custom-route-active {
        position: fixed;
        top: 138px; /* 72px (top bar) + 50px (hauteur) + 16px (padding) */
        right: 12px;
        margin-left: 0; /* Réinitialise le margin-left */
    }
    
    .layer-selector-panel-close {
        right: 12px; /* Aligné à droite sur mobile */
    }
    
    
    .visa-expiration-wrapper {
        top: 72px; /* Même top que la top bar sur mobile */
    }
    
    /* Mode WebView sur mobile */
    .webview-mode .layer-top-bar {
        top: 12px; /* Padding réduit sans la bannière */
    }
    
    .webview-mode .layer-selector-button.open {
        top: 12px; /* Même top que la top bar en mode WebView */
    }
    
    .webview-mode .layer-selector-button.custom-route-active {
        top: 78px; /* 12px (top bar) + 50px (hauteur) + 16px (padding) */
    }
    
    .webview-mode .layer-selector-panel-close {
        top: 12px; /* Même top que la top bar en mode WebView */
    }
    
    .webview-mode .visa-expiration-wrapper {
        top: 12px; /* Même top que la top bar en mode WebView */
    }
    
    .webview-mode .layer-selector-panel {
        padding-top: 78px; /* 12px (top bar) + 50px (bouton) + 16px (espace) */
    }
    
    .layer-selector-button .layer-icon,
    .layer-selector-button .close-icon {
        width: 50px;
        height: 50px;
    }
    
    
    .custom-route-banner {
        padding: 0 16px;
        /* Sur mobile : reprendre le comportement flex normal */
        position: static;
        left: auto;
        transform: none;
        flex: 1; /* Prend toute la largeur disponible sur mobile */
        width: auto;
    }
    
    .custom-route-close-btn {
        /* Sur mobile : pas de margin-left auto */
        margin-left: 0;
    }
    
    .custom-route-title {
        font-size: 13px;
    }
    
    .overland-routes-menu-popup {
        width: 280px;
    }
    
    .layer-selector-button.custom-route-active {
        top: 118px; /* 52px (top bar) + 50px (hauteur) + 16px (padding) */
    }
    
    /* Mode WebView sur mobile : ajuster le bouton custom route active */
    .webview-mode .layer-selector-button.custom-route-active {
        top: 78px; /* 12px (top bar) + 50px (hauteur) + 16px (padding) */
    }
    
    .layer-selector-panel {
        justify-content: center; /* Centré sur mobile */
        align-items: flex-start; /* Aligné en haut sur mobile */
        padding-top: 138px; /* 72px (top bar) + 50px (bouton) + 16px (espace) */
        padding-right: 0; /* Pas de padding à droite sur mobile */
        padding-left: 0;
    }
    
    /* Mode WebView sur mobile : ajuster le padding du panel */
    .webview-mode .layer-selector-panel {
        padding-top: 78px; /* 12px (top bar) + 50px (bouton) + 16px (espace) */
    }
    
    .layer-selector-panel .popup-content {
        width: 90%;
        max-width: 320px; /* Largeur maximale réduite sur mobile */
        margin: 0; /* Pas de margin sur mobile */
        border-radius: 16px;
        max-height: calc(100vh - 158px); /* Ajusté pour le padding */
    }
    
    .panel-content {
        padding: 16px;
        max-height: calc(90vh - 32px);
    }
}

/* Layer selector panel */
.layer-selector-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: flex-end; /* Sur desktop : aligné à droite */
    align-items: flex-start; /* Aligné en haut */
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 138px; /* 72px (top bar) + 50px (bouton) + 16px (espace) */
    padding-right: 20px; /* Aligné avec le bouton */
    box-sizing: border-box;
}

/* Mode WebView : ajuster le padding du panel */
.webview-mode .layer-selector-panel {
    padding-top: 86px; /* 20px (top bar) + 50px (bouton) + 16px (espace) */
}

.layer-selector-panel.show {
    display: flex;
    opacity: 1;
}

.layer-selector-panel .popup-content {
    background: white;
    border-radius: 20px;
    width: 320px; /* Largeur réduite sur desktop */
    max-width: 320px;
    max-height: calc(100vh - 158px); /* Hauteur disponible moins le padding */
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    margin: 0; /* Pas de margin sur desktop */
    padding: 12px;
}

.layer-selector-panel-close {
    position: fixed;
    top: 72px; /* Même top que la top bar */
    right: 20px; /* Aligné à droite de la topbar */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    display: none; /* Masqué par défaut */
    align-items: center;
    justify-content: center;
    z-index: 2001; /* Au-dessus de l'overlay (z-index 2000) et du popup-content */
    transition: all 0.2s;
    flex-shrink: 0;
}

/* Mode WebView : ajuster le bouton de fermeture du panel */
.webview-mode .layer-selector-panel-close {
    top: 20px; /* Même top que la top bar en mode WebView */
}

.layer-selector-panel-close:hover {
    background: #f5f5f5;
}

.layer-selector-panel-close .close-icon {
    width: 50px;
    height: 50px;
    object-fit: fill;
    display: block;
}

.panel-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: calc(85vh - 64px);
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%) border-box;
    border: 3px solid transparent;
    border-radius: 14px;
    position: relative;
}

.panel-content > .instagram-cta-banner,
.panel-content > .layer-toggle,
.panel-content > .visa-country-selector {
    flex-shrink: 0;
}

/* Instagram CTA Banner */
.instagram-cta-banner {
    background: linear-gradient(135deg, #fd1d1d 0%, #fcb045 100%);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.instagram-cta-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.instagram-content {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.instagram-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instagram-logo {
    width: 28px;
    height: 28px;
}

.instagram-text {
    flex: 1;
    color: white;
    text-decoration: none;
}

.instagram-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    text-decoration: none;
}

.instagram-handle {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
    text-decoration: none;
}

.instagram-follow-btn {
    background: white;
    color: #833ab4;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    pointer-events: none; /* Désactiver les événements sur le bouton car tout le conteneur est cliquable */
}

@media (max-width: 768px) {
    .instagram-cta-banner {
        padding: 14px;
        margin-bottom: 16px;
    }
    
    .instagram-content {
        gap: 10px;
    }
    
    .instagram-icon {
        width: 36px;
        height: 36px;
    }
    
    .instagram-title {
        font-size: 13px;
    }
    
    .instagram-handle {
        font-size: 11px;
    }
    
    .instagram-follow-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}



/* Légendes générales */
.border-crossings-legend,
.overland-routes-legend,
.visa-guide-legend {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.border-crossings-legend .control-group,
.overland-routes-legend .control-group,
.visa-guide-legend .control-group {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.border-crossings-legend .legend,
.overland-routes-legend .legend,
.visa-guide-legend .legend {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.legend-item img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.legend-line {
    border-radius: 2px;
    flex-shrink: 0;
}

.layer-toggle {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid #e0e0e0;
}

.layer-toggle:last-child {
    margin-bottom: 0;
}

.layer-toggle:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.layer-toggle input[type="radio"] {
    display: none;
}

.layer-toggle input[type="radio"]:checked + label {
    color: #333;
    font-weight: 500;
}

.layer-toggle:has(input[type="radio"]:checked) {
    background: #f5f5f5;
    border-color: #ddd;
}

.layer-toggle label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
    color: #333;
    font-weight: 400;
    width: 100%;
    pointer-events: none;
}

.layer-toggle img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.new-tag {
    background: #ff4444;
    color: white;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    margin-left: auto;
}

.panel-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 14px;
    color: #666;
}

.panel-footer a {
    color: inherit;
    text-decoration: none;
}

.panel-footer a:hover {
    color: #333;
}

/* Visa country selector */
.visa-country-selector {
    margin-top: 12px;
    padding: 0;
}

.visa-country-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
}

.visa-country-selector select:hover {
    border-color: #ccc;
    background-color: #f9f9f9;
}

.visa-country-selector select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Visa Country Selection Popup */
.visa-country-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.visa-country-popup.show {
    display: flex;
    opacity: 1;
}

.visa-country-popup .popup-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    margin: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.country-select-popup {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
}

.country-select-popup:hover {
    border-color: #ccc;
    background-color: #f9f9f9;
}

.country-select-popup:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Heatmap region selector */
.heatmap-region-selector {
    margin-top: 16px;
    padding: 0 0 16px;
}

.heatmap-region-selector select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    background: white;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
}

.heatmap-region-selector select:hover {
    border-color: #ccc;
    background-color: #f9f9f9;
}

.heatmap-region-selector select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.load-heatmap-btn {
    width: 100%;
    margin-top: 12px;
    padding: 12px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.load-heatmap-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

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

/* Heatmap controls */
.heatmap-controls {
    margin-top: 16px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    max-height: 500px;
    overflow-y: auto;
}

.control-group {
    margin: 12px 0;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #495057;
}

.control-group input[type="range"] {
    width: 100%;
    margin: 8px 0;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2196F3;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.control-group input[type="color"] {
    width: 100%;
    height: 30px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

.control-group button {
    width: 100%;
    padding: 8px 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.control-group button:hover {
    background: #005a87;
}

.reset-btn {
    background: #dc3545 !important;
}

.reset-btn:hover {
    background: #c82333 !important;
}

.zoom-adaptation-btn {
    background: #28a745 !important;
    font-weight: bold;
}

.zoom-adaptation-btn:hover {
    background: #218838 !important;
}

.control-group button {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 25px;
    background: #2196F3;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.control-group button:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.control-group button:active {
    transform: translateY(0);
}

/* Styles pour les marqueurs de la carte */
.map-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.marker-red { background: #ff4444; }
.marker-green { background: #44aa44; }
.marker-blue { background: #4444ff; }
.marker-yellow { background: #ffaa44; }

/* Styles pour le popup des passages frontaliers */
.border-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.border-popup.show {
    display: flex;
    opacity: 1;
}

.popup-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    margin: 20px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .border-popup .popup-content,
    .overland-popup .popup-content {
        width: 95%;
        margin: 16px;
        border-radius: 16px;
        max-height: 90vh;
    }
}

/* Styles spécifiques pour le popup des villes */
.city-popup {
    max-width: 480px;
    border-radius: 24px;
}

.city-banner {
    position: relative;
    height: 120px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.city-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.4) 100%);
}

.city-banner h1 {
    color: white;
    font-size: 32px;
    font-weight: 600;
    position: relative;
    z-index: 1;
    margin: 0;
    text-align: center;
    width: 100%;
}

.city-description {
    padding: 32px;
}

.city-description p {
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

.city-popup .popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.popup-header {
    background: rgba(255, 255, 255, 0.8);
    padding: 24px 48px 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

.header-left {
    flex: 1;
}

.popup-title {
    color: #1d1d1f;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 20px 0;
    padding-bottom: 8px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

@media (max-width: 480px) {
    .popup-header {
        padding: 20px 40px 16px 20px;
    }
    
    .popup-title {
        font-size: 22px;
        margin: 0 0 16px 0;
    }
    
    .popup-body {
        padding: 16px 20px;
    }
    
    .popup-footer {
        padding: 16px 20px;
    }
    
    .status-badge {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .action-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

.status-badge {
    display: inline-block;
    background: #8F8F8F;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #8e8e93;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    font-weight: 300;
    line-height: 1;
    z-index: 10;
}

.popup-close:hover {
    color: #1d1d1f;
}

.popup-body {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.5);
}

.info-section {
    margin-bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

@media (max-width: 480px) {
    .popup-body {
        padding: 12px 16px;
    }
    
    .info-section {
        margin-bottom: 8px;
        gap: 6px;
    }
}

.info-section:last-of-type {
    margin-bottom: 0;
}

.info-label {
    color: #2c3e50;
    font-size: 16px;
    white-space: nowrap;
    font-weight: 600;
}

.info-label::after {
    content: " : ";
}

.info-value {
    color: #34495e;
    font-size: 16px;
    line-height: 1.4;
    flex: 1;
    font-weight: 400;
}

.countries-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country {
    color: #34495e;
    font-size: 16px;
    font-weight: 500;
}

.country-separator {
    color: #bdc3c7;
    font-weight: 300;
}

.popup-footer {
    padding: 20px 20px 24px;
    border-top: 1px solid #ecf0f1;
    text-align: center;
}

.missing-question {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 16px;
}

@media (max-width: 480px) {
    .popup-footer {
        padding: 16px 16px 20px;
    }
    
    .missing-question {
        margin-bottom: 14px;
    }
}

.contact-btn {
    background: #e3f2fd;
    color: #2196F3;
    border: none;
    padding: 12px 24px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.contact-btn:hover {
    background: #bbdefb;
}

/* Style pour le bouton source */
.source-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #2196F3;
    border: none;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    margin: 4px;
    min-width: 80px;
    text-align: center;
}

.source-btn:hover {
    background: #e3f2fd;
}

.source-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding: 4px 20px;
    margin: 0;
    width: 100%;
}

@media (max-width: 480px) {
    .source-container {
        padding: 4px 16px;
    }
}

/* Couleurs spécifiques pour chaque statut */
.status-badge.status-open {
    background: #88A80B; /* Vert */
}

.status-badge.status-closed {
    background: #BE422F; /* Rouge */
}

.status-badge.status-conditional {
    background: #F9BE43; /* Jaune */
}

.status-badge.status-bilateral {
    background: #4C6EA4; /* Bleu */
}

.status-badge.status-nei {
    background: #8F8F8F; /* Gris */
}

.status-badge.status-ferry {
    background: #4C6EA4; /* Bleu pour ferry */
}

/* Styles pour les statuts de visa guide */
.status-badge.status-grey {
    background: #8F8F8F; /* Gris pour pays sélectionné */
}

.status-badge.status-green {
    background: #88A80B; /* Vert pour visa gratuit */
}

.status-badge.status-blue {
    background: #4C6EA4; /* Bleu pour eVisa et visa à l'arrivée */
}

.status-badge.status-red {
    background: #BE422F; /* Rouge pour visa requis et Trump ban */
}

.status-badge.status-yellow {
    background: #F9BE43; /* Jaune pour ETA et autres */
}

.status-badge.status-black {
    background: #000000; /* Noir pour Trump ban et not admitted */
    color: white;
}

/* Styles du header selon le statut */
.popup-header.status-open {
    background: rgba(52, 199, 89, 0.1); /* Vert subtil */
}

.popup-header.status-closed {
    background: rgba(255, 59, 48, 0.1); /* Rouge subtil */
}

.popup-header.status-conditional {
    background: rgba(255, 204, 0, 0.1); /* Jaune subtil */
}

.popup-header.status-bilateral {
    background: rgba(0, 122, 255, 0.1); /* Bleu subtil */
}

.popup-header.status-nei {
    background: rgba(255, 255, 255, 0.8); /* Blanc subtil */
}

.popup-header.status-ferry {
    background: rgba(175, 82, 222, 0.1); /* Violet subtil pour ferry */
}

/* Styles des headers pour les statuts de visa guide */
.popup-header.status-grey {
    background: rgba(255, 255, 255, 0.8); /* Blanc subtil pour pays sélectionné */
}

.popup-header.status-green {
    background: rgba(52, 199, 89, 0.1); /* Vert subtil pour visa gratuit */
}

.popup-header.status-blue {
    background: rgba(0, 122, 255, 0.1); /* Bleu subtil pour eVisa et visa à l'arrivée */
}

.popup-header.status-red {
    background: rgba(255, 59, 48, 0.1); /* Rouge subtil pour visa requis et Trump ban */
}

.popup-header.status-yellow {
    background: rgba(255, 204, 0, 0.1); /* Jaune subtil pour ETA et autres */
}

.popup-header.status-black {
    background: rgba(0, 0, 0, 0.05); /* Gris subtil pour Trump ban et not admitted */
}

/* Styles unifiés pour tous les popups */
.popup-content {
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.popup-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.popup-body {
    padding: 16px 20px;
}

.info-section {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-size: 13px;
    font-weight: 500;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

.info-value {
    font-size: 16px;
    color: #1d1d1f;
    line-height: 1.4;
    font-weight: 400;
}

.countries-info {
    font-size: 16px;
    color: #1d1d1f;
    line-height: 1.4;
    font-weight: 400;
}

.popup-footer {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.8);
}

.missing-question {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 12px;
    font-weight: 400;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #2196F3;
    border: none;
    padding: 14px 24px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    min-width: 120px;
    text-align: center;
}

.contact-btn:hover {
    background: #e3f2fd;
    text-decoration: none;
    color: #2196F3;
}

/* Styles spécifiques pour le popup visa guide */
.status-container {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.days-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    text-decoration: none;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.action-btn:hover {
    text-decoration: none;
    color: #1d1d1f;
}

.action-btn .btn-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}


/* Styles pour le popup des routes terrestres */
.route-info {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.city-info {
    flex: 1;
    text-align: center;
}

.city-info h3 {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.city-info p {
    font-size: 14px;
    color: #7f8c8d;
}

.route-line {
    flex: 2;
    height: 2px;
    background: #bdc3c7;
    position: relative;
}

.route-line::before,
.route-line::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #bdc3c7;
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.route-line::before {
    left: 0;
}

.route-line::after {
    right: 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

.info-item span {
    font-size: 16px;
    color: #2c3e50;
    font-weight: 500;
}

.booking-button {
    display: block;
    background: #2ecc71;
    color: white;
    text-align: center;
    padding: 12px;
    margin: 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s;
}

.booking-button:hover {
    background: #27ae60;
}

.description {
    padding: 0 20px 20px;
    color: #34495e;
    font-size: 14px;
    line-height: 1.5;
}

.operator-logo {
    height: 40px;
    width: auto;
}

.overland-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overland-popup.show {
    display: flex;
    opacity: 1;
}

/* Styles du header selon le statut pour les routes terrestres */
.popup-header.status-train {
    background: #e8f4fd; /* Bleu clair pour train */
}

.popup-header.status-bus {
    background: #fdf2e8; /* Orange clair pour bus */
}

.popup-header.status-ferry {
    background: #f3e5f5; /* Violet clair pour ferry */
}

.popup-header.status-discontinued {
    background: #fdeaea; /* Rouge clair pour discontinued */
}

/* Couleurs spécifiques pour les statuts des routes terrestres */
.status-badge.status-train {
    background: #3498db; /* Bleu pour train */
}

.status-badge.status-bus {
    background: #e67e22; /* Orange pour bus */
}

.status-badge.status-ferry {
    background: #9b59b6; /* Violet pour ferry */
}

.status-badge.status-discontinued {
    background: #e74c3c; /* Rouge pour discontinued */
}

/* Styles pour le popup wiki Afghanistan */
.wiki-afghanistan-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    min-width: 300px;
}

.wiki-afghanistan-popup .popup-header {
    background: #2ecc71;
    color: white;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wiki-afghanistan-popup .popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.wiki-afghanistan-popup .popup-content {
    padding: 20px;
}

.wiki-afghanistan-popup .popup-content p {
    margin: 8px 0;
    color: #333;
}

.wiki-afghanistan-popup .popup-actions {
    margin-top: 15px;
    text-align: center;
}

.wikivoyage-button {
    display: inline-block;
    background: #2ecc71;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.wikivoyage-button:hover {
    background: #27ae60;
    color: white;
    text-decoration: none;
}

/* Sidebar Wikipédia */
.wiki-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wiki-sidebar.open {
    right: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: #f8f9fa;
}

.sidebar-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-close:hover {
    background: #e9ecef;
    color: #333;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.wiki-article-content {
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.wiki-article-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d1d1f;
    line-height: 1.2;
}

.wiki-article-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 400;
}

.wiki-article-body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.wiki-article-body h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 24px 0 12px 0;
    color: #1d1d1f;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.wiki-article-body h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 8px 0;
    color: #1d1d1f;
}

.wiki-article-body p {
    margin-bottom: 16px;
    text-align: justify;
}

.wiki-article-body ul, .wiki-article-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.wiki-article-body li {
    margin-bottom: 8px;
}

.wiki-article-body strong {
    font-weight: 600;
    color: #1d1d1f;
}

.wiki-article-body em {
    font-style: italic;
    color: #666;
}

.wiki-article-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.wiki-article-infobox {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    font-size: 14px;
}

.wiki-article-infobox h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #1d1d1f;
    border-bottom: none;
    padding-bottom: 0;
}

.wiki-article-infobox .infobox-row {
    display: flex;
    margin-bottom: 8px;
}

.wiki-article-infobox .infobox-label {
    font-weight: 600;
    min-width: 80px;
    margin-right: 8px;
    color: #666;
}

.wiki-article-infobox .infobox-value {
    flex: 1;
    color: #333;
}

.wiki-article-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
}

.wiki-article-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.wiki-article-error {
    padding: 40px 20px;
    text-align: center;
    color: #666;
}

.wiki-article-error h3 {
    color: #e74c3c;
    margin-bottom: 12px;
}

.wiki-external-link {
    color: #2196F3;
    text-decoration: none;
    font-weight: 500;
}

.wiki-external-link:hover {
    text-decoration: underline;
}

/* Popup de survol pour les points wiki */
.wiki-hover-popup {
    position: fixed;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(10px);
    pointer-events: none;
    max-width: 280px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.wiki-hover-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hover-popup-content {
    padding: 0;
}

.hover-popup-image-container {
    width: 100%;
    height: 160px;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
}

.hover-popup-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hover-popup-image:hover {
    transform: scale(1.05);
}

.hover-popup-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
}

.hover-popup-text {
    padding: 16px;
    background: white;
}

.hover-popup-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
    line-height: 1.3;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* État de chargement pour l'image */
.hover-popup-image-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.hover-popup-image-container.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* État d'erreur pour l'image */
.hover-popup-image-container.error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #666;
    font-size: 14px;
}

.hover-popup-image-container.error::after {
    content: '📷';
    font-size: 24px;
    opacity: 0.5;
}

/* Responsive pour la sidebar */
@media (max-width: 768px) {
    .wiki-sidebar {
        width: 100vw;
        right: -100vw;
    }
    
    .wiki-article-content {
        padding: 16px;
    }
    
    .wiki-article-title {
        font-size: 24px;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .wiki-hover-popup {
        max-width: 240px;
    }
    
    .hover-popup-image-container {
        height: 120px;
    }
    
    .hover-popup-title {
        font-size: 14px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        min-width: 250px;
        left: 10px;
        bottom: 10px;
    }
    
    .donation-banner {
        padding: 10px 15px;
        font-size: 12px;
    }
    
    .coffee-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .popup-content {
        width: 95%;
        margin: 20px;
    }
    
    .popup-header {
        padding: 16px 20px;
    }
    
    .popup-title {
        font-size: 20px;
    }
    
    .popup-body {
        padding: 20px;
    }
    
    .popup-footer {
        padding: 16px 20px;
    }
    
    .wiki-afghanistan-popup {
        max-width: 90%;
        min-width: 280px;
    }
}

/* Styles pour le popup Discover */
.discover-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: flex-start;
    align-items: flex-start;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    pointer-events: none; /* Permet les interactions avec la carte */
}

.discover-popup.show {
    display: flex;
    opacity: 1;
}

.discover-popup-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%,
        transparent 60px,
        rgba(0, 0, 0, 0.5) 60px,
        rgba(0, 0, 0, 0) calc(60px + 33.33vh)
    );
    pointer-events: none;
    z-index: 1; /* Derrière le popup-content */
    display: none; /* Masqué par défaut, affiché uniquement sur mobile */
}

.discover-popup.show .discover-popup-gradient-overlay {
    display: none; /* Masqué sur desktop par défaut */
}

.discover-popup-close {
    position: absolute;
    top: 75px; /* Ajusté pour centrer le cercle de 50px */
    left: 400px; /* 380px (max-width du popup) + 20px (padding du popup parent) */
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 3;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px; /* Plus de padding latéral entre le popup et la croix */
    transition: all 0.2s;
}

.discover-popup-close:hover {
    background: #f5f5f5;
}

.discover-popup-close img {
    width: 50px;
    height: 50px;
    object-fit: fill;
    display: block;
}

.discover-popup-content {
    background: white;
    border-radius: 20px;
    width: auto;
    max-width: 380px;
    max-height: calc(100vh - 120px);
    position: relative;
    padding: 12px;
    margin-top: 60px;
    pointer-events: auto; /* Permet les interactions avec le popup */
    z-index: 2; /* Au-dessus du gradient overlay */
}

.discover-popup-inner {
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(to bottom right, #B4B4B4, #565656) border-box;
    border: 3px solid transparent;
    border-radius: 14px;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 144px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.discover-popup-header {
    padding: 16px 20px 10px 20px;
}

.discover-popup-title {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.2;
}

.discover-popup-image-container {
    padding: 0 20px 10px 20px;
}

.discover-popup-image {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    object-fit: cover;
    max-height: 150px;
}

.discover-popup-body {
    padding: 10px 20px 12px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.discover-popup-text {
    font-size: 12px;
    line-height: 1.4;
    color: #000;
    margin: 0 0 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: justify;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.discover-popup-source {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #666;
    margin-top: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.wikivoyage-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.discover-popup-footer {
    padding: 10px 20px 16px 20px;
    text-align: center;
}

.discover-read-more-btn {
    display: inline-block;
    width: auto;
    min-width: 160px;
    background: #000;
    color: #fff;
    text-align: center;
    padding: 8px 20px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.2s;
}

.discover-read-more-btn:hover {
    background: #333;
    color: #fff;
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .discover-popup {
        justify-content: center;
        align-items: flex-start;
        padding: 12px; /* Moins de padding latéral */
        padding-top: 70px;
    }

    .discover-popup.show .discover-popup-gradient-overlay {
        display: block; /* Affiché uniquement sur mobile quand le popup est ouvert */
    }

    .discover-popup-close {
        top: auto;
        bottom: auto;
        left: auto;
        right: 12px; /* Position du bord droit de la popup (12px du bord de l'écran) */
        width: 32px;
        height: 32px;
        margin-left: 0;
        transform: translateX(-50%); /* Décaler de la moitié de la largeur (16px) vers la gauche pour aligner le bord droit de la croix avec le bord droit du popup */
        background: white;
        border-radius: 50%;
    }
    
    .discover-popup-close img {
        width: 32px;
        height: 32px;
        object-fit: fill;
    }

    .discover-popup-content {
        width: calc(100% - 24px); /* Moins de padding latéral */
        max-width: none;
        max-height: 100%; /* Sera calculé dynamiquement par JavaScript en fonction de legend */
        border-radius: 16px;
        padding: 12px;
        margin-top: 56px; /* Padding au-dessus de la popup : 32px (croix) + 12px (padding) + 12px (padding) */
    }

    .discover-popup-inner {
        border-radius: 12px;
        max-height: 100%; /* Sera calculé dynamiquement par JavaScript */
        overflow: hidden;
    }


    .discover-popup-header {
        padding: 14px 18px 8px 18px;
    }

    .discover-popup-title {
        font-size: 18px;
    }

    .discover-popup-image-container {
        padding: 0 18px 8px 18px;
    }

    .discover-popup-image {
        max-height: 120px;
    }

    .discover-popup-body {
        padding: 10px 18px;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .discover-popup-text {
        font-size: 11px;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }

    .discover-popup-footer {
        padding: 10px 18px 14px 18px;
    }

    .discover-read-more-btn {
        padding: 8px 18px;
        font-size: 12px;
        min-width: 140px;
    }
}

@media (max-width: 480px) {
    .discover-popup {
        padding: 12px;
        padding-top: 72px;
    }

    .discover-popup-content {
        width: calc(100% - 24px);
        max-height: calc(100vh - 84px);
        border-radius: 16px;
        padding: 12px;
        margin-top: 56px; /* Padding au-dessus de la popup : 32px (croix) + 12px (padding) + 12px (padding) */
    }

    .discover-popup-inner {
        border-radius: 12px;
        max-height: calc(100vh - 108px);
    }

    .discover-read-more-btn {
        width: 100%;
    }
    
    /* Mode WebView : ajuster le padding-top des popups discover */
    .webview-mode .discover-popup {
        padding-top: 12px; /* Padding réduit sans la bannière */
    }
}

/* Styles pour le popup UNESCO */
.unesco-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: flex-start;
    align-items: flex-start;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    pointer-events: none;
}

.unesco-popup.show {
    display: flex;
    opacity: 1;
}

.unesco-popup-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        transparent 0%,
        transparent 60px,
        rgba(0, 0, 0, 0.5) 60px,
        rgba(0, 0, 0, 0) calc(60px + 33.33vh)
    );
    pointer-events: none;
    z-index: 1;
    display: none;
}

.unesco-popup.show .unesco-popup-gradient-overlay {
    display: none;
}

.unesco-popup-close {
    position: absolute;
    top: 75px; /* Ajusté pour centrer le cercle de 50px */
    left: 400px; /* 380px (max-width du popup) + 20px (padding du popup parent) */
    width: 50px;
    height: 50px;
    background: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    z-index: 3;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 16px; /* Plus de padding latéral entre le popup et la croix */
    transition: all 0.2s;
}

.unesco-popup-close:hover {
    background: #f5f5f5;
}

.unesco-popup-close img {
    width: 50px;
    height: 50px;
    object-fit: fill;
    display: block;
}

.unesco-popup-content {
    background: white;
    border-radius: 20px;
    width: auto;
    max-width: 380px;
    max-height: calc(100vh - 120px);
    position: relative;
    padding: 12px;
    margin-top: 60px;
    pointer-events: auto;
    z-index: 2;
}

.unesco-popup-inner {
    background: 
        linear-gradient(white, white) padding-box,
        linear-gradient(to bottom right, #5B9BD5, #2E75B6) border-box;
    border: 3px solid transparent;
    border-radius: 14px;
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 144px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.unesco-popup-header {
    padding: 16px 20px 10px 20px;
}

.unesco-popup-title {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    margin: 0 0 8px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.2;
}

.unesco-popup-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}

.unesco-popup-country,
.unesco-popup-date {
    font-size: 12px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.unesco-popup-body {
    padding: 10px 20px 16px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.unesco-popup-description {
    font-size: 12px;
    line-height: 1.4;
    color: #000;
    margin: 0 0 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: justify;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.unesco-popup-description p {
    margin: 0 0 10px 0;
}

.unesco-popup-description p:last-child {
    margin-bottom: 0;
}

.unesco-popup-source {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #666;
    margin-top: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.unesco-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* Responsive - Mobile UNESCO */
@media (max-width: 768px) {
    .unesco-popup {
        justify-content: center;
        align-items: flex-start;
        padding: 12px; /* Moins de padding latéral */
        padding-top: 70px;
    }

    .unesco-popup.show .unesco-popup-gradient-overlay {
        display: block;
    }

    .unesco-popup-close {
        top: auto;
        bottom: auto;
        left: auto;
        right: 12px; /* Position du bord droit de la popup (12px du bord de l'écran) */
        width: 32px;
        height: 32px;
        margin-left: 0;
        transform: translateX(-50%); /* Décaler de la moitié de la largeur (16px) vers la gauche pour aligner le bord droit de la croix avec le bord droit du popup */
        background: white;
        border-radius: 50%;
    }
    
    .unesco-popup-close img {
        width: 32px;
        height: 32px;
        object-fit: fill;
    }

    .unesco-popup-content {
        width: calc(100% - 24px); /* Moins de padding latéral */
        max-width: none;
        max-height: 100%; /* Sera calculé dynamiquement par JavaScript en fonction de legend */
        border-radius: 16px;
        padding: 12px;
        margin-top: 56px; /* Padding au-dessus de la popup : 32px (croix) + 12px (padding) + 12px (padding) */
    }

    .unesco-popup-inner {
        border-radius: 12px;
        max-height: 100%; /* Sera calculé dynamiquement par JavaScript */
        overflow: hidden;
    }

    .unesco-popup-header {
        padding: 14px 18px 8px 18px;
    }

    .unesco-popup-title {
        font-size: 18px;
    }

    .unesco-popup-meta {
        gap: 10px;
        margin-top: 6px;
    }

    .unesco-popup-country,
    .unesco-popup-date {
        font-size: 11px;
    }

    .unesco-popup-body {
        padding: 10px 18px 14px 18px;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .unesco-popup-description {
        font-size: 11px;
        overflow-y: auto;
        flex: 1;
        min-height: 0;
    }
}

@media (max-width: 480px) {
    .unesco-popup {
        padding: 12px;
        padding-top: 72px;
    }

    .unesco-popup-content {
        width: calc(100% - 24px);
        max-height: calc(100vh - 84px);
        border-radius: 16px;
        padding: 12px;
        margin-top: 56px; /* Padding au-dessus de la popup : 32px (croix) + 12px (padding) + 12px (padding) */
    }

    .unesco-popup-inner {
        border-radius: 12px;
        max-height: calc(100vh - 108px);
    }
    
    /* Mode WebView : ajuster le padding-top des popups unesco */
    .webview-mode .unesco-popup {
        padding-top: 12px; /* Padding réduit sans la bannière */
    }
}

/* Legend Controls (affiché pour toutes les couches) */
.legend-controls {
    position: fixed;
    bottom: 8px; /* Plus près du bas de la page */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s, visibility 0.3s;
    line-height: 0;
}

.legend-controls.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Quand le sélecteur border and visa est visible, le bouton legend doit être juste au-dessus (0px d'espacement) */
.legend-controls.with-borders-visa {
    bottom: 82px; /* 18px (position sélecteur) + 64px (hauteur sélecteur) = 82px, 0px d'espacement */
}

/* Legend Toggle Button */
.legend-toggle-btn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    display: block;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 0;
    width: 110px;
    height: 70px;
    overflow: hidden;
}

.legend-toggle-btn .legend-icon {
    width: 110px;
    height: 70px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Centrer le texte Legend dans le SVG */
.legend-toggle-btn .legend-icon text {
    text-anchor: middle;
    dominant-baseline: middle;
}

/* Borders & Visa Layer Selection Buttons */
.borders-visa-layer-controls {
    position: fixed;
    bottom: 18px; /* Distance réduite de moitié (36px -> 18px) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Discovery Layer Selection Buttons */
.discover-layer-controls {
    position: fixed;
    bottom: 18px; /* Distance réduite de moitié (36px -> 18px) */
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Heatmap Layer Controls */
.heatmap-layer-controls {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}


/* Croix dans la topbar (alignées à gauche) */
.topbar-close-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    display: none; /* Masqué par défaut, affiché via JavaScript */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    order: -1; /* Placer les boutons au début */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.topbar-close-btn:hover {
    background: #f5f5f5;
}

.topbar-close-btn .close-icon {
    width: 50px;
    height: 50px;
    object-fit: fill;
}

/* Overland Routes Search Bar */
.overland-routes-search-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 50px;
    height: 50px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    min-width: 0;
    width: auto;
    max-width: 400px;
}

.overland-routes-search-select {
    width: auto;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0;
    flex: 0 1 auto;
    text-align: center;
    text-align-last: center; /* Pour centrer l'option sélectionnée */
}

.overland-routes-search-select:hover {
    color: #000;
}

/* Visa Guide Country Selector */
.visa-guide-country-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 50px;
    height: 50px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    min-width: 0;
    width: auto;
    max-width: 400px;
}

.visa-guide-country-select {
    width: auto;
    min-width: 0;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0;
    flex: 0 1 auto;
    text-align: center;
    text-align-last: center; /* Pour centrer l'option sélectionnée */
}

.visa-guide-country-select:hover {
    color: #000;
}

/* Help Highlight - Aura pour mettre en valeur un élément (aide visuelle) */
.help-highlight {
    position: relative;
    z-index: 1002;
}

.help-highlight::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 58px; /* 50px (hauteur) + 8px (padding) */
    border: 3px solid #2196F3;
    box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.3),
                0 0 0 8px rgba(33, 150, 243, 0.15),
                0 0 20px rgba(33, 150, 243, 0.4);
    pointer-events: none;
    animation: helpPulseBorder 2s ease-in-out infinite;
}

/* Pour les éléments avec transform existant (comme visa-guide-country-container) */
.visa-guide-country-container.help-highlight {
    animation: helpPulseWithTransform 2s ease-in-out infinite;
}

@keyframes helpPulseWithTransform {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.02);
    }
}

@keyframes helpPulseBorder {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.3),
                    0 0 0 8px rgba(33, 150, 243, 0.15),
                    0 0 20px rgba(33, 150, 243, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(33, 150, 243, 0.4),
                    0 0 0 12px rgba(33, 150, 243, 0.2),
                    0 0 30px rgba(33, 150, 243, 0.5);
    }
}

/* Overland Routes Custom Route Banner */
.custom-route-banner {
    background: white;
    border-radius: 50px;
    height: 50px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    /* Sur desktop : centré avec largeur automatique */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    flex-shrink: 0;
}

.custom-route-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}


.custom-route-author {
    display: none;
}

/* Custom Route Close Button */
.custom-route-close-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    display: none; /* Masqué par défaut, affiché via JavaScript */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    /* Aligné à l'extrémité droite de la topbar */
    margin-left: auto;
    z-index: 1001;
    position: relative;
    order: 999; /* S'assurer qu'il est à la fin */
}

.custom-route-close-btn:hover {
    background: #f5f5f5;
}

.custom-route-close-btn .close-icon {
    width: 50px;
    height: 50px;
    object-fit: fill;
}

/* Custom Route Tickets Container */
.custom-route-tickets-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    max-width: 90vw;
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-route-tickets-list {
    display: flex;
    flex-direction: row;
    gap: 16px;
    align-items: center;
    overflow-x: hidden;
    scroll-behavior: smooth;
    max-width: calc(90vw - 80px);
    position: relative;
}

/* Masquer tous les tickets sauf celui actif */
.custom-route-ticket {
    display: none;
}

.custom-route-ticket.active {
    display: block;
}

/* Navigation Buttons */
.custom-route-ticket-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    color: #333;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-route-ticket-nav-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.custom-route-ticket-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.custom-route-ticket-nav-btn svg {
    width: 18px;
    height: 18px;
}

/* Custom Route Ticket - Container externe blanc */
.custom-route-ticket {
    background: white;
    border-radius: 12px;
    padding: 10px;
    width: 320px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: opacity 0.3s ease;
}

.custom-route-ticket.active {
    opacity: 1;
}

.custom-route-ticket.inactive {
    opacity: 0.4;
}

/* Rectangle intérieur avec stroke colorée */
.custom-route-ticket-inner {
    background: var(--ticket-bg-color, #fef8e8);
    border: 2px solid var(--ticket-status-color, #B4B4B4);
    border-radius: 10px;
    padding: 18px;
    width: 100%;
    position: relative;
    overflow: hidden;
    height: 280px;
    display: flex;
    flex-direction: column;
}

/* Route Indicator */
.custom-route-ticket-route-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    left: 18px;
    top: 18px;
    height: auto; /* Hauteur automatique, ne s'étend pas jusqu'en bas */
    z-index: 1;
    justify-content: flex-start; /* Aligner en haut */
}

.custom-route-ticket-route-line {
    width: 2px;
    height: 40px; /* Hauteur fixe pour relier les deux points */
    background: var(--ticket-status-color, #989322);
    border-radius: 1px;
    margin: 2px 0;
}

.custom-route-ticket-route-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ticket-status-color, #989322);
    margin: 2px 0;
    flex-shrink: 0;
}

/* Ticket Content */
.custom-route-ticket-content {
    margin-left: 36px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* Origin and Destination */
.custom-route-ticket-route-info {
    display: flex;
    flex-direction: column; /* Empiler les villes verticalement */
    gap: 16px; /* Espacement entre les deux villes */
    margin-left: 0; /* Les villes restent alignées avec l'indicateur */
}

.custom-route-ticket-location {
    display: flex;
    flex-direction: column;
}

.custom-route-ticket-city {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    margin: 0 0 3px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-route-ticket-country {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Travel Details */
.custom-route-ticket-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    margin-left: -20px; /* Aligné plus à gauche que les villes */
}

.custom-route-ticket-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.custom-route-ticket-detail-label {
    font-size: 10px;
    font-weight: 400;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.custom-route-ticket-detail-value {
    font-size: 13px;
    font-weight: 700;
    color: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Booking Button */
.custom-route-ticket-booking {
    width: 100%;
    padding: 10px 18px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 25px; /* Bouton plus arrondi */
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    margin-left: -20px; /* Aligné plus à gauche que les villes */
}

.custom-route-ticket-booking:hover {
    background: #333;
}

/* Info Button (bouton i en rond) */
.custom-route-ticket-info-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.custom-route-ticket-info-btn:hover {
    border-color: rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.05);
}

.custom-route-ticket-info-btn .info-icon {
    font-size: 12px;
    font-weight: 700;
    color: #000;
    line-height: 1;
    display: block;
}

.custom-route-ticket-info-btn .close-icon {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    line-height: 1;
    display: none;
}

/* Mode commentaire uniquement */
.custom-route-ticket-inner.comment-only-mode .custom-route-ticket-route-indicator {
    display: none;
}

.custom-route-ticket-inner.comment-only-mode .custom-route-ticket-content {
    margin-left: 0;
}

.custom-route-ticket-inner.comment-only-mode .custom-route-ticket-route-info,
.custom-route-ticket-inner.comment-only-mode .custom-route-ticket-details,
.custom-route-ticket-inner.comment-only-mode .custom-route-ticket-booking {
    display: none;
}

.custom-route-ticket-inner.comment-only-mode {
    overflow: hidden;
}

.custom-route-ticket-inner.comment-only-mode .custom-route-ticket-comment {
    display: block !important;
    margin: 0;
    padding: 18px;
    border-top: none;
    max-height: calc(100% - 36px);
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    line-height: 1.6;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Comment - masqué par défaut */
.custom-route-ticket-comment {
    display: none;
    font-size: 11px;
    font-weight: 400;
    color: #000;
    margin: 0;
    margin-left: -20px; /* Aligné plus à gauche que les villes */
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.5;
    max-height: 240px;
    overflow-y: auto;
}

/* Booking Button as Link */
.custom-route-ticket-booking {
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

/* Responsive Styles for Tickets */
@media (max-width: 768px) {
    .custom-route-tickets-container {
        bottom: 12px;
        padding: 0 8px;
        max-width: calc(100vw - 16px);
        gap: 8px;
    }
    
    .custom-route-ticket-nav-btn {
        width: 28px;
        height: 28px;
    }
    
    .custom-route-ticket-nav-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .custom-route-tickets-list {
        max-width: calc(100vw - 80px);
    }
    
    .custom-route-ticket {
        padding: 8px;
        width: calc(100vw - 80px);
        max-width: 100%;
    }
    
    .custom-route-ticket-inner {
        padding: 16px;
        height: 260px;
    }
    
    .custom-route-ticket-inner.comment-only-mode .custom-route-ticket-comment {
        max-height: calc(100% - 32px);
        padding: 16px;
    }
    
    .custom-route-ticket-route-indicator {
        left: 16px;
        top: 16px;
        height: calc(100% - 32px);
    }
    
    .custom-route-ticket-content {
        margin-left: 34px;
        gap: 12px;
    }
    
    .custom-route-ticket-city {
        font-size: 16px;
    }
    
    .custom-route-ticket-country {
        font-size: 13px;
    }
    
    .custom-route-ticket-details {
        gap: 10px 16px;
    }
    
    .custom-route-ticket-detail-label {
        font-size: 9px;
    }
    
    .custom-route-ticket-detail-value {
        font-size: 13px;
    }
    
    .custom-route-ticket-booking {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .custom-route-ticket-comment {
        font-size: 11px;
        min-height: 160px;
        max-height: 160px;
    }
}

/* Overland Routes Menu Overlay */
.overland-routes-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.overland-routes-menu-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

/* Overland Routes Menu Popup */
.overland-routes-menu-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 90vw;
    height: 100vh;
    background: white;
    z-index: 1999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.overland-routes-menu-popup.show {
    transform: translateX(0);
}

.overland-routes-menu-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.overland-routes-menu-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.overland-routes-menu-close-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.overland-routes-menu-close-btn .close-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.overland-routes-menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Bouton de réinitialisation */
.overland-routes-menu-reset {
    padding: 16px;
    border: 2px solid #2196F3;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f5f9ff;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.overland-routes-menu-reset.active {
    background: #2196F3;
    border-color: #1976D2;
    color: white;
}

.overland-routes-menu-reset.active .overland-routes-menu-reset-title,
.overland-routes-menu-reset.active .overland-routes-menu-reset-subtitle {
    color: white;
}

.overland-routes-menu-reset-icon {
    font-size: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
}

.overland-routes-menu-reset.active .overland-routes-menu-reset-icon {
    background: rgba(255, 255, 255, 0.2);
}

.overland-routes-menu-reset-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.overland-routes-menu-reset-title {
    font-size: 16px;
    font-weight: 700;
    color: #1976D2;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.overland-routes-menu-reset-subtitle {
    font-size: 13px;
    color: #64b5f6;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Séparateur */
.overland-routes-menu-separator {
    height: 1px;
    background: #e0e0e0;
    margin: 12px 0;
}

.overland-routes-menu-item {
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.overland-routes-menu-item:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.overland-routes-menu-item.active {
    background: #e3f2fd;
    border-color: #2196F3;
}

.overland-routes-menu-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.overland-routes-menu-item-author {
    font-size: 14px;
    color: #666;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Overland Routes Custom Routes Selector */
.overland-routes-custom-controls {
    position: fixed;
    top: 80px;
    left: 16px;
    z-index: 998;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
}

.custom-routes-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 200px;
}

.custom-routes-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.custom-routes-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-routes-select:hover {
    border-color: #999;
}

.custom-routes-select:focus {
    outline: none;
    border-color: #007bff;
}

/* Layer Selection Buttons */
.layer-selection-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    border-radius: 32px;
    height: 64px;
    padding: 0 10px;
}

.layer-selection-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: transparent;
    padding: 0;
}

.layer-selection-btn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.layer-selection-btn.active {
    opacity: 1;
}

.layer-selection-btn:not(.active) {
    opacity: 1;
}

/* Legend Overlay */
.legend-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.legend-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

/* Generic Legend Wrapper */
.generic-legend-wrapper {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 1999;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Le bas du rectangle de légende doit être aligné avec le bas du bouton legend */
.generic-legend-wrapper.with-layer-controls {
    bottom: 82px; /* 18px (position sélecteur) + 64px (hauteur sélecteur) = 82px, 0px d'espacement */
}

.generic-legend-wrapper.show {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Generic Legend Popup */
.generic-legend {
    position: relative;
    background: #FFFFFF;
    border-radius: 30px;
    padding: 24px;
    max-width: 320px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    z-index: 2000;
    pointer-events: auto;
}

.generic-legend-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.generic-legend-content .legend-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.generic-legend-content .legend-section label {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.generic-legend-content .legend {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.generic-legend-content .legend.legend-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
}

.generic-legend-content .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.generic-legend-content .legend-two-columns .legend-item {
    gap: 10px;
}

.generic-legend-content .legend-item img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.generic-legend-content .legend-two-columns .legend-item img {
    width: 20px;
    height: 20px;
}

.generic-legend-content .legend-line {
    border-radius: 2px;
    flex-shrink: 0;
}

.legend-credits {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-credits-two-lines {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.credits-text {
    font-size: 11px;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.credits-text a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.credits-text a:hover {
    color: #666;
    text-decoration: underline;
}

/* Legend Close Button */
.legend-close-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.legend-close-btn .collapse-icon {
    width: 30px;
    height: 30px;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

@media (max-width: 768px) {
    .legend-controls {
        bottom: 8px; /* Plus près du bas de la page sur mobile */
        left: 50%;
        transform: translateX(-50%);
    }
    
    
    .generic-legend-wrapper.with-layer-controls {
        bottom: 82px; /* 18px (position sélecteur) + 64px (hauteur sélecteur) = 82px, 0px d'espacement */
    }
    
    .legend-controls.with-borders-visa {
        bottom: 82px; /* 18px (position sélecteur) + 64px (hauteur sélecteur) = 82px, 0px d'espacement */
    }
    
    .borders-visa-layer-controls {
        bottom: 18px; /* Distance réduite de moitié (36px -> 18px) sur mobile aussi */
    }
    
    .discover-layer-controls {
        bottom: 18px; /* Distance réduite de moitié (36px -> 18px) sur mobile aussi */
    }
    
    .generic-legend-wrapper {
        bottom: 8px; /* Plus près du bas de la page sur mobile */
    }
    
    .generic-legend-wrapper.with-layer-controls {
        bottom: 82px; /* 18px (position sélecteur) + 64px (hauteur sélecteur) = 82px */
    }
    
    .generic-legend {
        max-width: calc(100vw - 32px);
        padding: 20px;
    }
}

/* Visa Expiration Button - intégré dans la topbar, aligné à gauche */
.visa-expiration-toggle-btn {
    flex-shrink: 0;
    order: -1; /* Place le bouton en premier (à gauche) */
}

/* Visa Expiration Toggle Button - cercle avec icône calendrier centrée */
.visa-expiration-toggle-btn {
    background: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.visa-expiration-toggle-btn:hover {
    background: #f5f5f5;
}

.visa-expiration-calendar-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

/* Visa Expiration Open Button - collapse icon à 0° en dessous du toggle */
.visa-expiration-open-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-top: 4px;
}

.visa-expiration-open-btn:hover {
    background: #f5f5f5;
}

.visa-expiration-open-btn .collapse-icon-open {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: fill;
    transform: rotate(0deg);
}

/* Visa Expiration Close Button - collapse icon roté 180° en dessous de la popup */
.visa-expiration-close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    border: none;
    padding: 0;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
}

.visa-expiration-close-btn:hover {
    background: #f5f5f5;
}

.visa-expiration-close-btn .collapse-icon-close {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: fill;
    transform: rotate(180deg);
}

.visa-expiration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.visa-expiration-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: block;
}

/* Visa Expiration Calculator Wrapper */
.visa-expiration-wrapper {
    position: fixed;
    top: 72px; /* Même top que la top bar */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 1999;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mode WebView : ajuster le wrapper visa expiration */
.webview-mode .visa-expiration-wrapper {
    top: 20px; /* Même top que la top bar en mode WebView */
}

.visa-expiration-wrapper.show {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}


/* Visa Expiration Popup */
.visa-expiration-popup {
    position: relative;
    background: #FFFFFF;
    border-radius: 30px;
    padding: 24px;
    max-width: 400px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    z-index: 2000;
    pointer-events: auto;
    width: 100%;
    box-sizing: border-box;
}

.visa-expiration-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.visa-expiration-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.visa-expiration-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
}

.visa-expiration-date-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.visa-expiration-date-input {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.visa-expiration-date-input:hover {
    border-color: #ccc;
}

.visa-expiration-date-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.visa-expiration-days-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.visa-expiration-days-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.visa-expiration-day-btn {
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.visa-expiration-day-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.visa-expiration-day-btn.active {
    background: #e0e0e0;
    color: #333;
    border-color: #ccc;
}

.visa-expiration-custom-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.visa-expiration-custom-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.visa-expiration-custom-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.visa-expiration-custom-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
    min-width: 0;
}

.visa-expiration-custom-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    background: white;
    -moz-appearance: textfield; /* Firefox */
}

.visa-expiration-custom-input::-webkit-outer-spin-button,
.visa-expiration-custom-input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge */
    margin: 0;
}

.visa-expiration-custom-input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.visa-expiration-apply-btn {
    padding: 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    background: #e0e0e0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.visa-expiration-apply-btn:hover {
    background: #d0d0d0;
    border-color: #ccc;
}

.visa-expiration-result {
    padding: 0;
}

.visa-expiration-text {
    font-size: 14px;
    color: #333;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.visa-expiration-text.highlight {
    font-weight: 600;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .visa-expiration-popup {
        max-width: calc(100vw - 24px); /* Popup plus large (12px de chaque côté au lieu de 16px) */
        width: calc(100vw - 24px);
        padding: 20px 16px; /* Padding vertical augmenté, horizontal maintenu */
        border-radius: 20px;
        box-sizing: border-box;
    }
    
    .visa-expiration-content {
        gap: 18px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .visa-expiration-title {
        font-size: 16px;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 4px; /* Petit padding pour éviter que le texte touche les bords */
    }
    
    .visa-expiration-date-section,
    .visa-expiration-days-section {
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .visa-expiration-label {
        font-size: 13px;
        margin-bottom: 8px;
        padding: 0 2px; /* Petit padding pour alignement */
    }
    
    .visa-expiration-date-input {
        width: 100%;
        max-width: 100%;
        padding: 12px 14px;
        font-size: 16px; /* Taille augmentée pour meilleure lisibilité */
        box-sizing: border-box;
        border: 1px solid #e0e0e0;
        border-radius: 12px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    .visa-expiration-day-btn,
    .visa-expiration-custom-btn,
    .visa-expiration-custom-input,
    .visa-expiration-apply-btn {
        padding: 12px 14px;
        font-size: 15px;
        box-sizing: border-box;
    }
    
    .visa-expiration-days-buttons {
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .visa-expiration-custom-container {
        width: 100%;
        box-sizing: border-box;
    }
    
    .visa-expiration-custom-input-wrapper {
        gap: 8px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .visa-expiration-custom-input {
        flex: 1;
        min-width: 0;
        box-sizing: border-box;
    }
    
    .visa-expiration-result {
        width: 100%;
        box-sizing: border-box;
        padding: 0 2px; /* Petit padding pour alignement */
    }
}


