#map-container {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    box-sizing: border-box; /* Inclut les paddings dans la largeur */
    margin: 0; /* Assure qu'il n'y a pas de marge externe */
    padding: 0; /* Assure qu'il n'y a pas de padding */
    flex: 1;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 1;
    box-sizing: border-box; /* Inclut les paddings dans la largeur */
}

.leaflet-popup-content {
    font-size: 14px;
}

.leaflet-popup-content h3 {
    margin: 5px 0;
    color: #3498db;
}

.elevation-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* GPX waypoint icons */
.gpx-waypoint-icon {
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

.start-icon {
    background-color: green;
    border: 2px solid white;
}

.end-icon {
    background-color: red;
    border: 2px solid white;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
    display: none;
}

/* Download control */
.leaflet-control-download a {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    width: 30px;
    height: 30px;
    text-decoration: none;
}

.leaflet-control-download a:hover {
    background-color: #f4f4f4;
}

.download-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Info control */
.leaflet-control-info a {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    width: 30px;
    height: 30px;
    text-decoration: none;
}

.leaflet-control-info a:hover {
    background-color: #f4f4f4;
}

.info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23333'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* PDF control */
.leaflet-control-pdf a {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    width: 30px;
    height: 30px;
    text-decoration: none;
}

.leaflet-control-pdf a:hover {
    background-color: #f4f4f4;
}

.pdf-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23e74c3c'%3E%3Cpath d='M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* PDF Popup */
.pdf-popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

.pdf-wrapper {
    position: relative;
    width: 100%;
    height: 85%;
    max-width: 900px;
    background-color: white;
    border-radius: 8px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.pdf-canvas {
    display: block;
    margin: 0 auto;
    background-color: white;
}

.pdf-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    background-color: #f4f4f4;
    border-top: 1px solid #ddd;
}

.pdf-control-btn {
    margin: 0 5px;
    padding: 5px 10px;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.pdf-control-btn:hover {
    background-color: #e6e6e6;
}

.pdf-page-counter {
    margin: 0 10px;
    font-size: 14px;
}

.pdf-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e74c3c;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.pdf-popup-close:hover {
    background-color: #c0392b;
}

.pdf-error {
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    text-align: center;
    border-radius: 5px;
}

.pdf-fallback, .pdf-new-tab-option {
    margin-top: 15px;
    padding: 10px 15px;
    background-color: white;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.pdf-fallback a, .pdf-new-tab-option a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.pdf-fallback a:hover, .pdf-new-tab-option a:hover {
    text-decoration: underline;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .pdf-popup-container {
        padding: 10px;
    }
    
    .pdf-wrapper {
        width: 100%;
        height: 75%;
    }
    
    .pdf-popup-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    
    .pdf-controls {
        padding: 5px;
    }
    
    .pdf-control-btn {
        padding: 4px 8px;
        margin: 0 3px;
    }
    
    .pdf-page-counter {
        font-size: 12px;
        margin: 0 5px;
    }
}