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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #1a1a2e;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

#map {
    width: 100%;
    height: 100%;
    background: #1a1a2e;
}

/* Dark theme for Leaflet controls */
.leaflet-control-zoom a {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #0f3460 !important;
}

.leaflet-control-zoom a:hover {
    background-color: #0f3460 !important;
}

.leaflet-control-layers {
    background-color: #16213e !important;
    color: #e0e0e0 !important;
    border-color: #0f3460 !important;
}

.leaflet-control-layers-separator {
    border-top-color: #0f3460 !important;
}

.leaflet-control-layers label {
    color: #e0e0e0 !important;
}

/* Status bar */
#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(22, 33, 62, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    font-size: 12px;
    color: #a0a0b0;
    z-index: 1000;
    border-top: 1px solid #0f3460;
}

#status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-connected {
    background: #4ade80;
    box-shadow: 0 0 4px #4ade80;
}

.status-disconnected {
    background: #ef4444;
    box-shadow: 0 0 4px #ef4444;
}

.status-stale {
    background: #f59e0b;
    box-shadow: 0 0 4px #f59e0b;
}

#entity-counts {
    margin-left: auto;
    display: flex;
    gap: 12px;
}

.count-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.count-icon {
    width: 12px;
    height: 12px;
}

/* Marker popups */
.leaflet-popup-content-wrapper {
    background: #16213e !important;
    color: #e0e0e0 !important;
    border: 1px solid #0f3460 !important;
    border-radius: 4px !important;
}

.leaflet-popup-tip {
    background: #16213e !important;
    border: 1px solid #0f3460 !important;
}

.leaflet-popup-close-button {
    color: #a0a0b0 !important;
}

/* Marker cluster overrides */
.marker-cluster-small {
    background-color: rgba(110, 204, 57, 0.4) !important;
}
.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6) !important;
    color: #fff !important;
}
.marker-cluster-medium {
    background-color: rgba(241, 211, 87, 0.4) !important;
}
.marker-cluster-medium div {
    background-color: rgba(241, 211, 87, 0.6) !important;
    color: #fff !important;
}
.marker-cluster-large {
    background-color: rgba(253, 156, 115, 0.4) !important;
}
.marker-cluster-large div {
    background-color: rgba(253, 156, 115, 0.6) !important;
    color: #fff !important;
}

/* Safe area insets for iOS */
@supports (padding: env(safe-area-inset-bottom)) {
    #status-bar {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(32px + env(safe-area-inset-bottom));
    }
}
