body {
    margin: 0;
    padding: 0;
}

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

#filter-container {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

#filters {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

#customFilters {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.selectFilter {
    margin: auto;
    width: 300px;
    min-width: 200px;
    height: 50px;
    font-size: 0.9em;
    padding: 0 15px;
}

#clearFilter {
    height: 50px;
    display: none;
    cursor: pointer;
    justify-content: center;
    align-items: center;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

#sidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: 400px;
    background-color: rgba(255, 255, 255, 0.95);
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
    border-radius: 5px;
    display: none;
}

#closeSidebar {
    cursor: pointer;
    border: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 3rem;
    width: 3rem;
}

#showSidebar {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    cursor: pointer;
    border: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 3rem;
    width: 3rem;
    border-radius: 5px;
}

#top-right-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

#loginButton {
    height: 50px;
    padding: 0 20px;
    background-color: var(--pico-primary-background);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#loginButton:hover {
    opacity: 0.9;
    text-decoration: none;
}

#language-switch {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.language-toggle-btn {
    width: 50px;
    height: 50px;
    padding: 10px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.language-toggle-btn svg {
    width: 24px;
    height: 24px;
    color: var(--pico-primary-background, #000);
}

.language-toggle-btn:hover {
    background-color: #f0f0f0;
}

.language-dropdown {
    margin-top: 5px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.language-option {
    display: block;
    width: 100%;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: white;
    color: var(--pico-primary-background);
    text-align: left;
    font-weight: bold;
    transition: background-color 0.2s;
}

.language-option:hover {
    background-color: #f0f0f0;
}

.language-option.active {
    background-color: var(--pico-primary-background);
    color: white;
}

.maptiler-popup-content {
    padding: 10px;
}

.card {
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

#searchInput {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    margin: auto;
}

.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 1rem;
}

.card .img-container {
    width: 100%;
    height: 150px; /* Or any other fixed height */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: 5px;
}

.card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card .entry-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.card .creator {
    color: #777;
}

.card .organization {
    color: #555;
    margin-bottom: 5px;
}

.card .description {
    font-size: 0.9em;
    color: #666;
}

.address-chip {
    background-color: #e0e0e0;
    border-radius: 16px;
    padding: 5px 10px;
    font-size: 0.8em;
    color: #333;
    display: inline-block;
    margin-top: 10px;
}

.error-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 10;
    text-align: center;
}

/* Branding container (logo and imprint) */
#branding-container {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1;
    display: none;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.branding-logo-link {
    display: flex;
    align-items: center;
}

.branding-logo {
    max-height: 32px;
    max-width: 120px;
    object-fit: contain;
}

.branding-imprint-link {
    color: #333;
    text-decoration: none;
    font-size: 0.85em;
    white-space: nowrap;
}

.branding-imprint-link:hover {
    text-decoration: underline;
}

/* Separator between logo and imprint when both are present */
#branding-container .branding-logo-link + .branding-imprint-link::before {
    content: "|";
    margin-right: 12px;
    color: #ccc;
}

/* Tree Filter Styles */
.tree-filter-wrapper {
    position: relative;
    display: inline-block;
}

.tree-filter-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: left;
    font-size: 0.9em;
    color: #333;
}

.tree-filter-button:hover {
    background-color: #f5f5f5;
}

.tree-filter-button svg {
    color: #666;
    flex-shrink: 0;
}

.tree-filter-button-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 300px;
    max-width: 400px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.tree-filter-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.tree-filter-back-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

.tree-filter-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    color: #333;
    transition: all 0.2s;
}

.tree-filter-back-btn:hover {
    background-color: #eee;
}

.tree-filter-level-title {
    font-weight: 600;
    font-size: 0.9em;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-filter-node-list {
    padding: 8px 0;
    background-color: white;
}

.tree-filter-node-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    transition: background-color 0.15s;
    background-color: white;
}

.tree-filter-node-item:hover {
    background-color: #f5f5f5;
}

.tree-filter-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--pico-primary-background, #007bff);
}

.tree-filter-node-label {
    flex: 1;
    cursor: pointer;
    font-size: 0.9em;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
}

.tree-filter-expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    color: #666;
    flex-shrink: 0;
    transition: all 0.2s;
}

.tree-filter-expand-btn:hover {
    background-color: #eee;
    color: #333;
}


/* responsive adjustments */
@media (max-width: 768px) {
    #sidebar {
        width: 90%;
        left: 5%;
        top: 10px;
        bottom: 10px;
    }

    #showSidebar {
        left: 5%;
    }

    #closeSidebar {
        left: calc(100% - 50px);
    }

    #filter-container {
        display: none;
    }

    #searchInput {
        width: 100%;
    }

    /* hide map controls of maptiler */
    .maplibregl-ctrl-top-right {
        display: none;
    }

    #language-switch {
        display: none !important;
    }

    #top-right-controls {
        top: 10px;
        right: 10px;
    }

    #loginButton {
        font-size: 0.9em;
        padding: 0 16px;
        height: 44px;
    }
    
    /* Tree filter responsive styles */
    .tree-filter-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
        max-width: none;
        max-height: none;
        border-radius: 0;
        z-index: 1000;
    }
    
    .tree-filter-nav {
        flex: 1;
    }
    
    .tree-filter-back-header {
        padding: 15px;
    }
    
    .tree-filter-node-item {
        padding: 12px 15px;
    }
}
