/* Mengatur agar peta memenuhi seluruh layar */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}
#map {
    width: 100%;
    height: 100%;
}
.popup-title {
    color: white;
    font-weight: 600;
    margin-bottom: 4px;
}
.other-sources {
    display: inline-block;
    margin:0;
    padding: 2px 4px;
    background-color: maroon !important;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}
.leaflet-popup-content {
    width: min(660px, calc(100vw - 64px)) !important;
    max-height: 75vh;
    overflow-y: auto;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 10px !important;
}
.leaflet-popup-content-wrapper {
    background-color: black !important;
    padding: 0 !important;
}
.cctv-popup {
    color: #f5f5f5;
    overflow-wrap: anywhere;
}
.cctv-popup video,
.cctv-popup iframe,
.cctv-popup img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5;
    object-fit: contain;
    border: 0;
    margin-top: 8px;
}
.cctv-metadata {
    margin: 8px 0;
    font-size: 12px;
    line-height: 1.5;
}
.cctv-metadata p {
    margin: 3px 0;
}
.cctv-status {
    display: inline-block;
    margin: 0 4px 4px 0;
    padding: 2px 7px;
    border-radius: 4px;
    font-weight: bold;
}
.cctv-status--unknown {
    background: #374151;
    color: #f3f4f6;
}
.cctv-status--working {
    background: #14532d;
    color: #dcfce7;
}
.cctv-status--error {
    background: #7f1d1d;
    color: #fee2e2;
}
.cctv-status--stale {
    background: #713f12;
    color: #fef3c7;
}
.cctv-error-note {
    color: #fecaca;
}
.layer-selector {
    position: absolute;
    left: 16px;
    bottom: 64px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    font-size: 15px;
    max-width: calc(100vw - 64px);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}
.live-layer-info {
    max-width: 240px;
    margin: 4px 0 10px 20px;
    font-size: 12px;
}
.live-layer-info button {
    min-height: 30px;
    cursor: pointer;
}
.live-layer-info button:disabled {
    cursor: wait;
}
.live-layer-info a {
    margin-left: 6px;
}
#jogja-live-status {
    margin: 4px 0;
    color: #444;
    overflow-wrap: anywhere;
}
.status-filter {
    border-top: 1px solid #ddd;
    padding-top: 8px;
    margin-top: 8px;
}
.status-filter label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}
.status-filter select {
    width: 100%;
    min-height: 32px;
}
#data-freshness-note {
    max-width: 240px;
    font-size: 12px;
    color: #555;
    margin: 6px 0 0;
}
.data-load-errors {
    max-width: 240px;
    color: #991b1b;
    font-size: 12px;
    padding-left: 16px;
    overflow-wrap: anywhere;
}
.total-locations {
    position: absolute;
    left: 16px;
    bottom: 16px;
    background: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1000;
    font-weight: 600;
    font-size: 16px;
}
.selector-icon {
    width: 12px; 
    height: 16px; 
    vertical-align: middle;
}