/*
 * SahaseninMap full-screen safe-area support.
 * Native MAUI values and browser safe-area environment values are both used.
 */

body.sahasenin-map-fullscreen-active {
    padding: 0 !important;
    background: #071e14 !important;
}

body.maui-full-screen-app.sahasenin-map-fullscreen-active::before,
body.maui-full-screen-app.sahasenin-map-fullscreen-active::after {
    background: transparent !important;
    box-shadow: none !important;
}

.map-container.is-map-fullscreen,
.map-container.is-fullscreen {
    --sahasenin-map-safe-top: max(env(safe-area-inset-top, 0px), var(--maui-safe-area-top, 0px));
    --sahasenin-map-safe-right: env(safe-area-inset-right, 0px);
    --sahasenin-map-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--maui-safe-area-bottom, 0px));
    --sahasenin-map-safe-left: env(safe-area-inset-left, 0px);
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.map-container.is-map-fullscreen > #sahaseninMap,
.map-container.is-map-fullscreen > .leaflet-container,
.map-container.is-fullscreen > #sahaseninMap,
.map-container.is-fullscreen > .leaflet-container {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.map-container.is-map-fullscreen .leaflet-control-container .leaflet-top.leaflet-left,
.map-container.is-map-fullscreen .leaflet-control-container .leaflet-top.leaflet-right,
.map-container.is-fullscreen .leaflet-control-container .leaflet-top.leaflet-left,
.map-container.is-fullscreen .leaflet-control-container .leaflet-top.leaflet-right {
    top: var(--sahasenin-map-safe-top) !important;
}

.map-container.is-map-fullscreen .leaflet-control-container .leaflet-bottom.leaflet-left,
.map-container.is-fullscreen .leaflet-control-container .leaflet-bottom.leaflet-left {
    bottom: var(--sahasenin-map-safe-bottom) !important;
}

.map-container.is-map-fullscreen .leaflet-control-container .leaflet-top.leaflet-left,
.map-container.is-map-fullscreen .leaflet-control-container .leaflet-bottom.leaflet-left,
.map-container.is-fullscreen .leaflet-control-container .leaflet-top.leaflet-left,
.map-container.is-fullscreen .leaflet-control-container .leaflet-bottom.leaflet-left {
    left: var(--sahasenin-map-safe-left) !important;
}

.map-container.is-map-fullscreen .leaflet-control-container .leaflet-top.leaflet-right,
.map-container.is-fullscreen .leaflet-control-container .leaflet-top.leaflet-right {
    right: var(--sahasenin-map-safe-right) !important;
}

.map-container.is-map-fullscreen .leaflet-control-container .leaflet-bottom.leaflet-left,
.map-container.is-fullscreen .leaflet-control-container .leaflet-bottom.leaflet-left {
    width: auto !important;
    right: var(--sahasenin-map-safe-right) !important;
}

.map-container.is-map-fullscreen .sahasenin-map-access-overlay,
.map-container.is-fullscreen .sahasenin-map-access-overlay {
    padding:
        calc(18px + var(--sahasenin-map-safe-top))
        calc(18px + var(--sahasenin-map-safe-right))
        calc(18px + var(--sahasenin-map-safe-bottom))
        calc(18px + var(--sahasenin-map-safe-left));
}
