@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --bochum-blue: #0f2864;
    --primary-color: #0ab4ff;
    --accent-color: #ffcc01;
    --accent-orange: #f49100;
    --danger: #e61937;

    /* Dark Theme (Default) */
    --bg-dark: #121212;
    --surface-dark: #1e1e1e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(35, 35, 35, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);

    --radius-lg: 1rem;
    --radius-md: 0.5rem;
    --radius-sm: 0.25rem;
}

body.light-theme {
    --bg-dark: #f8fafc;
    --surface-dark: #ffffff;
    --text-primary: #0f2864;
    --text-secondary: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(15, 40, 100, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    height: 64px;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo span:first-child {
    color: var(--text-primary);
}

.logo span:last-child {
    color: var(--primary-color);
}

main {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--surface-dark);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.panel h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

#map {
    flex: 1;
    border-radius: var(--radius-md);
    min-height: 400px;
    z-index: 10;
}

.stats-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.chart-wrapper {
    flex: 1;
    min-height: 300px;
    position: relative;
}

.controls {
    margin-top: auto;
    background: var(--glass-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

input[type="range"] {
    width: 100%;
    accent-color: var(--primary-color);
}

#theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#theme-toggle:hover {
    background-color: var(--glass-border);
}

footer {
    padding: 16px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Leaflet Overrides */
.leaflet-container {
    background: #2b2b2b !important;
}

.light-theme .leaflet-container {
    background: #f1f5f9 !important;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
    background: var(--surface-dark) !important;
    color: var(--text-primary) !important;
}