body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #D2D7C7;
    color: #000000;
}

#map {
    position: absolute;
    top: 70px;
    bottom: 0;
    width: 100%;
}

/* Header Styles */
#main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #D2D7C7;
    color: #000000;
    padding: 10px 24px;
    height: 70px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    border-bottom: 2px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.project-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.project-title {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    color: #000000;
    letter-spacing: -0.01em;
}

.header-right {
    display: flex;
    align-items: center;
}

.btn-primary {
    display: inline-block;
    background-color: #B8522E;
    color: #FFFFFF;
    text-decoration: none;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(184, 82, 46, 0.25);
    white-space: nowrap;
}

.btn-primary:hover {
    background-color: #a04322;
    box-shadow: 0 4px 14px rgba(184, 82, 46, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(184, 82, 46, 0.2);
}

/* Style Switcher & Overlays */
.map-overlay {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    position: absolute;
    width: 200px;
    top: 80px;
    left: 10px;
    padding: 10px;
    z-index: 10;
}

#style-switcher {
    background: rgba(210, 215, 199, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #000000;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

#style-switcher label {
    margin-right: 10px;
    cursor: pointer;
}

/* Filter Control */
#filter-control {
    background: rgba(210, 215, 199, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #000000;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: absolute;
    top: 135px;
    left: 10px;
    z-index: 10;
    width: 280px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
}

#filter-control h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 700;
}

#filter-control select {
    background-color: rgba(255, 255, 255, 0.7);
    color: #000000;
    border: 1px solid rgba(0, 0, 0, 0.18);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease;
}

#filter-control select:focus {
    border-color: #B8522E;
}

.filter-option {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 500;
}

/* Legend */
#legend {
    background-color: rgba(210, 215, 199, 0.85) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #000000;
    border-radius: 8px;
    bottom: 30px;
    left: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    width: 130px;
    display: block !important;
}

#legend h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
}

#legend div {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

#legend span {
    border-radius: 50%;
    display: inline-block;
    height: 10px;
    margin-right: 5px;
    width: 10px;
}

/* Popup Styles */
.maplibregl-popup {
    max-width: 300px !important;
}

.maplibregl-popup-content {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.popup-header {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.popup-header h3 {
    margin: 0;
    color: #333;
}

.popup-body {
    font-size: 13px;
    color: #555;
}

.popup-img-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.popup-img-thumb:hover {
    opacity: 0.8;
}

.chart-container {
    margin-top: 10px;
    position: relative;
    height: 150px;
    width: 100%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 80vh;
    object-fit: contain;
}

#caption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    height: 150px;
}

.modal-content,
#caption {
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* EU Logo Overlay */
#eu-logo-overlay {
    position: absolute;
    bottom: 30px;
    right: 10px;
    z-index: 1000;
    background: rgba(210, 215, 199, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

#eu-logo-overlay .eu-logo {
    height: 40px;
    display: block;
    width: auto;
}

@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }

    /* Mobile Header Adjustments */
    #main-header {
        flex-direction: column;
        height: auto;
        padding: 10px 16px;
        gap: 8px;
        align-items: center;
        text-align: center;
    }

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

    .project-logo {
        height: 38px;
    }

    .project-title {
        font-size: 13px;
        line-height: 1.3;
    }

    .btn-primary {
        padding: 8px 16px;
        font-size: 12px;
        width: 100%;
        text-align: center;
    }

    /* Mobile Map & Overlay Offsets */
    #map {
        top: 115px; /* Account for dynamic stacked header height */
    }

    .map-overlay {
        top: 125px;
        width: calc(100% - 32px);
        left: 8px;
        right: 8px;
        box-sizing: border-box;
    }

    #style-switcher {
        width: 100%;
        box-sizing: border-box;
    }

    #filter-control {
        top: 175px;
        width: calc(100% - 32px);
        left: 8px;
        right: 8px;
        box-sizing: border-box;
        max-height: calc(100vh - 240px);
    }

    /* Mobile Legend positioning */
    #legend {
        bottom: 20px;
        left: 8px;
        width: 110px;
        font-size: 10px;
        padding: 8px;
    }

    #legend h4 {
        font-size: 10px;
        margin-bottom: 6px;
    }

    /* Mobile Popup */
    .maplibregl-popup {
        max-width: none !important;
        width: 100% !important;
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        transform: none !important;
        margin: 0 !important;
        border-radius: 10px 10px 0 0;
        z-index: 100;
    }

    .maplibregl-popup-tip {
        display: none;
    }

    /* Mobile EU Logo Adjustments */
    #eu-logo-overlay {
        bottom: 10px;
        right: 10px;
        padding: 4px 8px;
    }

    #eu-logo-overlay .eu-logo {
        height: 30px;
    }
}