/* Corrections pour GPX Viewer sur mobile */
@media screen and (max-width: 768px) {
    .gpxv-view {
        width: 100% !important;
        overflow-x: auto;
        margin-left: 0;
        box-sizing: border-box;
    }

    #map-container {
        width: 100% !important;
        min-height: 300px !important;
        height: 50vh !important; /* Use viewport height instead of fixed pixels */
    }

    #leaflet-map {
        width: 100% !important;
        height: 100% !important; /* Fill parent container */
        min-height: 300px !important;
    }

    .leaflet-container {
        width: 100% !important;
        height: 100% !important;
    }

    .leaflet-tile-pane,
    .leaflet-tile-container {
        width: 100% !important;
    }

    .track-info {
        width: 100% !important;
        overflow-x: auto;
    }

    .elevation-profile {
        width: 100% !important;
        height: auto !important;
        max-width: 100% !important;
    }

    .properties {
        width: 100% !important;
        font-size: 14px;
    }
}

/* Fullscreen mode fix */
.leaflet-container:-webkit-full-screen,
.leaflet-container:fullscreen,
#map-container:-webkit-full-screen,
#map-container:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
}

/* Mode portrait spécifique */
@media screen and (max-width: 480px) and (orientation: portrait) {
    #map-container {
        height: 40vh !important;
        min-height: 250px !important;
    }
    
    #leaflet-map,
    .leaflet-container {
        height: 100% !important;
        min-height: 250px !important;
    }
}

/* Landscape mode - give more height */
@media screen and (max-width: 768px) and (orientation: landscape) {
    #map-container {
        height: 70vh !important;
    }
}
