/* ─────────────────────────────────────────
   SHARED VARIABLES & RESET
───────────────────────────────────────── */

:root {
    --accent-color: #fb9a99;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'IBM Plex Mono', monospace;
    color: black;
    height: 100vh;
    overflow: hidden;
}

/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */

#container {
    display: flex;
    height: 100vh;
}

#map {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 80%;
}

#sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 20%;
    height: 100vh;
    overflow-y: auto;
    background: white;
    padding: 2em;
    display: flex;
    flex-direction: column;
}

/* ─────────────────────────────────────────
   SIDEBAR HEADER
───────────────────────────────────────── */

#sidebar-header {
    padding: 0 0 20px 0;
    background: transparent;
    color: black;
    top: 0;
    z-index: 1000;
}

.title-box {
    position: relative;
    margin-bottom: 12px;
}

.title-box::before,
.title-box::after {
    content: '';
    position: absolute;
    top: -3px;
    height: 3px;
    width: 40px;
    background: black;
    z-index: 1;
}
.title-box::before { left: 0; }
.title-box::after { right: 0; }

#sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    text-transform: uppercase;
    border: 1px solid black;
    border-bottom: none;
    padding: 8px 12px;
}

.title-box-btm {
    height: 3px;
    display: flex;
    justify-content: space-between;
}

.title-box-btm::before {
    content: '';
    width: 20%;
    background: black;
}

.title-box-btm::after {
    content: '';
    width: 40%;
    background: black;
}

#sidebar-header p {
    font-size: 14px;
    opacity: 0.9;
}

/* ─────────────────────────────────────────
   STATS
───────────────────────────────────────── */

#stats {
    padding: 20px 0;
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 14px;
    margin-bottom: 20px;
}

/* ─────────────────────────────────────────
   DISTRICT FILTER
───────────────────────────────────────── */

#district-filter {
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    font-size: 13px;
}

#district-filter-label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #000;
}

.district-check {
    display: block;
    margin-bottom: 4px;
    cursor: pointer;
}

/* ─────────────────────────────────────────
   SIDEBAR CONTENT & DETAIL ROWS
───────────────────────────────────────── */

#sidebar-content {
    padding: 0;
    flex: 1;
}

.incident-details {
    line-height: 1.6;
}

.incident-details h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: black;
}

.detail-row {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: black;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-value {
    color: black;
    font-size: 15px;
}

.placeholder {
    color: black;
    text-align: center;
    padding: 40px 20px;
    font-style: italic;
}

select, select option {
    font-family: 'IBM Plex Mono', monospace;
}

/* ─────────────────────────────────────────
   ZONING — BBOX TOOLBAR
───────────────────────────────────────── */

#bbox-toolbar {
    margin-top: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bbox-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s, opacity 0.15s;
}

#draw-bbox-btn { background: black; color: #fff; }
#draw-bbox-btn:hover { background: #1a73e8; }
#draw-bbox-btn.active { background: #e8430a; }

#clear-bbox-btn { background: #e8e8e8; color: #333; display: none; }
#clear-bbox-btn:hover { background: #ccc; }

#bbox-hint {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    display: none;
}

/* ─────────────────────────────────────────
   ZONING — BBOX STATS
───────────────────────────────────────── */

#bbox-stats-container {
    margin-top: 20px;
    display: none;
    background: #f5f5f0;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #ddd;
}

#bbox-area-stats {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.7;
}

.bbox-stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.bbox-stat-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.selection-banner {
    background: #1a73e8;
    color: white;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

/* ─────────────────────────────────────────
   MISC SHARED UTILITIES
───────────────────────────────────────── */

.labels {
    font-size: 10px;
    font-family: 'IBM Plex Mono', monospace;
}

.highlight-word {
    color: var(--accent-color);
    font-weight: bold;
}

.chapter {
    margin-bottom: 60vh;
}

/* ─────────────────────────────────────────
   MOBILE
───────────────────────────────────────── */

@media (max-width: 768px) {
    body, html {
        overflow: auto;
    }

    #container {
        flex-direction: column;
        height: auto;
    }

    #map {
        position: relative;
        width: 100%;
        height: 50vh;
        order: 2;
    }

    #sidebar {
        position: relative;
        width: 100%;
        height: auto;
        overflow-y: visible;
        order: 1;
    }
}