body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    background-color: var(--container-background-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-bar,
.dropdown {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-bar input,
.dropdown select,
button {
    padding: 15px 20px;
    border-radius: 30px;
    border: none;
    flex: 1;
    margin-right: 20px;
    background-color: var(--input-background-color);
    color: var(--input-text-color);
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-bar input:focus,
.dropdown select:focus,
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

button {
    flex: 0 1 auto;
    background-color: #007bff;
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

button:hover {
    background-color: #0056b3;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.results {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

.results img {
    width: calc(25% - 30px);
    height: auto;
    max-width: 100%;
    object-fit: cover;
    cursor: pointer;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.results img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    display: none;
    margin: auto;
}

.modern-select {
    font-size: 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 250px;
    padding: 15px 20px;
    border-radius: 30px;
    border: none;
    color: var(--input-text-color);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: var(--select-background-color) url('https://cdn4.iconfinder.com/data/icons/ionicons/512/icon-arrow-down-b-128.png') no-repeat right 20px center;
    background-size: 20px;
    transition: all 0.3s ease;
}

.modern-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3);
}

.enlarged-img {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.enlarged-img img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.enlarged-img img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.selected-img {
    border: 3px solid #007bff !important;
}

/* New styles for search options */
.search-options {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    background-color: var(--input-background-color);
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-option {
    display: flex;
    align-items: center;
    background-color: var(--container-background-color);
    padding: 15px;
    margin: 0 25px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-option label {
    margin-right: 15px;
    font-weight: bold;
    color: var(--text-color);
}

.search-option {
    display: flex;
    align-items: center;
    background-color: var(--container-background-color);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-option label {
    margin-right: 15px;
    font-weight: bold;
    color: var(--text-color);
    white-space: nowrap;
}

.threshold-container {
    display: flex;
    align-items: center;
    width: 280px; /* Fixed width for the container */
}

#threshold {
    width: 200px;
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: var(--input-background-color);
    outline: none;
    border-radius: 4px;
    margin-right: 10px;
}

#threshold::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

#threshold::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

#threshold-value {
    font-weight: bold;
    color: #007bff;
    width: 40px; /* Fixed width for the value display */
    text-align: right;
}

#top-k {
    width: 60px;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
    background-color: var(--input-background-color);
    color: var(--input-text-color);
}

#top-k:focus {
    border-color: #007bff;
    outline: none;
}

#threshold-value {
    margin-left: 10px;
    font-weight: bold;
    color: #007bff;
}

:root {
    --background-color: #f7f7f7;
    --text-color: #333;
    --container-background-color: #fff;
    --border-color: #ccc;
    --input-background-color: #f2f2f2;
    --input-text-color: #333;
    --select-background-color: #fff;
    --footer-background-color: #f2f2f2;
    --footer-text-color: #333;
    --footer-link-color: #007bff;
    --footer-link-hover-color: #0056b3;
}

@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #181818;
        --text-color: #e0e0e0;
        --container-background-color: #242424;
        --border-color: #555;
        --input-background-color: #333;
        --input-text-color: #e0e0e0;
        --select-background-color: #333;
        --footer-background-color: #242424;
        --footer-text-color: #e0e0e0;
        --footer-link-color: #4da3ff;
        --footer-link-hover-color: #75b7ff;
    }
}

@media (max-width: 900px) {
    .results img {
        width: calc(33.33% - 30px);
    }
}

@media (max-width: 600px) {
    .results img {
        width: calc(50% - 30px);
    }

    .search-bar,
    .dropdown,
    .search-options {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-bar input,
    .dropdown select,
    button,
    .search-option {
        margin: 10px;
        flex: 0 1 calc(50% - 20px);
    }
}

@media (max-width: 400px) {
    .results img {
        width: calc(100% - 30px);
    }

    .search-bar input,
    .dropdown select,
    button,
    .search-option {
        flex: 0 1 100%;
    }
}

footer {
    background-color: var(--footer-background-color);
    color: var(--footer-text-color);
    padding: 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

footer a {
    color: var(--footer-link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: var(--footer-link-hover-color);
}