/* AI Search Widget Styles */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Widget Wrapper */
.ais-widget-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Search Form */
.ais-search-form {
    width: 100%;
}

/* Search Input Container */
.ais-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #F7FAFC;
    border-radius: 48px;
    padding: 18px 14px;
    margin-bottom: 0;
    border: 4px solid transparent;
    background-clip: padding-box;
    transition: all 0.3s ease;
}

.ais-search-input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 48px;
    padding: 4px;
    background: linear-gradient(90deg, #E4581A, #1D4C79, #4892DA, #E4581A, #1D4C79, #4892DA);
    background-size: 200% 100%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 1;
    animation: ais-border-animation 3s linear infinite;
    pointer-events: none;
}

@keyframes ais-border-animation {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

/* Search Icon */
.ais-search-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
}

/* Search Input */
.ais-search-input {
    flex: 1;
    font-size: 16px;
    border: none !important;
    border-radius: 8px;
    background-color: transparent;
    color: #2D3748 !important;
    outline: none;
    min-height: 56px;
    font-family: inherit;
    padding: 0 !important;
}

/* Override browser autofill background */
.ais-search-input:-webkit-autofill,
.ais-search-input:-webkit-autofill:hover,
.ais-search-input:-webkit-autofill:focus,
.ais-search-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #F7FAFC inset !important;
    box-shadow: 0 0 0 1000px #F7FAFC inset !important;
    -webkit-text-fill-color: #2D3748 !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Placeholder Styles */
.ais-search-input::placeholder {
    color: #A0AEC0;
}

.ais-search-input::-webkit-input-placeholder {
    color: #A0AEC0;
}

.ais-search-input::-moz-placeholder {
    color: #A0AEC0;
}

.ais-search-input:-ms-input-placeholder {
    color: #A0AEC0;
}

/* Search Button */
.ais-search-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background-color: #4299E1;
    color: #FFFFFF;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    white-space: nowrap;
}

.ais-search-button:hover {
    background-color: #3182CE;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.ais-search-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.3);
}

.ais-search-button:focus {
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.4);
}

.ais-button-text {
    line-height: 1;
}

.ais-button-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Mobile Responsive */
@media screen and (max-width: 767px) {
    /* Container - reduced height and thinner border */
    .ais-search-input-container {
        padding: 12px 14px;
        border: 2px solid transparent;
    }

    /* Input - smaller font and reduced height */
    .ais-search-input {
        font-size: 14px;
        min-height: 40px;
    }

    /* Button - circular with icon only */
    .ais-search-button {
        width: 44px;
        height: 44px;
        padding: 12px;
        border-radius: 50%;
        min-width: 44px;
        gap: 0;
    }

    /* Hide button text on mobile */
    .ais-button-text {
        display: none;
    }

    /* Keep icon visible and centered */
    .ais-button-icon {
        width: 16px;
        height: 16px;
        margin: 0;
    }
}
