/* General Layout */

header {
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c3e50;
}

    header h1 {
        font-weight: 700;
        font-size: 2.5rem;
        margin: 0;
    }


body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f9f9f9;
}

/* Controls Container */
#controls {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

    #controls label {
        font-weight: bold;
        margin-bottom: 5px;
        display: block;
    }

/* Filter Button Groups */
.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

/* Toggle Button Style */
.toggle-button {
    padding: 8px 12px;
    border: 1px solid #ccc;
    background-color: #eee;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

    .toggle-button.active,
    button.active {
        background-color: #4CAF50;
        color: white;
        border-color: #4CAF50;
    }

/* Select All Buttons */
#selectAllInstruments,
#selectAllPollen {
    padding: 10px 16px;
    font-weight: bold;
    cursor: pointer;
    background-color: #dff0d8;
    border: 1px solid #b2d8b2;
    border-radius: 4px;
    transition: background-color 0.2s;
}

    #selectAllInstruments:hover,
    #selectAllPollen:hover {
        background-color: #c1eac5;
    }

/* Map and Loading Overlay */
#map {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Loading Overlay */
#loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* Dim effect */
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

/* Spinner Styles */
.spinner {
    width: 64px;
    height: 64px;
    border: 8px solid rgba(0, 0, 0, 0.1);
    border-left-color: #09f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
}

.spinner-text {
    font-size: 16px;
    font-weight: bold;
    color: #09f;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.7);
}

/* Spinner Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Layout */
@media (max-width: 768px) {
    body {
        padding: 5px;
    }

    #controls {
        gap: 12px;
    }

    .filter-group {
        flex-direction: column;
        gap: 6px;
    }

    .toggle-button,
    #selectAllInstruments,
    #selectAllPollen {
        width: 100%;
        font-size: 1rem;
    }

    #map {
        height: 400px;
    }

    .spinner {
        width: 48px;
        height: 48px;
        border-width: 6px;
    }

    .spinner-text {
        font-size: 14px;
    }
}
#partners {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

    #partners img {
        max-height: 50px;
        height: auto;
        width: auto;
        display: block;
        object-fit: contain;
    }

.link-button {
    font-weight: bold;
    padding: 10px 15px;
    background-color: #09f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

    .link-button:hover {
        background-color: #007acc;
    }

/* Mobile responsiveness */
@media (max-width: 600px) {
    #partners {
        flex-direction: column;
        gap: 12px;
    }

        #partners img {
            max-height: 40px;
        }
}
#copyright {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

#description {
    max-width: 700px;
    margin: 0 auto 20px;
    font-size: 1rem;
    color: #333;
    line-height: 1.5;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Container for Date Range block */
.control-block {
    margin-bottom: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

    /* Styling the label */
    .control-block > label {
        font-weight: bold;
        display: block;
        margin-bottom: 10px;
        font-size: 1.1rem;
        color: #2c3e50;
    }

/* Styling the date label output */
#dateLabels {
    margin-top: 12px;
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: #444;
    text-align: center;
}

/* Slider customization (optional) */
#dateSlider {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Responsive adjustment */
@media (max-width: 600px) {
    #dateLabels {
        font-size: 0.95rem;
    }

    .control-block > label {
        font-size: 1rem;
    }
}

.primary-btn {
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .primary-btn {
        margin-right: 0;
        margin-bottom: 10px;
    }
}
#map-and-chart {
    display: flex;
    gap: 1em;
    align-items: flex-start;
    flex-wrap: wrap; /* allows wrapping */
}

/* Both map and chart take equal width when side by side */
#map-container, #chart-container {
    flex: 1 1 45%; /* grow/shrink, base width 45% */
    min-width: 300px; /* don’t shrink too small */
    height: 600px;
}

/* Make sure map and canvas fill their containers */
#map {
    height: 100%;
    width: 100%;
}

#pollenChart {
    height: 100% !important;
    width: 100% !important;
}

/* On smaller screens, stack vertically */
@media (max-width: 768px) {
    #map-container, #chart-container {
        flex: 1 1 100%;
        height: 400px; /* reduce height on smaller screens */
    }
}
