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

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1f2733;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --border: #30363d;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

header {
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    position: relative;
}

header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent), #bc8cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#status {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

main {
    height: calc(100% - 60px);
    display: grid;
    grid-template-columns: 40% 60%;
}

#map {
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
}

#viewer {
    position: relative;
    height: 100%;
    background: var(--bg-primary);
}

#panorama {
    width: 100%;
    height: 100%;
    display: none;
}

#placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
    padding: 20px;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

#info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(22, 27, 34, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: none;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

#info-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--accent);
}

#info-panel p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Dark Map Tiles via CSS Filter (alternative) */
.leaflet-tile-pane {
    filter: brightness(0.6) invert(1) contrast(3) hue-rotate(200deg) saturate(0.3) brightness(0.7);
}

.leaflet-container {
    background: #1a1a1a;
}

.leaflet-control-attribution {
    background: rgba(13, 17, 23, 0.8) !important;
    color: var(--text-secondary) !important;
    border-radius: 4px;
    padding: 2px 8px !important;
}

.leaflet-control-attribution a {
    color: var(--accent) !important;
}

.leaflet-control-zoom a {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
    background: var(--bg-tertiary) !important;
}

/* Custom Marker */
.custom-marker {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border: 3px solid #fff;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.6);
    transition: all 0.2s;
    cursor: pointer;
}

.custom-marker:hover {
    background: var(--accent-hover);
    transform: rotate(-45deg) scale(1.15);
}

.custom-marker.active {
    background: #ff7b72;
    box-shadow: 0 4px 16px rgba(255, 123, 114, 0.8);
}

/* Popup */
.leaflet-popup-content-wrapper {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.leaflet-popup-tip {
    background: var(--bg-secondary) !important;
}

.leaflet-popup-content {
    margin: 10px 14px !important;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: 40% 60%;
    }
    #map {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
}
