body, html {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

/* Map sits completely in the background below the navbar */
#map {
    position: absolute;
    top: 60px;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
}

/* Floating Sidebars */
.floating-sidebar {
    position: absolute;
    top: 70px;
    height: auto;
    max-height: calc(100dvh - 90px); /* 70px top + 20px desired bottom gap */
    overflow-y: auto; /* Makes the sidebar scrollable if content is too long */
    background: var(--bs-body-bg);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.sidebar-left {
    left: 10px;
    width: 320px;
    z-index: 0;
    opacity: 0;
}

.sidebar-left.show {
    transform: translateX(0);
    z-index: 1000;
    opacity: 1;
}

.sidebar-right {
    right: 10px;
    width: 350px;
    /*transform: translateX(120%);*/
    z-index: 0;
    opacity: 0;
}

.sidebar-right.show {
    transform: translateX(0);
    z-index: 1001;
    opacity: 1;
}

@media (max-width: 768px) {
    .floating-sidebar {
        width: calc(100% - 20px);
    }
}

/* Icon overrides for Custom Map Pins */
.custom-pin img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    transform: rotate(45deg);
    border: 1px solid white;
}

.custom-pin .emoji {
    font-size: 16px;
    transform: rotate(45deg);
    line-height: 1;
}

/* Custom Scrollbars for Sidebars */
.sidebar-body {
    overflow-y: auto;
    flex-grow: 1;
    padding: 15px;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-bg-light:hover {
    background-color: var(--bs-tertiary-bg);
}

[data-bs-theme="dark"] #map:not(.satellite-active)  {
    .leaflet-layer,
    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out,
    .leaflet-control-attribution {
        filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
    }
}

/* --- Desktop Mode --- */
@media (min-aspect-ratio: 1/1) {
    .nav-center-links {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 30px;
    }
     #mapClickAlert{
        margin-bottom: 1rem !important;
    }
}

/* --- Mobile Mode --- */
@media (max-aspect-ratio: 1/1) {
    .nav-center-links {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bs-body-bg);
        display: flex;
        justify-content: space-around;
        padding: 5px 0 10px 0;
        z-index: 1050; /* Stays above the map */
        border-top: 1px solid var(--bs-border-color);
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    }

    /* Push map and sidebars up so they aren't hidden behind the new bottom nav */
    #map { bottom: 55px !important; }
    /*.floating-sidebar { bottom: 85px !important; }*/
    
    #mapClickAlert{
        margin-bottom: 3rem !important;
    }
}

.leaflet-control-layers-toggle {
    background-image: url("../img/world2.png");
}


