.leaflet-top { z-index: 900 !important; }
.leaflet-bottom { z-index: 900 !important; }

/* --- Mobile Fix: Lift all bottom controls above browser toolbars --- */
.leaflet-bottom {
    /* Pushes bottom elements up to avoid iOS/Android bottom swipe bars */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Push the Layers panel slightly higher on mobile */
@media (max-width: 768px) {
    .leaflet-bottom.leaflet-right {
        bottom: 35px !important; 
    }
}

/* --- Custom Bottom Center Container for Scales --- */
.leaflet-bottom.leaflet-center {
    position: absolute;
    /* Base height for desktop */
    bottom: 20px; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    pointer-events: none; 
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Push scales significantly higher specifically for mobile screens */
@media (max-width: 768px) {
    .leaflet-bottom.leaflet-center {
        bottom: 45px !important; 
    }
}

.leaflet-bottom.leaflet-center .leaflet-control {
    pointer-events: auto;
    margin-bottom: 4px;
    margin-left: 0;
    margin-right: 0;
}
/* -------------------------------------------------------- */

/* Wrapper to allow smooth rotation */

.length-label-container {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

/* Neat text label with Arial and a thin buffer */
.length-label {
    font-family: Arial, Helvetica, sans-serif; /* Added Arial font */
    color: #ffffff; 
    /* Thin, crisp 1px black outline */
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000; 
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    white-space: nowrap;
    text-align: center;
}

/* Force standard graphical scale to be highly visible over satellite */
.leaflet-control-scale-line {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 2px solid #222 !important;
    border-top: none !important;
    color: #000 !important;
    font-weight: 800 !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5) !important;
}

/* Numerical Scale Styling */
.numerical-scale {
    background: rgba(255, 255, 255, 0.85);
    padding: 3px 8px;
    border: 2px solid #222;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    font-weight: 800;
    color: #000;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.animate-fade-in { animation: fadeIn 0.3s ease-out forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
