:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-tertiary: #1a2035;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #3b82f6;
    --accent-dim: #1e3a5f;
    --border: #1f2937;
    --risk-low: #10b981;
    --risk-medium: #f59e0b;
    --risk-high: #f97316;
    --risk-critical: #ef4444;
    --risk-low-bg: rgba(16, 185, 129, 0.15);
    --risk-critical-bg: rgba(239, 68, 68, 0.15);
}

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

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

#app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    height: 60px;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

#app-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#status-bar {
    display: flex;
    gap: 24px;
    align-items: center;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.status-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.hotspot-badge {
    color: var(--risk-critical);
}

#app-main {
    display: flex;
    height: calc(100vh - 60px);
}

#map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--bg-primary);
}

#map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

#map-loading p {
    margin-top: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Header breadcrumb home link */
.header-home-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    transition: color 0.15s;
}
.header-home-link:hover {
    color: #60a5fa;
}

.header-sep {
    color: var(--text-muted);
    margin: 0 8px;
    font-weight: 300;
}

/* Export button */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 5px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
    cursor: pointer;
}
.export-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.hidden {
    display: none !important;
}


/* ===== Responsive: GeoRisk page ===== */

@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }

    #app-header {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
        align-items: flex-start;
    }

    .header-left {
        flex-direction: column;
        gap: 2px;
    }

    #app-header h1 {
        font-size: 16px;
    }

    .header-subtitle {
        font-size: 10px;
    }

    #status-bar {
        width: 100%;
        gap: 12px;
        flex-wrap: wrap;
    }

    .export-btn {
        margin-left: auto;
    }

    #app-main {
        flex-direction: column;
        height: auto;
    }

    #map-container {
        width: 100%;
        height: 50vh;
        min-height: 280px;
    }

    #news-sidebar {
        width: 100%;
        max-height: 50vh;
        border-left: none;
        border-top: 1px solid var(--border);
    }
}

@media (max-width: 480px) {
    #app-header {
        padding: 8px 12px;
    }

    #app-header h1 {
        font-size: 14px;
    }

    .header-sep {
        margin: 0 4px;
    }

    #status-bar {
        gap: 8px;
    }

    .status-label {
        font-size: 9px;
    }

    .status-value {
        font-size: 11px;
    }

    #map-container {
        height: 45vh;
        min-height: 240px;
    }
}
