:root {
    --sidebar-width: 380px;
    --background-color: #f8f9fa;
    --panel-background: #ffffff;
    --text-color: #212529;
    --shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background-color);
    overflow-x: hidden;
}

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


#sidebar {
    position: fixed; 
    top: 0;
    right: 0;
    height: 100%;
    width: var(--sidebar-width);
    background: var(--panel-background);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
}

#sidebar.visible {
    transform: translateX(0);
}

#close-sidebar-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

#close-sidebar-btn:hover {
    color: var(--text-color);
}

#close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 300;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

#close-modal-btn:hover {
    color: var(--text-color);
}

#sidebar-content {
    overflow-y: auto; 
    height: 100%;
}

.card-container {
    display: flex;
    flex-direction: row; 
    align-items: flex-start;
    gap: 16px; 
    padding: 20px;
}

.card-image-wrapper {
    width: 120px; 
    flex-shrink: 0; 
}

.card-image {
    width: 100%;
    display: block;
    border-radius: 8px; 
    cursor: pointer;
}

.card-text-wrapper {
    flex-grow: 1; 
}

.card-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px; 
}

.card-body p {
    margin: 0 0 16px 0;
    font-size: 15px;
    color: #555;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    background-color: #e9ecef;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag:hover {
    background-color: #dee2e6;
}


@media (min-width: 500px) {
    #sidebar-content {
        overflow-y: hidden; 
    }

    .card-container {
        flex-direction: column;
        gap: 0;
        padding: 0;
        height: 100%;
        display: flex; 
    }

    .card-image-wrapper {
        width: auto; 
        padding: 25px 25px 25px 25px; 
    }

    .card-image {
        height: 400px; 
        object-fit: cover; 
        border-radius: var(--border-radius); 
    }
    
    .card-text-wrapper {
        padding: 25px;
        padding-top: 0px;
        overflow-y: auto; 
    }

    .card-header h2 {
        font-size: 26px;
    }
    .card-body p {
        font-size: 16px;
    }
    .tag {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    #sidebar {
        width: 100%;
        height: auto;
        max-height: 60vh; 
        top: auto;
        bottom: 0;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.1);
    }

    #sidebar.visible {
        transform: translateY(0);
    }
}


#about-modal-overlay {
    position: fixed;
    top: 0;
    left: 1;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

#about-modal {
    background: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 70vw;
    position: relative;
    transform: scale(1);
    transition: transform 0.3s ease;
}

#about-modal .links a {
    display: inline-block;
    margin-top: 20px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 500;
    padding: 8px 12px;
    border: 1px solid #6c757d;
    border-radius: 8px;
    transition: all 0.2s;
}

#about-modal .links a:hover {
    background-color: #6c757d;
    color: white;
}

#about-modal-overlay.hidden #about-modal {
    transform: scale(0.9);
}

#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

#lightbox-image {
    display: block;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
}


.hidden {
    opacity: 0;
    pointer-events: none;
}

.measure-helper {
    visibility: hidden !important;
    transition: none !important;
}

.maplibregl-ctrl-group button {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
}

.maplibregl-ctrl-group button b {
    font-size: 2em; 
    line-height: 1;
}

.maplibregl-ctrl-group button svg {
    width: 1.5rem; 
    height: 1.5rem;
}