.legiit-search-border {
    position: relative;
    border-radius: 0.375rem;
    border: 1.5px solid #c4b5fd;
    background-color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.dark .legiit-search-border:not(.is-searching) {
    border-color: #4b5563;
    background-color: transparent;
    box-shadow: none;
}

.legiit-search-border:focus-within:not(.is-searching) {
    border-color: #9333ea;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.14);
}

.dark .legiit-search-border:focus-within:not(.is-searching) {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.legiit-search-border.is-searching {
    border: 1.5px solid transparent;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(90deg, #9333ea, #ec4899, #c084fc, #a855f7, #9333ea) border-box;
    background-size: 300% 100%;
    animation: legiit-search-border-flow 2s linear infinite;
    box-shadow:
        0 0 0 1px rgba(147, 51, 234, 0.15),
        0 0 12px rgba(147, 51, 234, 0.12),
        0 0 20px rgba(236, 72, 153, 0.08);
}

.dark .legiit-search-border.is-searching {
    background:
        linear-gradient(#374151, #374151) padding-box,
        linear-gradient(90deg, #9333ea, #ec4899, #c084fc, #a855f7, #9333ea) border-box;
    background-size: 300% 100%;
}

@keyframes legiit-search-border-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.legiit-search-input {
    border: none !important;
    box-shadow: none !important;
    border-radius: calc(0.375rem - 1.5px);
}

.legiit-search-input:focus {
    outline: none !important;
    --tw-ring-shadow: none;
}

.legiit-search-loader {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.legiit-search-border.is-searching .legiit-search-loader {
    opacity: 1;
    transform: scale(1);
}

.legiit-search-spinner {
    display: block;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 2px solid rgba(147, 51, 234, 0.18);
    border-top-color: #9333ea;
    border-right-color: #ec4899;
    animation: legiit-search-spin 0.7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

@keyframes legiit-search-spin {
    to { transform: rotate(360deg); }
}
