:root {
    --bochum-blue-dark: #002855;
    /* Approximate dark blue from Bochum headers */
    --bochum-blue: #004b7c;
    --bochum-accent: #6FACD0;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Global Reset for Box Sizing */
* {
    box-sizing: border-box;
}

/* Header inspired by Baustellen Monitor */
.bochum-header {
    background-color: white;
    color: rgb(15, 40, 100);
    padding: 12px 24px;
    border-bottom: 1px solid rgba(15, 40, 100, 0.1);
    box-shadow: none;
    height: 63px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Match reference layout */
}

.header-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    display: flex;
    /* Ensure inner container flows correctly */
    align-items: center;
}

.logo-area h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    margin: 0;
    font-weight: 700;
    color: rgb(15, 40, 100);
}

.logo-area h1 span {
    color: rgb(10, 180, 255);
    /* Lighter blue for "Monitor" */
}

/* Layout */
/* Layout */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.monitor-container {
    display: flex;
    flex-direction: column;
    /* Remove fixed height to allow scrolling and proper footer placement */
    width: 100%;
    max-width: 1600px;
    /* Increased max-width for wider map */
    margin: 20px auto;
    padding: 0 20px;
    gap: 20px;
    flex: 1;
}

.top-row {
    display: flex;
    flex-direction: row;
    height: 60vh;
    /* Taller Map */
    gap: 20px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .top-row {
        flex-direction: column;
        height: auto;
    }

    .monitor-container {
        height: auto;
    }

    .sidebar {
        width: 100% !important;
        height: 300px;
    }

    .map-card {
        height: 400px !important;
    }
}

.map-wrapper {
    flex: 2;
    /* Wider Map (approx 66%) */
    min-width: 0;
    height: 100%;
}

.sidebar {
    flex: 1;
    /* Narrower List (approx 33%) */
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.control-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}


/* Cards & Panels */
/* Location List */
.location-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    max-height: none;
    /* Let flex handle height */
}

.location-item {
    padding: 4px 8px;
    margin-bottom: 2px;
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    line-height: 1.2;
}

.location-item:hover {
    background-color: rgba(111, 172, 208, 0.1);
    /* Bochum Light Blue tint */
    border-color: var(--bochum-accent);
}

.location-item.active {
    background-color: var(--bochum-blue-dark);
    color: white;
    border-color: var(--bochum-blue-dark);
}

/* Visualization */
.visuals-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.map-card {
    height: 100%;
    /* Fill top-row height */
    position: relative;
    overflow: hidden;
    margin-bottom: 0px;
    border: 1px solid var(--bochum-blue-dark);
    border-radius: var(--border-radius);
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.charts-scroll-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-card-item {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    scroll-margin-top: 20px;
    /* Offset for smooth scroll */
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-header h3 {
    margin: 0;
    color: var(--bochum-blue-dark);
}

.chart-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    min-height: 250px;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--bochum-accent);
    animation: spin 1s ease-in-out infinite;
}

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

/* Footer */
.bochum-footer {
    background-color: #343a40;
    color: #adb5bd;
    padding: 20px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
}

.bochum-footer a {
    color: var(--bochum-accent);
    text-decoration: none;
}


/* Filter Controls */
.filter-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
    align-items: center;
    gap: 10px;
}

.btn-group {
    display: flex;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.filter-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-weight: 500;
}

.filter-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.filter-btn.active {
    background-color: var(--bochum-blue);
    color: white;
}

/* Info Box */
.info-box {
    background-color: #e3f2fd;
    border-left: 4px solid var(--bochum-blue);
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 4px;
    background-image: linear-gradient(to bottom right, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
}

.info-box h3 {
    margin-top: 0;
    color: var(--bochum-blue-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-box h3::before {
    content: 'i';
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    background: var(--bochum-blue);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.info-item h4 {
    margin: 0 0 5px 0;
    color: var(--bochum-blue);
    font-size: 1rem;
}

.info-item p {
    margin: 0;
    font-size: 0.9em;
    color: #495057;
    line-height: 1.5;
}