/* ─── Reset & Base ─────────────────────────────────────────────────────────── */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #1a1a1a;
}

/* ─── Map ───────────────────────────────────────────────────────────────────── */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* ─── Header ────────────────────────────────────────────────────────────────── */
#header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(20, 20, 20, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

#logo img {
    height: 36px;
    width: auto;
    display: block;
}

#geocoder-container {
    flex: 1;
    max-width: 420px;
}

#submit-update-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

#submit-update-btn:hover {
    border-color: rgba(255,255,255,0.45);
    color: #fff;
}

/* Override Mapbox geocoder styles to fit our dark theme */
#geocoder-container .mapboxgl-ctrl-geocoder {
    width: 100%;
    max-width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow: none;
}

#geocoder-container .mapboxgl-ctrl-geocoder input {
    color: #fff;
    font-size: 14px;
    padding: 8px 36px 8px 40px;
}

#geocoder-container .mapboxgl-ctrl-geocoder input::placeholder {
    color: rgba(255,255,255,0.4);
}

#geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-search {
    fill: rgba(255,255,255,0.4);
    top: 10px;
}

#geocoder-container .mapboxgl-ctrl-geocoder .mapboxgl-ctrl-geocoder--icon-close {
    fill: rgba(255,255,255,0.4);
}

#geocoder-container .suggestions {
    background: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
}

#geocoder-container .suggestions li a {
    color: #ddd;
}

#geocoder-container .suggestions .active a,
#geocoder-container .suggestions li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* ─── Filter bar ─────────────────────────────────────────────────────────────── */
#filters {
    position: absolute;
    top: 57px;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(20, 20, 20, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    overflow-x: auto;
    scrollbar-width: none;
}

#filters::-webkit-scrollbar {
    display: none;
}

.filter-label {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    margin-right: 2px;
}

.filter-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
}

/* Default active state (holes buttons) */
.filter-btn.active {
    background: rgba(136, 176, 75, 0.15);
    border-color: #88b04b;
    color: #b8d96e;
}

/* Per-type active colors — use #filters prefix to boost specificity */
#filters .filter-btn.active[data-type="Public"] {
    background: rgba(136, 176, 75, 0.25);
    border-color: #88b04b;
    color: #b5e05a;
}

#filters .filter-btn.active[data-type="Municipal"] {
    background: rgba(50, 149, 98, 0.3);
    border-color: #2ecc71;
    color: #2ecc71;
}

#filters .filter-btn.active[data-type="Semi Private"] {
    background: rgba(180, 182, 168, 0.15);
    border-color: #b4b6a8;
    color: #d0d2c2;
}

#filters .filter-btn.active[data-type="Driving Range"] {
    background: rgba(220, 223, 100, 0.2);
    border-color: #dcdf64;
    color: #dcdf64;
}

/* Show All button */
#show-all-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

#show-all-btn:hover {
    border-color: rgba(255,255,255,0.6);
    color: #fff;
}

#hide-all-btn {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: transparent;
    color: rgba(255,255,255,0.35);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

#hide-all-btn:hover {
    border-color: rgba(255,100,100,0.5);
    color: rgba(255,120,120,0.8);
}

.filter-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,0.12);
    margin: 0 4px;
    flex-shrink: 0;
}

#locate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

#locate-btn:hover {
    border-color: rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.8);
}

/* ─── Course Detail Panel ────────────────────────────────────────────────────── */
#course-panel {
    position: absolute;
    bottom: 32px;
    left: 16px;
    z-index: 10;
    width: 300px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#course-panel.hidden {
    display: none;
}

#panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

#panel-close:hover {
    color: #fff;
}

.type-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
}

#panel-range-badge  { margin-left: 6px; }

.type-public        { background: rgba(136,176,75,0.2);  color: #b8d96e; }
.type-municipal     { background: rgba(50,149,98,0.2);   color: #5bd4a0; }
.type-semi-private  { background: rgba(158,160,146,0.2); color: #c8cab8; }
.type-driving-range { background: rgba(224,227,135,0.2); color: #e8eb88; }

#panel-name {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.3;
    color: #fff;
}

#panel-meta {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 10px;
}

#panel-address {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 6px;
    line-height: 1.4;
}

#panel-phone a {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    margin-bottom: 14px;
    display: block;
}

#panel-phone a:hover {
    color: #fff;
}

#panel-booking {
    display: block;
    margin-top: 14px;
    padding: 10px 16px;
    background: #88b04b;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.15s;
}

#panel-booking:hover {
    background: #9dc756;
}

#panel-booking.hidden {
    display: none;
}

#panel-report {
    display: block;
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.15s;
}

#panel-report:hover {
    color: rgba(255,255,255,0.6);
}

/* ─── Mapbox overrides ───────────────────────────────────────────────────────── */
.mapboxgl-ctrl-bottom-right {
    bottom: 32px;
}
