/* ==========================================================================
   GTA SA SAMP STALKER MAP - STYLESHEET
   Tactical PDA Radar Aesthetic
   ========================================================================== */

:root {
    --bg-dark: #0a0e14;
    --bg-panel: #111722;
    --bg-card: #18202e;
    --bg-hover: #212c3d;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 229, 255, 0.25);

    --primary-color: #00e5ff;
    --primary-glow: rgba(0, 229, 255, 0.4);
    
    --amber-color: #ff9900;
    --green-stalker: #00ff66;
    
    --color-zharka: #ff3838;
    --color-gazirovka: #2ed573;
    --color-elektra: #1e90ff;
    --color-tramplin: #3742fa;
    --color-medusa: #eccc68;
    --color-bubble: #a4b0be;
    --color-cache: #ff4757;
    
    --text-main: #e0e6ed;
    --text-muted: #808e9b;
    --text-bright: #ffffff;
    
    --sidebar-width: 320px;
    --header-height: 64px;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
}

.app-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
}

/* ==========================================================================
   TOP NAVIGATION
   ========================================================================== */
.top-nav {
    height: var(--header-height);
    background: linear-gradient(180deg, #161e2b 0%, #0d121a 100%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pda-status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--green-stalker);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--green-stalker);
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
}

.brand-icon {
    font-size: 22px;
    color: var(--amber-color);
    filter: drop-shadow(0 0 6px rgba(255, 153, 0, 0.5));
}

.brand-text h1 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-bright);
}

.brand-text h1 span {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 12px;
}

.subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.top-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 12px;
    width: 280px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 12px var(--primary-glow);
}

.search-box i {
    color: var(--text-muted);
    font-size: 13px;
}

.search-box input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 8px 10px;
    color: var(--text-bright);
    font-size: 13px;
    outline: none;
}

.search-box input::placeholder {
    color: #536273;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.btn-icon:hover {
    color: var(--text-bright);
}

.quick-stats {
    display: flex;
    gap: 10px;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--primary-color);
}

.stat-badge.hazard {
    background: rgba(255, 153, 0, 0.08);
    border-color: rgba(255, 153, 0, 0.3);
    color: var(--amber-color);
}

.map-version-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 10px;
    color: var(--amber-color);
    font-size: 12px;
}

.map-version-selector select {
    background: transparent;
    border: none;
    color: var(--text-bright);
    font-size: 12px;
    padding: 8px 4px;
    outline: none;
    cursor: pointer;
}

.map-version-selector select option {
    background: var(--bg-card);
    color: var(--text-bright);
}

.view-mode-selector {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 3px;
    gap: 2px;
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
    background: var(--primary-color);
    color: #000;
    font-weight: 600;
}

/* ==========================================================================
   WORKSPACE & SIDEBAR
   ========================================================================== */
.main-workspace {
    display: flex;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    z-index: 90;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed {
    margin-left: calc(-1 * var(--sidebar-width));
}

/* Floating button that reopens the sidebar once it has been collapsed */
.open-sidebar-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;
    background: rgba(17, 23, 34, 0.92);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 95;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 12px var(--primary-glow);
    transition: all 0.2s ease;
}

.open-sidebar-btn:hover {
    background: var(--primary-color);
    color: #000;
}

.open-sidebar-btn.hidden {
    display: none;
}

/* Backdrop behind the sidebar when it's opened as a drawer on mobile */
.sidebar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 85;
}

.sidebar-backdrop.hidden {
    display: none;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--text-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-toggle-sidebar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-bright);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.sidebar-content::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: #253347;
    border-radius: 3px;
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 11px;
    cursor: pointer;
}

.filter-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-card:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.filter-card input[type="checkbox"] {
    display: none;
}

.filter-card.active {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.03);
}

.marker-icon-preview {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.marker-icon-preview.zharka { background: var(--color-zharka); box-shadow: 0 0 8px rgba(255, 56, 56, 0.4); }
.marker-icon-preview.gazirovka { background: var(--color-gazirovka); box-shadow: 0 0 8px rgba(46, 213, 115, 0.4); }
.marker-icon-preview.elektra { background: var(--color-elektra); box-shadow: 0 0 8px rgba(30, 144, 255, 0.4); }
.marker-icon-preview.tramplin { background: var(--color-tramplin); box-shadow: 0 0 8px rgba(55, 66, 250, 0.4); }
.marker-icon-preview.medusa { background: #333; color: var(--color-medusa); border: 1px solid var(--color-medusa); }
.marker-icon-preview.voda { background: #00d2d3; color: #fff; box-shadow: 0 0 8px rgba(0, 210, 211, 0.4); }
.marker-icon-preview.luna { background: #f1c40f; color: #000; box-shadow: 0 0 8px rgba(241, 196, 15, 0.4); }

.marker-icon-preview.lomot_myasa { background: #881111; color: #ff8888; box-shadow: 0 0 8px rgba(136, 17, 17, 0.5); }
.marker-icon-preview.alenkiy_cvetochek { background: #e84393; color: #fff; box-shadow: 0 0 8px rgba(232, 67, 147, 0.4); }
.marker-icon-preview.vyvert { background: #1dd1a1; color: #000; box-shadow: 0 0 8px rgba(29, 209, 161, 0.4); }
.marker-icon-preview.kolobok { background: #ff9f43; color: #000; box-shadow: 0 0 8px rgba(255, 159, 67, 0.4); }
.marker-icon-preview.nychka { background: var(--color-cache); }
.marker-icon-preview.nychka_zona { background: #20bf6b; color: #000; box-shadow: 0 0 8px rgba(32, 191, 107, 0.5); }
.marker-icon-preview.konteyner { background: #54a0ff; color: #fff; box-shadow: 0 0 8px rgba(84, 160, 255, 0.4); }
.marker-icon-preview.tochka_skanirovaniya { background: #7158e2; color: #fff; box-shadow: 0 0 8px rgba(113, 88, 226, 0.4); }
.marker-icon-preview.zolotaya_rybka { background: #ffb142; color: #000; box-shadow: 0 0 8px rgba(255, 177, 66, 0.4); }

.marker-icon-preview.ranenny_brodyaga { background: #576574; color: #ffdd59; box-shadow: 0 0 8px rgba(87, 101, 116, 0.4); }
.marker-icon-preview.ranenny_stalker { background: #8395a7; color: #ff4d4d; box-shadow: 0 0 8px rgba(131, 149, 167, 0.4); }
.marker-icon-preview.ranenaya_zhertva { background: #c0392b; color: #fff; box-shadow: 0 0 8px rgba(192, 57, 43, 0.4); }
.marker-icon-preview.mesto_lovli_ryby { background: #0abde3; color: #000; box-shadow: 0 0 8px rgba(10, 189, 227, 0.4); }

.marker-icon-preview.zone { background: rgba(255, 153, 0, 0.2); border: 1px dashed var(--amber-color); color: var(--amber-color); }
.marker-icon-preview.zone-safe { background: rgba(46, 204, 113, 0.2); border: 1px dashed #2ecc71; color: #2ecc71; }
.marker-icon-preview.zone-contested { background: rgba(230, 126, 34, 0.2); border: 1px dashed #e67e22; color: #e67e22; }
.marker-icon-preview.zone-danger { background: rgba(255, 71, 87, 0.2); border: 1px dashed #ff4757; color: #ff4757; }

.marker-icon-preview.base_stalker { background: #e67e22; color: #000; box-shadow: 0 0 10px rgba(230, 126, 34, 0.6); }
.marker-icon-preview.base_bandit { background: #2980b9; color: #fff; box-shadow: 0 0 8px rgba(41, 128, 185, 0.5); }
.marker-icon-preview.base_mutant { background: #e74c3c; color: #fff; box-shadow: 0 0 8px rgba(231, 76, 60, 0.5); }
.marker-icon-preview.base_enclave { background: #10ac84; color: #fff; box-shadow: 0 0 8px rgba(16, 172, 132, 0.5); }

.filter-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-name {
    font-weight: 500;
    color: var(--text-main);
}

.filter-count {
    font-family: var(--font-mono);
    font-size: 11px;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

.tools-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tool-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.author-credits {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 153, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-top: auto;
}

.credits-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--amber-color);
    margin-bottom: 6px;
}

.credits-author {
    font-size: 12px;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.credits-note {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   MAP VIEWPORT & CANVAS
   ========================================================================== */
.map-viewport {
    flex: 1;
    position: relative;
    background-color: #080b0f;
    overflow: hidden;
    cursor: grab;
}

.map-viewport:active {
    cursor: grabbing;
}

.map-hud-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 80;
}

.hud-btn {
    width: 38px;
    height: 38px;
    background: rgba(17, 23, 34, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hud-btn:hover {
    background: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow);
}

.coords-hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(17, 23, 34, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 80;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.hud-label {
    color: var(--text-muted);
    font-size: 11px;
}

.hud-label.zoom-label {
    margin-left: 10px;
}

.coords-hud.hidden {
    display: none;
}

#coordsVal, #zoomLevelVal {
    color: var(--primary-color);
    font-weight: 600;
}

/* Map Container & Scale */
.map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
}

.map-wrapper {
    position: relative;
    width: 3000px;
    height: 3000px;
}

.map-background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transition: background-image 0.3s ease;
}

/* SVG Hazard Zones Layer */
.zones-svg-layer, .ruler-svg-layer, .zone-draw-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.zone-draw-svg-layer {
    z-index: 15;
}

/* Markers Layer */
.markers-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
}

.map-marker {
    position: absolute;
    transform: translate(-50%, -50%) scale(var(--marker-scale, 1));
    cursor: pointer;
    z-index: 25;
    transition: transform 0.15s ease-out;
}

.map-marker:hover {
    transform: translate(-50%, -50%) scale(calc(var(--marker-scale, 1) * 1.35));
    z-index: 50;
}

.marker-inner {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
    position: relative;
}

/* Marker Types Styling */
.map-marker.zharka .marker-inner {
    background: radial-gradient(circle, #ff5252 0%, #d32f2f 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(255, 56, 56, 0.8);
}

.map-marker.gazirovka .marker-inner {
    background: radial-gradient(circle, #2ecc71 0%, #27ae60 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(46, 213, 115, 0.8);
}

.map-marker.elektra .marker-inner {
    background: radial-gradient(circle, #00d2d3 0%, #0abde3 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.9);
}

.map-marker.tramplin .marker-inner {
    background: radial-gradient(circle, #5f27cd 0%, #341f97 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(95, 39, 205, 0.9);
}

.map-marker.medusa .marker-inner {
    background: #1e1e1e;
    border: 2px solid #f1c40f;
    color: #f1c40f;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.7);
}

.map-marker.bubble .marker-inner {
    background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
    border: 2px solid #dfe6e9;
    width: 36px;
    height: 36px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.map-marker.cache .marker-inner {
    background: #e74c3c;
    border-radius: 4px;
    width: 28px;
    height: 24px;
    border: 2px solid #fff;
    box-shadow: 0 0 12px rgba(231, 76, 60, 0.8);
}

.map-marker.nychka_zona .marker-inner {
    background: radial-gradient(circle, #20bf6b 0%, #079856 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 15px rgba(32, 191, 107, 0.85);
}

.map-marker.base_stalker .marker-inner {
    background: radial-gradient(circle, #e67e22 0%, #d35400 100%);
    border: 2px solid #f39c12;
    color: #000;
    box-shadow: 0 0 15px rgba(230, 126, 34, 0.8);
}

.map-marker.base_bandit .marker-inner {
    background: radial-gradient(circle, #2980b9 0%, #1c5980 100%);
    border: 2px solid #3498db;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(41, 128, 185, 0.8);
}

.map-marker.base_mutant .marker-inner {
    background: radial-gradient(circle, #e74c3c 0%, #c0392b 100%);
    border: 2px solid #ff6b6b;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
}

.map-marker.base_enclave .marker-inner {
    background: radial-gradient(circle, #00cec9 0%, #10ac84 100%);
    border: 2px solid #55efc4;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 206, 201, 0.8);
}

.marker-label {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 14, 20, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    margin-top: 4px;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Pulsing effect for key markers */
.map-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid currentColor;
    opacity: 0;
    animation: markerPulse 2s infinite ease-out;
}

@keyframes markerPulse {
    0% { width: 100%; height: 100%; opacity: 0.8; }
    100% { width: 220%; height: 220%; opacity: 0; }
}

/* Details Floating Panel */
.marker-details-card {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 320px;
    background: rgba(17, 23, 34, 0.92);
    border: 1px solid var(--border-glow);
    border-radius: 12px;
    padding: 16px;
    z-index: 150;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.3s ease-out;
}

.marker-details-card.hidden {
    display: none;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-card-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
}

.close-card-btn:hover {
    color: var(--text-bright);
}

.card-header {
    margin-bottom: 12px;
}

.card-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--primary-color);
    color: #000;
    margin-bottom: 6px;
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--text-bright);
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-prop {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.prop-label {
    font-size: 11px;
    color: var(--text-muted);
}

.prop-val {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
}

.prop-val.desc {
    font-size: 12px;
    color: #b0bec5;
    line-height: 1.4;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.card-actions {
    margin-top: 10px;
}

.action-btn {
    width: 100%;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--primary-color);
    color: #000;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */
@media (max-width: 768px) {
    html, body {
        /* Prevent double-tap zoom / rubber-banding from fighting our own pan-zoom engine */
        touch-action: manipulation;
    }

    :root {
        --header-height: auto;
    }

    .top-nav {
        height: auto;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
    }

    .brand {
        gap: 8px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .brand-icon {
        font-size: 18px;
    }

    .brand-text h1 {
        font-size: 12px;
    }

    .brand-text h1 span {
        display: none;
    }

    .subtitle {
        display: none;
    }

    .top-controls {
        width: 100%;
        gap: 8px;
        flex-wrap: wrap;
        order: 3;
    }

    .search-box {
        width: 100%;
        order: 1;
        flex: 1 1 100%;
    }

    .quick-stats {
        display: flex;
        order: 3;
        gap: 6px;
    }

    .stat-badge {
        font-size: 10px;
        padding: 5px 8px;
    }

    .map-version-selector {
        order: 4;
        font-size: 11px;
        padding: 0 6px;
    }

    .view-mode-selector {
        order: 5;
        flex: 1 1 auto;
    }

    .mode-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 6px;
        font-size: 11px;
    }

    .mode-btn span, .mode-btn {
        white-space: nowrap;
    }

    .admin-toggle-btn {
        order: 6;
        padding: 8px 12px;
        font-size: 12px;
    }

    .admin-toggle-btn span {
        display: none;
    }

    /* Sidebar becomes a full-height slide-in drawer above the map */
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: min(85vw, 320px);
        z-index: 95;
        transition: transform 0.3s ease;
        transform: translateX(0);
        margin-left: 0;
    }

    .sidebar.collapsed {
        margin-left: 0;
        transform: translateX(-105%);
    }

    .open-sidebar-btn {
        top: 12px;
    }

    /* Map HUD & controls shrink and reposition to stay reachable with a thumb */
    .map-hud-controls {
        top: auto;
        bottom: 90px;
        right: 12px;
        gap: 6px;
    }

    .hud-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .coords-hud {
        left: 12px;
        right: 12px;
        bottom: 12px;
        width: auto;
        font-size: 10px;
        padding: 6px 10px;
        justify-content: space-between;
    }

    /* Marker details become a bottom sheet instead of a floating card */
    .marker-details-card {
        left: 10px;
        right: 10px;
        bottom: 10px;
        width: auto;
        max-height: 65vh;
        overflow-y: auto;
    }

    /* Admin HUD banner wraps and scrolls its actions horizontally */
    .admin-hud-banner {
        top: 8px;
        max-width: calc(100% - 20px);
        flex-wrap: wrap;
        justify-content: center;
        white-space: normal;
        padding: 8px 12px;
    }

    .admin-hint {
        display: none;
    }

    .admin-actions {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-btn {
        font-size: 10px;
        padding: 5px 8px;
    }

    /* Modals become near-fullscreen and scroll internally */
    .modal-card {
        width: 95vw;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .modal-body {
        overflow-y: auto;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .zone-draw-banner, .zone-draw-toolbar {
        max-width: calc(100% - 20px);
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   ADMIN PANEL & MARKER EDITOR STYLING
   ========================================================================== */
.admin-toggle-btn {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid #ff4757;
    color: #ff4757;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.admin-toggle-btn:hover, .admin-toggle-btn.active {
    background: #ff4757;
    color: #fff;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
}

.admin-hud-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(12, 16, 24, 0.94);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 20px;
    padding: 4px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 120;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    animation: fadeInDown 0.3s ease;
    max-width: calc(100% - 40px);
    white-space: nowrap;
}

.admin-hud-banner.hidden {
    display: none;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translate(-50%, -15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.admin-status {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.admin-hint {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .admin-hint {
        display: none;
    }
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.admin-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-bright);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.admin-btn.danger {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.4);
    color: #ff6b81;
}

.admin-btn.danger:hover {
    background: #ff4757;
    color: #fff;
}

/* Card Admin Action Buttons */
.card-admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.card-admin-actions.hidden {
    display: none;
}

.share-toast.hidden {
    display: none;
}

.action-btn.edit {
    background: rgba(255, 153, 0, 0.15);
    border-color: var(--amber-color);
    color: var(--amber-color);
}

.action-btn.edit:hover {
    background: var(--amber-color);
    color: #000;
}

.action-btn.delete {
    background: rgba(255, 71, 87, 0.15);
    border-color: #ff4757;
    color: #ff4757;
}

.action-btn.delete:hover {
    background: #ff4757;
    color: #fff;
}

/* Modal Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    width: 440px;
    max-width: 90vw;
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 229, 255, 0.2);
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text-bright);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.btn-secondary:hover {
    color: var(--text-bright);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: #000;
    font-weight: 700;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-primary:hover {
    background: #33ecff;
}

/* ==========================================================================
   PHOTO DISPLAY (DETAILS CARD) & IMAGE UPLOAD (MODAL)
   ========================================================================== */

/* --- Details card photo block --- */
.card-photo-wrap {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.4);
    cursor: zoom-in;
}

.card-photo-wrap.hidden {
    display: none;
}

.card-photo-wrap img {
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card-photo-wrap:hover img {
    transform: scale(1.03);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    padding: 18px 10px 6px;
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
}

/* Full-screen lightbox on click */
.photo-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease;
}

.photo-lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 6px;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
}

/* --- Modal image upload area --- */
.img-upload-area {
    position: relative;
    border: 1.5px dashed var(--border-color);
    border-radius: 8px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.img-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(0, 229, 255, 0.04);
}

.img-upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(0, 229, 255, 0.08);
}

.img-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    pointer-events: none;
    text-align: center;
    padding: 16px;
}

.img-upload-placeholder i {
    font-size: 26px;
    color: #3d5068;
}

.img-upload-placeholder span {
    font-size: 12px;
}

.img-upload-placeholder small {
    font-size: 10px;
    color: #3d5068;
}

.img-upload-preview {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.img-upload-preview.hidden {
    display: none;
}

.img-remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}

.img-remove-btn.hidden {
    display: none;
}

.img-remove-btn:hover {
    background: #ff4757;
}

.zones-svg-layer polygon {
    transition: opacity 0.2s, stroke-width 0.2s;
}
.zones-svg-layer polygon.admin-clickable:hover {
    opacity: 0.8;
    stroke-width: 4;
}

/* 2x2 Form Row for rectangular SAMP coordinates */
.form-row-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 4px;
}
.form-row-2x2 input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 8px;
    color: var(--text-bright);
    font-family: var(--font-mono);
    font-size: 12px;
}

/* Zone Manager List */
.zone-manager-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}
.zone-empty-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    padding: 4px 0;
}
.zone-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px 10px;
    gap: 8px;
}
.zone-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}
.zone-item-title {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.zone-item-map-tag {
    font-size: 10px;
    color: var(--primary-color);
    font-family: var(--font-mono);
}
.zone-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-zone-action {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
}
.btn-zone-action:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.15);
}
.btn-zone-action.delete:hover {
    background: rgba(255, 71, 87, 0.2);
    border-color: #ff4757;
    color: #ff4757;
}

/* ==========================================================================
   GROUP FILTER TOGGLES (Все / Нет per section)
   ========================================================================== */
.group-toggles {
    display: flex;
    align-items: center;
    gap: 6px;
}

.group-toggles .btn-link {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.15s, color 0.15s;
    opacity: 0.8;
}

.group-toggles .btn-link:hover {
    opacity: 1;
    background: rgba(0, 229, 255, 0.12);
}

.group-toggles .group-none {
    color: #ff6b81;
}

.group-toggles .group-none:hover {
    background: rgba(255, 71, 87, 0.12);
}

/* ==========================================================================
   SHARE BUTTON & TOAST
   ========================================================================== */
.action-btn.share {
    background: rgba(0, 229, 255, 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.action-btn.share:hover {
    background: rgba(0, 229, 255, 0.25);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.25);
}

.share-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    color: #2ecc71;
    font-size: 12px;
    padding: 7px 12px;
    border-radius: 6px;
    margin-top: 6px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   MARKER HIGHLIGHT (URL sharing auto-open)
   ========================================================================== */
@keyframes markerPulse {
    0%   { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.8); transform: translate(-50%, -50%) scale(1.3); }
    50%  { box-shadow: 0 0 0 16px rgba(0, 229, 255, 0); transform: translate(-50%, -50%) scale(1.5); }
    100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); transform: translate(-50%, -50%) scale(1); }
}

.map-marker.marker-highlight .marker-inner {
    animation: markerPulse 0.7s ease 3;
    z-index: 999;
}

/* ==========================================================================
   DRAFT MODE STYLES
   ========================================================================== */
.draft-mode-banner {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(235, 77, 75, 0.9);
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(235, 77, 75, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
    letter-spacing: 0.5px;
}

.draft-mode-banner.hidden {
    display: none;
}

select option.draft-option {
    color: #ff4757;
    font-weight: bold;
}
