/*
 * =====================================================================
 * FILE: public/css/map-layout.css
 * VERSION: 4 — Overhauled: cleaner tokens, tighter spacing, removed dead code
 * =====================================================================
 */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
    --m-pink: #E3007F;
    --m-pink-glow: rgba(227, 0, 127, 0.4);
    --m-pink-dim: rgba(227, 0, 127, 0.15);
    --m-cyan: #00D4FF;
    --m-cyan-dim: rgba(0, 212, 255, 0.15);
    --m-deep: #0A0015;
    --m-surface: rgba(10, 6, 18, 0.94);
    --m-text: #F0E6F6;
    --m-text-secondary: rgba(240, 230, 246, 0.65);
    --m-text-muted: rgba(240, 230, 246, 0.4);
    --m-border: rgba(227, 0, 127, 0.15);
    --m-font-display: 'Barlow Condensed', 'Oswald', system-ui, sans-serif;
    --m-font-body: 'Barlow', 'Inter', system-ui, -apple-system, sans-serif;
    --m-topbar-h: 52px;
    --m-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   BASE
   ============================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Reset border-color for map UI elements */
.map-app .map-topbar *,
.map-app .gta-sidebar *,
.map-app .gta-mobile-sheet *,
.map-app .gta-map-controls * { border-color: transparent; }

/* Restore for badges and inline borders */
.map-app .gta-badge-v2,
.map-app .gta-card-badge,
.map-app .map-detail-panel [class*="badge"],
.map-app .map-detail-panel [style*="border"] { border-color: initial; }

html, body { height: 100%; overflow: hidden; }
body {
    font-family: var(--m-font-body);
    background: var(--m-deep);
    color: var(--m-text);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

/* ============================================
   APP SHELL
   ============================================ */
.map-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ============================================
   TOP BAR
   ============================================ */
.map-app .map-topbar {
    height: var(--m-topbar-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--m-surface);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border-bottom: 1px solid var(--m-border);
    z-index: 100;
    position: relative;
}

.map-app .map-topbar::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--m-pink-dim), transparent);
    pointer-events: none;
}

.map-topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }

.map-topbar-back {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    color: var(--m-text-secondary);
    transition: all 0.15s ease;
}
.map-topbar-back:hover { background: rgba(255,255,255,0.06); color: #fff; }
.map-topbar-back svg { width: 18px; height: 18px; }

.map-topbar-brand { display: flex; align-items: center; flex-shrink: 0; }
.map-topbar-logo { height: 26px; flex-shrink: 0; }
.map-topbar-logo img { height: 100%; width: auto; display: block; }

.map-topbar-h1 {
    display: flex; align-items: center;
    margin: 0; padding: 0;
    font-size: inherit; font-weight: inherit;
    line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-topbar-h1-primary {
    font-family: var(--m-font-display);
    font-size: 0.92rem; font-weight: 700;
    letter-spacing: 0.06em; text-transform: uppercase; color: #fff;
}
.map-topbar-h1-divider {
    width: 1px; height: 14px;
    background: rgba(227, 0, 127, 0.35);
    margin: 0 10px; flex-shrink: 0;
}
.map-topbar-h1-secondary {
    font-family: var(--m-font-body);
    font-size: 0.68rem; font-weight: 500;
    color: var(--m-text-muted);
    letter-spacing: 0.04em; text-transform: uppercase;
}

@media (max-width: 480px) {
    .map-topbar-h1-divider, .map-topbar-h1-secondary { display: none; }
    .map-topbar-h1-primary { font-size: 0.82rem; }
}
@media (min-width: 481px) and (max-width: 767px) {
    .map-topbar-h1-secondary { display: none; }
}

.map-community-badge {
    display: none; align-items: center; gap: 5px;
    padding: 3px 9px 3px 7px;
    background: var(--m-cyan-dim);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 100px;
    font-family: var(--m-font-display);
    font-size: 0.6rem; font-weight: 600;
    color: var(--m-cyan);
    letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}
@media (min-width: 768px) { .map-community-badge { display: flex; } }
.map-community-badge svg { width: 11px; height: 11px; flex-shrink: 0; }

.map-topbar-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.map-topbar-btn {
    display: flex; align-items: center; justify-content: center; gap: 5px;
    height: 34px; padding: 0 10px; border-radius: 8px;
    font-family: var(--m-font-display);
    font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.03em; text-transform: uppercase;
    transition: all 0.15s ease; white-space: nowrap;
}
.map-topbar-btn svg { width: 15px; height: 15px; }
.map-topbar-btn-ghost {
    color: var(--m-text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
}
.map-topbar-btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.1);
    color: #fff;
}
.map-btn-label { display: none; }
@media (min-width: 640px) { .map-btn-label { display: inline; } }

/* ============================================
   MAIN
   ============================================ */
.map-app .map-main {
    flex: 1; min-height: 0;
    position: relative; overflow: hidden;
}

/* ============================================
   MAP PARTIAL OVERRIDES
   ============================================ */
.map-app .gta-map-wrapper { height: 100% !important; max-width: none !important; padding: 0 !important; margin: 0 !important; width: 100% !important; }
.map-app .gta-map-main { height: 100% !important; min-height: 0 !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; overflow: visible !important; }
.map-app .gta-sidebar { max-height: none !important; height: 100% !important; border-radius: 0 !important; }
.map-app .gta-map-container { border-radius: 0 !important; height: 100% !important; min-height: 0 !important; }
.map-app [id^="map_"] { height: 100% !important; min-height: 0 !important; }
.map-app .map-overlays { display: none !important; }

@media (max-width: 767px) {
    .map-app .gta-map-main { flex-direction: column !important; }
    .map-app .gta-map-container { flex: 1 !important; }
    .map-app .gta-mobile-fab { position: absolute !important; bottom: 16px !important; left: 16px !important; z-index: 1000 !important; }
    .map-app .gta-map-controls { bottom: 16px !important; right: 16px !important; }
    .map-app .gta-sheet-footer { padding-bottom: calc(12px + var(--m-safe-bottom)) !important; }
}

/* ============================================
   COMMUNITY NOTE
   ============================================ */
.map-community-note {
    margin: 4px 0 10px;
    padding: 10px 12px;
    background: var(--m-cyan-dim);
    border: 1px solid rgba(0, 212, 255, 0.12);
    border-radius: 10px;
    font-size: 0.72rem; line-height: 1.5;
    color: var(--m-text-secondary);
}
.map-community-note strong { color: var(--m-cyan); font-weight: 600; }