body {
    font-family: 'Inter', sans-serif
}

.loader {
    border: 4px solid rgb(255 255 255 / .3);
    border-top-color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite
}

.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease
}

@keyframes spin {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1rem
}

.image-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1)
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1)
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.autocomplete-container {
    position: absolute;
    width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    margin-top: .5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / .1);
    z-index: 50;
    max-height: 300px;
    overflow-y: auto
}

.dark .autocomplete-container {
    background: #1f2937;
    border-color: #374151
}

.autocomplete-item {
    padding: .75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s
}

.autocomplete-item:hover {
    background-color: #f3f4f6
}

.dark .autocomplete-item:hover {
    background-color: #374151
}

.settings-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    border-top-left-radius: 2rem;
    border-bottom-left-radius: 2rem;
    box-shadow: -5px 0 25px rgb(0 0 0 / .1);
    transition: right 0.3s ease-in-out;
    z-index: 1000
}

.dark .settings-sidebar {
    background: #1f2937;
    box-shadow: -5px 0 25px rgb(0 0 0 / .3)
}

.settings-sidebar.open {
    right: 0
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / .5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    z-index: 999
}

.settings-overlay.open {
    opacity: 1;
    visibility: visible
}

@media (max-width:640px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr))
    }

    .plugin-container {
        display: none
    }

    .search-results-container {
        width: 100% !important
    }

    .settings-sidebar {
        width: 100%;
        right: -100%
    }
}