/**
 * map_shared.css — shared Leaflet styles for web_app map pages.
 * Mirrors the relevant sections from widget_app/css/map.css (the authoritative source).
 * Do NOT load on widget_app pages — they use map.css directly.
 */

/* ── Leaflet control bar overrides ──────────────────────────────────────── */

.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
    border: none !important;
    box-shadow: none !important;
}

.leaflet-control-container .leaflet-control a {
    width: 34px !important;
    height: 34px !important;
    box-sizing: content-box !important;
    border: none !important;
}

/* ── Zoom controls ───────────────────────────────────────────────────────── */

.leaflet-control-zoom-in {
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    border-radius: 20px 20px 0 0 !important;
    border: 2px solid #E9F2EE !important;
    background-image: url("/static/widget_app/images/zoomin.d613d87422fb.svg") !important;
    background-size: 18px 18px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    touch-action: manipulation;
}

.leaflet-control-zoom-out {
    width: 38px !important;
    height: 38px !important;
    line-height: 38px !important;
    border-radius: 0 0 20px 20px !important;
    border: 2px solid #E9F2EE !important;
    background-image: url("/static/widget_app/images/zoomout.02ab1b3f4f68.svg") !important;
    background-size: 18px 18px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    touch-action: manipulation;
}

.leaflet-control-zoom-in span,
.leaflet-control-zoom-out span {
    display: none;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    border-color: rgba(0, 0, 0, 0.4) !important;
    background-color: #f5f5f5 !important;
}

/* ── Fullscreen button ───────────────────────────────────────────────────── */

.leaflet-control-fullscreen-button {
    background-color: #fff !important;
    border: 2px solid #E9F2EE !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 38px !important;
    height: 38px !important;
    cursor: pointer;
    text-decoration: none;
}
.leaflet-control-fullscreen-button:hover {
    background-color: #f5f5f5 !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
}
.leaflet-control-fullscreen-button img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
    margin: 0;
    padding: 0;
}

/* ── Custom attribution control ──────────────────────────────────────────── */

.leaflet-control-custom-attribution {
    background: #fff;
    border: 1px solid #E9F2EE !important;
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    position: relative;
    overflow: hidden;
    width: 28px;
    height: 28px;
}

.leaflet-control-custom-attribution.expanded {
    width: 306px;
    z-index: 1100;
}

.attribution-info-btn {
    background: #fff;
    border: 1px solid #E9F2EE !important;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    padding: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    color: #666;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    order: 2;
}

.attribution-info-btn:hover {
    background: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.attribution-info-btn img {
    width: 18px;
    height: 18px;
}

.attribution-text {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 0 12px 0 0;
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
    width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    order: 1;
    z-index: 1;
}

.attribution-text a { color: #666; }

.leaflet-control-custom-attribution.expanded .attribution-text {
    width: 306px;
    opacity: 1;
    padding-right: 8px;
}

/* ── Map lock button ─────────────────────────────────────────────────────── */

.map-lock-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    min-width: 180px;
    user-select: none;
}

.lock-btn {
    border-radius: 20px;
    border: 2px solid #E9F2EE !important;
    background: #fff;
    padding: 4px;
    margin: 0 0 0 11px;
    cursor: pointer;
}

.lock-btn.lock-icon {
    height: 40px;
    width: 40px;
}

#lock-icon { margin: 0; }

.lock-btn.lock-text {
    background-color: #fff;
    padding: 4px;
    height: 36px;
}

.lock-text span {
    background-color: #229966;
    border-radius: 20px;
    color: #fff;
    padding: 2px 6px;
    font-family: var(--font-primary, sans-serif);
    font-size: 1rem;
    font-weight: 400;
}

.lock-btn:hover {
    background-color: #f5f5f5;
    border-color: rgba(0, 0, 0, 0.4) !important;
}

.map-lock-button .lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.map-lock-button .lock-text {
    font-size: 0.875rem;
    line-height: 1.2;
    transition: all 0.3s ease;
}

/* Unlocked state — collapses to icon-only circle */
.map-lock-button.unlocked {
    min-width: auto;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.map-lock-button.unlocked .lock-text { display: none; }

/* Pulse animation (used by MapUtils.createLockSystem) */
@keyframes lock-button-pulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); box-shadow: 0 0 12px rgba(34, 153, 102, 0.6); }
    100% { transform: scale(1); }
}

.map-lock-button.pulse-animation {
    animation: lock-button-pulse 0.55s ease 3;
}

/* ── Map interaction overlay ─────────────────────────────────────────────── */

.map-interaction-overlay,
#map-interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1100;
    pointer-events: none;
}

.map-interaction-overlay.show,
#map-interaction-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* Raise Leaflet controls above the interaction overlay */
.leaflet-top,
.leaflet-bottom {
    z-index: 1200;
}

/* ── Shared dot marker (replaces page-specific .bh-map-marker / .bhl-map-marker) */

.map-dot-marker {
    width: 18px;
    height: 18px;
    background: #4c7c59;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s, background 0.15s;
}

.map-dot-marker--active {
    background: #166534;
    transform: scale(1.35);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
