/**
 * AIOS Eureka Search Styles
 * Custom styling for the IDX Quick Search widget
 */

/* Main wrapper */
.aios-eureka-search-wrapper {
    position: relative;
    width: 100%;
}

/* Navigation wrapper - matches ihf styles */
.aios-eureka-search-wrapper .aios-ihf-main-search-wrapper {
    display: block;
}

.aios-eureka-search-wrapper .aios-ihf-main-search-form {
    display: block;
    margin: 0;
    padding: 0;
}

.aios-eureka-search-wrapper .aios-ihf-main-search-field-wrapper {
    display: block;
}

.aios-eureka-search-wrapper .aios-ihf-eureka-input-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
}

.aios-eureka-search-wrapper .aios-ihf-eureka-input-wrapper {
    flex: 1;
    min-width: 0;
}

.aios-eureka-search-wrapper .aios-ihf-eureka-input-container {
    display: block;
    height: 100%;
}

.aios-eureka-search-wrapper .aios-ihf-eureka-input {
    display: block;
    height: 100%;
}

/* Input field */
.aios-eureka-search-wrapper .aios-eureka-input {
    width: 100%;
    height: 50px;
    padding: 10px 15px;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.aios-eureka-search-wrapper .aios-eureka-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
}

.aios-eureka-search-wrapper .aios-eureka-input::placeholder {
    color: #999;
}

/* Search button */
.aios-eureka-search-wrapper .aios-ihf-eureka-search-button {
    flex-shrink: 0;
}

.aios-eureka-search-wrapper .ihf-main-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.aios-eureka-search-wrapper .ihf-main-search-btn:hover {
    background-color: #868686;
}

.aios-eureka-search-wrapper .ihf-main-search-btn:active {
    background-color: #868686;
}
.aios-eureka-search-wrapper .ihf-main-search-btn i {
    font-style: normal!important;
}

/* Suggestions dropdown */
.aios-eureka-search-wrapper .aios-eureka-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 350px;
    overflow-y: auto;
}

.aios-eureka-search-wrapper .aios-eureka-suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Suggestion header (type label) */
.aios-eureka-search-wrapper .aios-eureka-suggestion-header {
    padding: 8px 15px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

/* Suggestion item */
.aios-eureka-search-wrapper .aios-eureka-suggestion-item {
    display: flex;
    align-items: center;
    padding: 5px 15px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.aios-eureka-search-wrapper .aios-eureka-suggestion-item:last-child {
    border-bottom: none;
}

.aios-eureka-search-wrapper .aios-eureka-suggestion-item:hover,
.aios-eureka-search-wrapper .aios-eureka-suggestion-item.highlighted {
    background-color: #f0f7ff;
}

.aios-eureka-search-wrapper .aios-eureka-suggestion-item i {
    flex-shrink: 0;
    width: 20px;
    margin-right: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.aios-eureka-search-wrapper .aios-eureka-suggestion-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* MLS suggestion highlight */
.aios-eureka-search-wrapper .aios-eureka-suggestion-item[data-type="mls"] {
    background-color: #fff8e6;
}

.aios-eureka-search-wrapper .aios-eureka-suggestion-item[data-type="mls"]:hover,
.aios-eureka-search-wrapper .aios-eureka-suggestion-item[data-type="mls"].highlighted {
    background-color: #fff0c2;
}

.aios-eureka-search-wrapper .aios-eureka-suggestion-item[data-type="mls"] i {
    color: #f0ad4e;
}

/* No results message */
.aios-eureka-search-wrapper .aios-eureka-no-results {
    display: flex;
    align-items: center;
    padding: 15px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

.aios-eureka-search-wrapper .aios-eureka-no-results i {
    flex-shrink: 0;
    width: 20px;
    margin-right: 10px;
    font-size: 14px;
    color: #999;
    text-align: center;
}

.aios-eureka-search-wrapper .aios-eureka-no-results span {
    flex: 1;
}

/* Loading message */
.aios-eureka-search-wrapper .aios-eureka-loading {
    display: flex;
    align-items: center;
    padding: 15px;
    font-size: 14px;
    color: #666;
}

.aios-eureka-search-wrapper .aios-eureka-loading-spinner {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2px solid #e0e0e0;
    border-top-color: #007bff;
    border-radius: 50%;
    animation: aios-eureka-spin 0.8s linear infinite;
}

@keyframes aios-eureka-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Scrollbar styling */
.aios-eureka-search-wrapper .aios-eureka-suggestions::-webkit-scrollbar {
    width: 8px;
}

.aios-eureka-search-wrapper .aios-eureka-suggestions::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.aios-eureka-search-wrapper .aios-eureka-suggestions::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.aios-eureka-search-wrapper .aios-eureka-suggestions::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive styles */
@media (max-width: 767px) {
    .aios-eureka-search-wrapper .aios-eureka-input,
    .aios-eureka-search-wrapper .ihf-main-search-btn {
        height: 40px;
    }
}

/* Loading state */
.aios-eureka-search-wrapper.loading .aios-eureka-input {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><circle cx="12" cy="12" r="10" stroke="%23ddd" stroke-width="2" fill="none"/><path d="M12 2a10 10 0 0 1 10 10" stroke="%23007bff" stroke-width="2" fill="none" stroke-linecap="round"><animateTransform attributeName="transform" type="rotate" dur="1s" from="0 12 12" to="360 12 12" repeatCount="indefinite"/></path></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px 20px;
    padding-right: 40px;
}

/* Theme compatibility - inherit from parent styles where possible */
.qs-form .aios-eureka-search-wrapper .aios-eureka-input,
.qs-form .aios-eureka-search-wrapper .ihf-main-search-btn {
    font-family: inherit;
}

/* Match existing QS form styling */
.hp-qs .aios-eureka-search-wrapper .aios-ihf-eureka-input-row {
    background: transparent;
}

.hp-qs .aios-eureka-search-wrapper .aios-eureka-input {
    background: rgba(255, 255, 255, 0.95);
}

.hp-qs .aios-eureka-search-wrapper .aios-eureka-suggestions {
    background: rgba(255, 255, 255, 0.98);
}
