/* ── Reset ─────────────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; }
body {
    background-color: #f5f1eb;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Map ───────────────────────────────────────────────────────────── */
#map {
    height: 100%;
    width: 100%;
    background-color: #f5f1eb;
}

/* ── Brand panel — bottom-left ─────────────────────────────────────── */
.brand-panel {
    position: absolute;
    bottom: 28px;
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(35, 45, 52, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 10px 16px 10px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.brand-seal {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.brand-title {
    color: #f0ebe3;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.brand-subtitle {
    color: rgba(240, 235, 227, 0.5);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.brand-links {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-links a {
    color: rgba(180, 200, 215, 0.85);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: color 0.15s;
}

.brand-links a:hover {
    color: #fff;
}

.brand-divider {
    color: rgba(255, 255, 255, 0.15);
    font-size: 10px;
}

/* ── Custom layer panel — top-right ────────────────────────────────── */
.layer-panel {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1000;
    background: rgba(35, 45, 52, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 10px 14px;
    min-width: 160px;
    display: none;  /* hidden until layers load */
}

.layer-panel.active {
    display: block;
}

.layer-panel-title {
    color: rgba(240, 235, 227, 0.5);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    transition: opacity 0.15s;
}

.layer-item:hover {
    opacity: 0.8;
}

.layer-toggle {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s, background-color 0.15s;
}

.layer-toggle.on {
    border-color: transparent;
}

.layer-toggle.on::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.layer-label {
    color: #f0ebe3;
    font-size: 12px;
    font-weight: 500;
    user-select: none;
}

.layer-count {
    color: rgba(240, 235, 227, 0.35);
    font-size: 10px;
    margin-left: auto;
}

/* ── Leaflet overrides ─────────────────────────────────────────────── */

/* Move zoom controls to top-left (default) — no conflict now */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    border-radius: 6px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: rgba(35, 45, 52, 0.92) !important;
    color: #f0ebe3 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    width: 34px !important;
    height: 34px !important;
    line-height: 34px !important;
    font-size: 16px !important;
}

.leaflet-control-zoom a:hover {
    background: rgba(55, 65, 72, 0.95) !important;
}

/* Hide default layer control — we built our own */
.leaflet-control-layers {
    display: none !important;
}

/* Attribution — subtle */
.leaflet-control-attribution {
    background: rgba(35, 45, 52, 0.7) !important;
    color: rgba(240, 235, 227, 0.5) !important;
    font-size: 10px !important;
    border-radius: 4px 0 0 0 !important;
    padding: 2px 8px !important;
}

.leaflet-control-attribution a {
    color: rgba(180, 200, 215, 0.7) !important;
}

/* Popup styling */
.leaflet-popup-content-area {
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.leaflet-popup-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
}

.leaflet-popup-content {
    font-size: 13px;
    line-height: 1.4;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .brand-panel {
        bottom: 8px;
        left: 8px;
        padding: 8px 12px 8px 8px;
        gap: 8px;
    }

    .brand-seal {
        width: 40px;
        height: 40px;
    }

    .brand-title { font-size: 13px; }
    .brand-subtitle { font-size: 8px; }
    .brand-links a { font-size: 10px; }

    .layer-panel {
        top: 8px;
        right: 8px;
        min-width: 140px;
    }

    .leaflet-control-attribution {
        font-size: 8px !important;
    }
}
