/**
 * Global Search Styles
 * Styles for search suggestions dropdown and search results page
 */

/* Search Suggestions Dropdown */
.search-suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    margin-top: 0.25rem;
}

.search-suggestions-dropdown::-webkit-scrollbar {
    width: 8px;
}

.search-suggestions-dropdown::-webkit-scrollbar-track {
    background: #f5f6f7;
}

.search-suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 4px;
}

/* Suggestion Item */
.search-suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f5f6f7;
    cursor: pointer;
    transition: background-color 0.2s;
}

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

.search-suggestion-item:hover,
.search-suggestion-item.selected {
    background-color: #f8f9fa;
}

.search-suggestion-item.selected {
    border-left: 3px solid #ffc107;
}

/* Thumbnail/Icon */
.suggestion-thumb {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f6f7;
    border-radius: 0.25rem;
    overflow: hidden;
}

.suggestion-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.suggestion-thumb i {
    font-size: 1.5rem;
    color: #6c757d;
}

/* Suggestion Content */
.suggestion-content {
    flex: 1;
    min-width: 0;
}

.suggestion-title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: #373f50;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-title strong {
    color: #ffc107;
}

.suggestion-description {
    font-size: 0.8125rem;
    color: #7d879c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Segment Badge */
.suggestion-badge {
    flex-shrink: 0;
    margin-left: 0.75rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
}

.badge-bills {
    background-color: #e3f2fd;
    color: #1976d2;
}

.badge-gift_cards {
    background-color: #fce4ec;
    color: #c2185b;
}

.badge-marketplace {
    background-color: #e8f5e9;
    color: #388e3c;
}

.badge-courts {
    background-color: #fff3e0;
    color: #f57c00;
}

.badge-locations {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.badge-all {
    background-color: #f5f6f7;
    color: #6c757d;
}

/* Loading/Error/Empty States */
.search-loading,
.search-no-results,
.search-error {
    padding: 1.5rem;
    text-align: center;
    color: #7d879c;
    font-size: 0.9375rem;
}

.search-loading i,
.search-no-results i,
.search-error i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.search-error {
    color: #dc3545;
}

/* Search Results Page */
.search-results-container {
    padding: 2rem 0;
}

.search-results-header {
    margin-bottom: 6rem;
}

.search-results-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #373f50;
    margin-bottom: 0.5rem;
}

.search-results-meta {
    font-size: 0.9375rem;
    color: #7d879c;
}

.search-results-query {
    font-weight: 600;
    color: #373f50;
}

/* Segment Filters */
.search-segment-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e9f2;
}

.segment-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e9f2;
    border-radius: 0.5rem;
    background-color: #fff;
    color: #7d879c;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.segment-filter-btn:hover {
    border-color: #ffc107;
    color: #373f50;
}

.segment-filter-btn.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #fff;
}

/* Search Result Card */
.search-result-card {
    display: flex;
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    transition: box-shadow 0.2s, transform 0.2s;
    text-decoration: none;
    color: inherit;
}

.search-result-card:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.search-result-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f6f7;
    border-radius: 0.5rem;
    overflow: hidden;
}

.search-result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-thumb i {
    font-size: 2.5rem;
    color: #6c757d;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.search-result-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #373f50;
    margin: 0;
    flex: 1;
}

.search-result-title strong {
    color: #ffc107;
}

.search-result-description {
    font-size: 0.9375rem;
    color: #7d879c;
    line-height: 1.5;
    margin: 0;
}

/* Empty Results */
.search-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.search-empty-state i {
    font-size: 4rem;
    color: #d0d5dd;
    margin-bottom: 1rem;
}

.search-empty-state h3 {
    font-size: 1.5rem;
    color: #373f50;
    margin-bottom: 0.5rem;
}

.search-empty-state p {
    color: #7d879c;
    margin-bottom: 1.5rem;
}

/* Pagination */
.search-pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .search-suggestion-item {
        padding: 0.5rem 0.75rem;
    }

    .suggestion-thumb {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }

    .suggestion-badge {
        display: none;
    }

    .search-result-card {
        flex-direction: column;
        padding: 1rem;
    }

    .search-result-thumb {
        width: 100%;
        height: 150px;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .search-segment-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }

    .segment-filter-btn {
        white-space: nowrap;
    }
}

/* Dark theme support (if needed) */
@media (prefers-color-scheme: dark) {
    .search-suggestions-dropdown {
        background: #2a2e34;
        border-color: #3e4349;
    }

    .search-suggestion-item {
        border-bottom-color: #3e4349;
    }

    .search-suggestion-item:hover,
    .search-suggestion-item.selected {
        background-color: #373c43;
    }

    .suggestion-thumb {
        background-color: #3e4349;
    }

    .suggestion-title {
        color: #e5e9f2;
    }

    .suggestion-description {
        color: #9ca3af;
    }

    .search-result-card {
        background: #2a2e34;
        border-color: #3e4349;
    }

    .search-result-title {
        color: #e5e9f2;
    }

    .search-result-description {
        color: #9ca3af;
    }
}
