/* 
==============================================================================
Advanced AJAX Search - Styles
==============================================================================
*/

/* Search Wrapper */
.aas-search-wrapper {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Search Container */
.aas-search-container {
    position: relative;
    width: 100%;
}

/* Search Input Wrapper */
.aas-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.aas-search-input-wrapper:focus-within {
    border-color: #0073aa;
    box-shadow: 0 4px 16px rgba(0, 115, 170, 0.15);
}

/* Search Icon */
.aas-search-icon {
    color: #757575;
    font-size: 18px;
    margin-right: 12px;
    transition: color 0.3s ease;
}

.aas-search-input-wrapper:focus-within .aas-search-icon {
    color: #0073aa;
}

/* Search Input */
.aas-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: #333;
    background: transparent;
    padding: 4px 0;
    font-family: 'Poppins', sans-serif;
}

.aas-search-input::placeholder {
    color: #999;
}

/* Clear Icon */
.aas-clear-icon {
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    margin-left: 8px;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.aas-clear-icon:hover {
    color: #333;
    background: #f0f0f0;
}

/* Loading Spinner */
.aas-loading-spinner {
    color: #0073aa;
    font-size: 18px;
    margin-left: 12px;
    animation: aas-spin 1s linear infinite;
}

@keyframes aas-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Search Results Dropdown */
.aas-search-results {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    animation: aas-fadeIn 0.3s ease;
}

@keyframes aas-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar */
.aas-search-results::-webkit-scrollbar {
    width: 8px;
}

.aas-search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.aas-search-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.aas-search-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Result Item */
.aas-result-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.aas-result-item:last-child {
    border-bottom: none;
}

.aas-result-item:hover {
    background: #f8f9fa;
}

/* Result Thumbnail */
.aas-result-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Result Content */
.aas-result-content {
    flex: 1;
    min-width: 0;
}

.aas-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
}

.aas-result-excerpt {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Result Type Badge */
.aas-result-type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.aas-result-type.type-treatment {
    background: #e8f5e9;
    color: #2e7d32;
}

.aas-result-type.type-doctor {
    background: #e3f2fd;
    color: #1565c0;
}

.aas-result-type.type-hospital {
    background: #fff3e0;
    color: #e65100;
}

.aas-result-type.type-default {
    background: #f5f5f5;
    color: #616161;
}

/* No Results */
.aas-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.aas-no-results i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.3;
}

.aas-no-results p {
    font-size: 16px;
    margin: 0;
}

/* Results Header */
.aas-results-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #666;
    font-weight: 600;
    border-radius: 12px 12px 0 0;
}

/* View All Button */
.aas-view-all {
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.aas-view-all a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.3s ease;
}

.aas-view-all a:hover {
    color: #005177;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aas-search-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }
    
    .aas-search-input-wrapper {
        padding: 10px 15px;
    }
    
    .aas-search-input {
        font-size: 15px;
    }
    
    .aas-result-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .aas-result-title {
        font-size: 15px;
    }
    
    .aas-result-excerpt {
        font-size: 12px;
    }
    
    .aas-search-results {
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .aas-search-input-wrapper {
        padding: 8px 12px;
    }
    
    .aas-search-icon {
        font-size: 16px;
        margin-right: 10px;
    }
    
    .aas-result-item {
        padding: 12px 15px;
    }
    
    .aas-result-thumbnail {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }
    
    .aas-result-title {
        font-size: 14px;
    }
    
    .aas-result-excerpt {
        font-size: 11px;
    }
    
    .aas-result-type {
        font-size: 10px;
        padding: 2px 8px;
    }
}

/* Highlight Search Term */
.aas-highlight {
    background-color: #fff176;
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}

/* Loading State */
.aas-search-container.loading .aas-search-input-wrapper {
    pointer-events: none;
    opacity: 0.7;
}

/* Empty State */
.aas-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.aas-empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.2;
}

.aas-empty-state h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #666;
}

.aas-empty-state p {
    font-size: 14px;
    color: #999;
}

/* Keyboard Navigation */
.aas-result-item:focus,
.aas-result-item.keyboard-focus {
    background: #e3f2fd;
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

/* Accessibility */
.aas-search-input:focus {
    outline: none;
}

.aas-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
