body {
    margin: 0;
    min-height: 200vh;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/static/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.4;
    z-index: -1;
}

#search-card {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 600px;
    z-index: 1000;
}

#search-card.in-flow {
    position: sticky;
    top: 0;
    left: auto;
    transform: none;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
}

.card-panel {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    position: relative;
}

#search {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#clear-search {
    font-size: 16px;
    padding: 5px 10px;
    line-height: 1;
}

#main-content {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
}

#results {
    width: 100%;
    margin-top: 20px;
}

#autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    width: calc(100% - 70px);
}

#autocomplete li {
    padding: 10px;
    cursor: pointer;
}

#autocomplete li:hover {
    background: #f0f0f0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.tag-cloud .chip {
    background-color: #e0e0e0;
    color: #424242;
    font-size: 14px;
    padding: 0 12px;
    height: 28px;
    line-height: 28px;
}

.tag-cloud .chip:hover {
    background-color: #bdbdbd;
}

.modal {
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1002;
}

.modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img {
    user-select: none;
}

#pinModal {
    max-width: 400px;
}

#pinModal .modal-content {
    padding: 20px;
    text-align: center;
}

#pinModal h3 {
    margin-top: 0;
}

#pinInput {
    border: 1px solid #ccc;
    border-radius: 4px;
}

#main-content, #search-card {
    display: block !important;
    flex: none !important;
}

@media (max-width: 600px) {
    #search-card {
        max-width: 90%;
    }
    #search-card.in-flow {
        margin: 0 auto;
    }
    #main-content {
        max-width: 90%;
    }
    .card-panel {
        padding: 15px;
    }
    .search-container {
        flex-direction: column;
        gap: 5px;
    }
    #search, #clear-search {
        width: 100%;
    }
    #autocomplete {
        width: 100%;
    }
    #pinModal {
        max-width: 90%;
    }
}

.modal-image {
    transition: opacity 0.3s ease;
}

/* Language button */
.language-button {
    position: fixed;
    top: 10px;
    right: 10px;
    font-size: 14px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 1001;
    border: none;
    text-align: center;
    min-width: 80px; /* Ensure text fits */
}

.language-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Language dropdown */
.language-dropdown {
    display: none;
    position: fixed;
    top: 50px;
    right: 10px;
    min-width: 150px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    z-index: 1001;
    list-style: none;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.language-dropdown li a {
    display: block;
    padding: 10px;
    color: #424242;
    text-decoration: none;
    font-size: 14px;
}

.language-dropdown li a:hover {
    background: #f0f0f0;
}
