/* Enhanced Search Styles */

/* Search Input Container */
.search__input {
    position: relative;
}

/* Suggestions Container */
.enhanced-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

/* Suggestions Header */
.suggestions-header {
    padding: 8px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Suggestion Items */
.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f3f4;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: #f8f9fa;
    border-left: 3px solid var(--hsj-theme-primary, #007bff);
}

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

.suggestion-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.suggestion-icon {
    color: #6c757d;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.suggestion-text {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.suggestion-text strong {
    color: var(--hsj-theme-primary, #007bff);
    font-weight: 600;
}

.suggestion-original {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Suggestion Types */
.suggestion-correction {
    background: #fff3cd;
    border-left: 3px solid #ffc107;
}

.suggestion-correction:hover {
    background: #ffeaa7;
}

.suggestion-history .suggestion-icon {
    color: #28a745;
}

.suggestion-tour .suggestion-icon {
    color: #007bff;
}

.suggestion-location .suggestion-icon {
    color: #dc3545;
}

/* Search Results Container */
.version_search_3_results_container {
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.version_search_3_results_header {
    padding: 20px;
    background: linear-gradient(135deg, var(--hsj-theme-primary, #007bff), var(--hsj-theme-secondary, #0056b3));
    color: white;
}

.version_search_3_results_count {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 5px;
}

.version_search_3_results_title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.version_search_3_results_list {
    padding: 20px;
}

/* Spell Corrections */
.spell-correction {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.correction-message {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #856404;
}

.correction-message i {
    color: #ffc107;
}

.correction-link {
    color: var(--hsj-theme-primary, #007bff);
    text-decoration: none;
    font-weight: 600;
}

.correction-link:hover {
    text-decoration: underline;
}

.original-query {
    color: #6c757d;
    font-style: italic;
}

/* Search Results */
.search-result {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    background: white;
}

.search-result:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.result-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.result-link {
    color: var(--hsj-theme-primary, #007bff);
    text-decoration: none;
}

.result-link:hover {
    text-decoration: underline;
}

.result-link strong {
    background: rgba(255, 193, 7, 0.3);
    padding: 1px 2px;
    border-radius: 2px;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.result-type {
    background: var(--hsj-theme-primary, #007bff);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.result-type.tour {
    background: #28a745;
}

.result-type.location {
    background: #dc3545;
}

.result-type.news {
    background: #ffc107;
    color: #333;
}

.match-info {
    color: #6c757d;
    cursor: help;
}

.result-score {
    background: #f8f9fa;
    color: #495057;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.result-description {
    margin: 10px 0 0 0;
    color: #6c757d;
    line-height: 1.5;
}

.result-description strong {
    background: rgba(255, 193, 7, 0.3);
    padding: 1px 2px;
    border-radius: 2px;
    color: #333;
}

/* Search Suggestions */
.search-suggestions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.suggestions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.suggestions-title i {
    color: #ffc107;
}

.suggestions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-tag {
    background: white;
    color: var(--hsj-theme-primary, #007bff);
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.suggestion-tag:hover {
    background: var(--hsj-theme-primary, #007bff);
    color: white;
    transform: translateY(-1px);
}

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

.no-results-content i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-results-content h3 {
    color: #495057;
    margin-bottom: 10px;
}

.search-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.search-tips h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 16px;
}

.search-tips ul {
    margin: 0;
    padding-left: 20px;
}

.search-tips li {
    margin-bottom: 5px;
    color: #6c757d;
}

/* Search Error */
.search-error {
    text-align: center;
    padding: 30px;
    color: #dc3545;
}

.search-error i {
    font-size: 36px;
    margin-bottom: 15px;
}

/* Loading State */
#searchLoading {
    display: none;
    text-align: center;
    padding: 20px;
}

.search-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--hsj-theme-primary, #007bff);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .enhanced-search-suggestions {
        max-height: 250px;
    }
    
    .suggestion-item {
        padding: 10px 12px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-meta {
        flex-wrap: wrap;
    }
    
    .search-result {
        padding: 15px;
    }
    
    .suggestions-list {
        justify-content: center;
    }
    
    .search-tips {
        margin-top: 15px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .version_search_3_results_header {
        padding: 15px;
    }
    
    .version_search_3_results_title {
        font-size: 20px;
    }
    
    .version_search_3_results_list {
        padding: 15px;
    }
    
    .suggestion-content {
        gap: 8px;
    }
    
    .suggestion-text {
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .enhanced-search-suggestions {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .suggestions-header {
        background: #1a202c;
        color: #a0aec0;
    }
    
    .suggestion-item:hover,
    .suggestion-item.active {
        background: #4a5568;
    }
    
    .search-result {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .result-link {
        color: #63b3ed;
    }
    
    .search-suggestions {
        background: #1a202c;
    }
    
    .suggestion-tag {
        background: #2d3748;
        border-color: #4a5568;
        color: #63b3ed;
    }
    
    .search-tips {
        background: #1a202c;
    }
}