/* Enhanced Search Styles */

.sb-search-input {
    transition: all 0.3s ease;
}

.sb-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25) !important;
    border-color: #007bff !important;
}

.sb-icon-search {
    cursor: pointer;
    transition: all 0.3s ease;
}

.sb-icon-search:hover i {
    color: #007bff;
    transform: scale(1.1);
}

.sb-icon-search i {
    transition: all 0.3s ease;
}

.sb-search-submit {
    cursor: pointer;
    transition: all 0.3s ease;
}

.sb-search-submit:hover {
    opacity: 0.8;
}

.sb-search-submit:active {
    opacity: 0.6;
}

/* jQuery UI Autocomplete Enhancements */
.ui-autocomplete {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    background: white;
    z-index: 9999 !important;
}

.ui-menu-item {
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #f0f0f0;
}

.ui-menu-item:last-child {
    border-bottom: none;
}

.ui-menu-item .ui-menu-item-wrapper {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
}

.ui-menu-item .ui-menu-item-wrapper:before {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
    color: #999;
    font-size: 12px;
}

.ui-menu-item .ui-menu-item-wrapper:hover,
.ui-menu-item .ui-menu-item-wrapper.ui-state-active {
    background: #f8f9fa;
    color: #007bff;
    border-left: 3px solid #007bff;
    padding-left: 13px;
}

.ui-menu-item .ui-menu-item-wrapper.ui-state-active:before {
    color: #007bff;
}

/* No results message */
.ui-menu-item .ui-menu-item-wrapper[data-no-result="true"] {
    color: #999;
    font-style: italic;
    cursor: default;
}

.ui-menu-item .ui-menu-item-wrapper[data-no-result="true"]:hover {
    background: transparent;
    border-left: none;
    padding-left: 16px;
    color: #999;
}

/* Loading state */
.sb-search-input.loading {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 50 50"><circle cx="25" cy="25" r="20" fill="none" stroke="%23999" stroke-width="4" stroke-dasharray="31.4 31.4" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 60px) center;
    background-size: 20px 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sb-search-input {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .ui-autocomplete {
        max-height: 300px;
        font-size: 14px;
    }
}

/* Highlight matched text */
.ui-menu-item .ui-menu-item-wrapper strong {
    color: #007bff;
    font-weight: 600;
}
