/* Global Search Interface Styles */

/* Enhanced Search Bar */
.global-search-container {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.global-search-input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.global-search-input:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.global-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e40af;
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.global-search-btn:hover {
    background: #1d4ed8;
    transform: translateY(-50%) scale(1.05);
}

/* Autocomplete Dropdown */
.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 4px;
    display: none;
}

.search-autocomplete.show {
    display: block;
    animation: slideDown 0.2s ease-out;
}

.autocomplete-section {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.autocomplete-section:last-child {
    border-bottom: none;
}

.autocomplete-header {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.autocomplete-item:hover {
    background: #f8fafc;
    color: #1e40af;
}

.autocomplete-item.active {
    background: #f0f9ff;
    color: #1e40af;
}

.autocomplete-icon {
    width: 32px;
    height: 32px;
    background: #f0f9ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: #1e40af;
    font-size: 14px;
}

.autocomplete-text {
    flex: 1;
}

.autocomplete-title {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 2px;
}

.autocomplete-desc {
    font-size: 12px;
    color: #6b7280;
}

/* Search Results Page */
.search-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.search-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.search-query {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.search-meta {
    color: #6b7280;
    font-size: 14px;
}

/* Search Filters */
.search-filters {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.filters-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 20px;
}

.filters-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.filters-clear {
    color: #1e40af;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.filters-clear:hover {
    text-decoration: underline;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    background: white;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-option:hover {
    border-color: #1e40af;
    color: #1e40af;
    text-decoration: none;
}

.filter-option.active {
    background: #1e40af;
    border-color: #1e40af;
    color: white;
}

/* Search Results */
.search-results {
    display: grid;
    gap: 24px;
}

.result-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    position: relative;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: #1e40af;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1e40af, #3b82f6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.result-card:hover::before {
    opacity: 1;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.result-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.result-type {
    background: #f0f9ff;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-type.business {
    background: #f0fdf4;
    color: #059669;
}

.result-type.category {
    background: #fef3c7;
    color: #d97706;
}

.result-type.location {
    background: #fce7f3;
    color: #be185d;
}

.result-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-badge.verified {
    background: #dcfce7;
    color: #059669;
}

.result-badge.premium {
    background: #fef3c7;
    color: #d97706;
}

.result-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rating-stars {
    display: flex;
    gap: 2px;
    color: #fbbf24;
}

.rating-value {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.result-content {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.result-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.result-title-link {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-title-link:hover {
    color: #1e40af;
    text-decoration: none;
}

.result-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}

.result-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.result-meta-item i {
    color: #9ca3af;
    font-size: 12px;
}

.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.result-action {
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.result-action.primary {
    background: #1e40af;
    color: white;
}

.result-action.primary:hover {
    background: #1d4ed8;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.result-action.secondary {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.result-action.secondary:hover {
    background: #f1f5f9;
    color: #1f2937;
    text-decoration: none;
    border-color: #d1d5db;
}

.result-action.success {
    background: #059669;
    color: white;
}

.result-action.success:hover {
    background: #047857;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.result-action.warning {
    background: #d97706;
    color: white;
}

.result-action.warning:hover {
    background: #b45309;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

/* Infinite Scroll Loading */
.loading-indicator {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-radius: 50%;
    border-top-color: #1e40af;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results-icon {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: #9ca3af;
    font-size: 32px;
}

.no-results-title {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.no-results-desc {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .global-search-container {
        max-width: 100%;
    }
    
    .global-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 10px 45px 10px 14px;
    }
    
    .search-filters {
        padding: 16px;
    }
    
    .filter-options {
        gap: 6px;
    }
    
    .filter-option {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .result-card {
        padding: 16px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .result-action {
        justify-content: center;
        text-align: center;
    }
    
    .search-autocomplete {
        max-height: 300px;
    }
}

/* Animation Keyframes */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Search Results Animation */
.result-card {
    animation: fadeIn 0.3s ease-out;
}

/* Focus States for Accessibility */
.global-search-input:focus,
.autocomplete-item:focus,
.filter-option:focus,
.result-action:focus {
    outline: 2px solid #1e40af;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .result-card {
        border-width: 2px;
    }
    
    .filter-option {
        border-width: 2px;
    }
    
    .global-search-input {
        border-width: 2px;
    }
}