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

body, html {
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.main-flex-row {
    width: 100vw;
    height: 100vh;
}

#map-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

#route-buttons {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px 0;
    background: linear-gradient(to top, rgba(245,245,245,0.85) 60%, transparent 100%);
    z-index: 1200;
}

#reset-route-btn, #undo-route-btn {
    padding: 14px 36px;
    font-size: 1.2rem;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s, transform 0.1s;
}
#reset-route-btn {
    background: #0066cc;
    color: #fff;
}
#reset-route-btn:hover, #reset-route-btn:focus {
    background: #004a99;
    transform: scale(1.04);
}
#undo-route-btn {
    background: #ff9800;
    color: #fff;
}
#undo-route-btn:hover, #undo-route-btn:focus {
    background: #e65100;
    transform: scale(1.04);
}
#gps-btn {
    background: #888;
    color: #fff;
}
#gps-btn:hover, #gps-btn:focus {
    background: #666;
    transform: scale(1.04);
}
#gps-btn.gps-active {
    background: #2e7d32;
}
#gps-btn.gps-active:hover, #gps-btn.gps-active:focus {
    background: #1b5e20;
}

/* Route info pill — centered above the buttons */
#route-info {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #0066cc;
    border-radius: 24px;
    padding: 7px 22px;
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.14);
    z-index: 1300;
    display: none;
    pointer-events: none;
}

#route-info.visible {
    display: block;
}

/* Leaflet map styling */
.leaflet-container {
    border-radius: 0;
}

/* Style Leaflet legend (layer control) */
.leaflet-control-layers {
    font-size: 1rem !important;
    padding: 8px 12px !important;
    background: #c62828 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.leaflet-control-layers label,
.leaflet-control-layers-overlays span,
.leaflet-control-layers-base span {
    font-size: 1em !important;
    color: #fff !important;
    padding: 2px 0 !important;
}
.leaflet-control-layers-expanded {
    min-width: 120px;
}

#toggle-docking-btn { display: none !important; }

/* Mobile */
@media (max-width: 700px) {
    #map-container {
        position: fixed;
        inset: 0;
        width: 100vw;
        height: 100svh;
    }

    /* Buttons: compact column, top-left below zoom control */
    #route-buttons {
        top: 90px;
        left: 10px;
        bottom: auto;
        right: auto;
        width: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 0;
        background: none;
    }

    #reset-route-btn, #undo-route-btn, #gps-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        box-shadow: 0 2px 10px rgba(0,0,0,0.22);
    }

    /* Pill sits at the bottom of the screen */
    #route-info {
        bottom: 24px;
        font-size: 0.95rem;
        padding: 7px 20px;
    }
}
