/* district/district-ui.css */

:root {
    /* --- UI Panel Design System --- */
    --ui-background: rgba(242, 242, 247, 0.8);
    --ui-backdrop-blur: 20px;
    --ui-border-color: rgba(0, 0, 0, 0.1);
    --ui-border-radius: 16px;
    --ui-box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --ui-padding: 1rem;
    --ui-screen-margin: 10px;
}

/* --- New Unified Map Controls Container --- */
#map-controls-container {
    position: fixed;
    right: calc(var(--ui-screen-margin) + env(safe-area-inset-right));
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: bottom 0.3s ease-out, opacity 0.3s ease-out;
    bottom: 80px;
}

/* --- Leaflet UI Overrides --- */
.leaflet-bottom.leaflet-right {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
}

.leaflet-bar {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaflet-bar a {
    width: 48px !important;
    height: 48px !important;
    line-height: 48px !important;
    border-radius: 16px !important;
    background-color: #ffffff !important;
    border: 1px solid var(--ui-border-color) !important;
    color: #000000 !important;
    font-size: 26px !important;
    transition: background-color 0.2s ease;
    box-shadow: var(--ui-box-shadow) !important;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    font: bold 26px 'Lucida Console', Monaco, monospace !important; /* Fallback font */
    text-indent: -9999px;
    overflow: hidden;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 24px 24px !important;
}

.leaflet-control-zoom-in {
    background-image: url(../components/svg/svg_ui/plus.svg) !important;
}

.leaflet-control-zoom-out {
    background-image: url(../components/svg/svg_ui/min.svg) !important;
}

.leaflet-bar a+a {
    border-top: none !important;
}

/* --- Custom Geolocation Button Styles --- */
.custom-control-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background-color: #ffffff;
    border: 1px solid var(--ui-border-color);
    box-shadow: var(--ui-box-shadow);
    color: #000000;
    cursor: pointer;
    transition: background-color 0.2s ease;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 26px 26px;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
}

/*
  INTERACTION STYLES for map control buttons.
  - `:active` provides immediate feedback on tap for all devices.
  - `:hover` is restricted to devices that can truly hover (like a mouse),
    preventing the "sticky hover" effect on touchscreens.
*/

/* 1. Tap/Click feedback (for ALL devices) */
.leaflet-bar a:active,
.custom-control-btn:active {
    background-color: #f0f0f0 !important; /* Use !important to ensure override */
}

/* 2. Hover feedback (ONLY for devices with a mouse/fine pointer) */
@media (hover: hover) and (pointer: fine) {
    .leaflet-bar a:hover,
    .custom-control-btn:hover {
        background-color: #f0f0f0 !important; /* Use !important to ensure override */
    }
}
