/**
 * Header Search Bar Styles
 * Styles for search results dropdown
 */

/* Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 500px;
    overflow: hidden;
    z-index: 1000;
    margin-top: 8px;
    display: none;
    flex-direction: column;
}

.header-search-results {
    padding: 8px 0;
    flex: 1 1 auto;
    max-height: 450px;
    overflow-y: auto;
    min-height: 0;
}

/* Search Section */
.search-section {
    margin-bottom: 12px;
}

.search-section:last-child {
    margin-bottom: 0;
}

.search-section-title {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    padding: 8px 16px;
    margin: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* Search Result Items */
.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.search-result-item:hover {
    background-color: #f5f7fa;
}

.search-result-item i {
    font-size: 16px;
    margin-right: 12px;
    color: #198BEA;
    min-width: 20px;
    text-align: center;
}

/* Researcher Item */
.researcher-item {
    gap: 12px;
}

.researcher-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
    flex-shrink: 0;
}

.researcher-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.researcher-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.3;
}

.researcher-designation {
    font-size: 12px;
    color: #666;
    line-height: 1.2;
    margin-top: 2px;
}

/* Publication Item */
.publication-title {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Question Item */
.question-title {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Organization Item */
.organization-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* Journal Item */
.journal-title {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* No Results / Loading State */
.no-results,
.search-loading {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.search-loading {
    color: #198BEA;
}

/* Search Container Positioning */
.header-search-container,
.mobile-search-container {
    position: relative;
}

/* Mobile Search Results - specific styling for mobile overlay */
.mobile-search-overlay #mobile-search-results {
    position: static;
    margin: 0px 5%;
    width: 90%;
    max-width: 90%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Mobile Styles */
@media (max-width: 768px) {
    .search-results-dropdown {
        max-height: 70vh;
        border-radius: 6px;
    }
    
    /* Mobile overlay specific - needs different height calculation */
    .mobile-search-overlay #mobile-search-results {
        max-height: calc(100vh - 200px);
    }
    
    .mobile-search-overlay .header-search-results {
        max-height: calc(100vh - 250px);
    }

    .header-search-results {
        max-height: calc(70vh - 50px);
    }

    .search-result-item {
        padding: 12px 14px;
    }

    .researcher-photo {
        width: 32px;
        height: 32px;
    }

    .search-section-title {
        font-size: 11px;
        padding: 6px 14px;
    }
}

/* Scrollbar Styling - Applied to scrollable results area */
.header-search-results::-webkit-scrollbar {
    width: 6px;
}

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

.header-search-results::-webkit-scrollbar-thumb {
    background: #198BEA;
    border-radius: 3px;
}

.header-search-results::-webkit-scrollbar-thumb:hover {
    background: #1570c1;
}

/* Icon Colors for Different Categories */
.publication-item i {
    color: #198BEA;
}

.question-item i {
    color: #28a745;
}

.organization-item i {
    color: #fd7e14;
}

.journal-item i {
    color: #6f42c1;
}

/* Hover Effects for Different Categories */
.publication-item:hover {
    background-color: rgba(25, 139, 234, 0.05);
}

.question-item:hover {
    background-color: rgba(40, 167, 69, 0.05);
}

.organization-item:hover {
    background-color: rgba(253, 126, 20, 0.05);
}

.journal-item:hover {
    background-color: rgba(111, 66, 193, 0.05);
}

/* Suggestion Item Styles */
.suggestions-section {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 8px !important;
    padding-bottom: 8px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: 3px solid transparent;
}

.suggestion-item:hover {
    background-color: rgba(25, 139, 234, 0.08);
    border-left-color: #198BEA;
}

.suggestion-icon {
    font-size: 14px;
    margin-right: 12px;
    color: #999;
    min-width: 20px;
    text-align: center;
}

.suggestion-text {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.suggestion-item:hover .suggestion-text {
    color: #198BEA;
}

.suggestion-item:hover .suggestion-icon {
    color: #198BEA;
}

@media (max-width: 768px) {
    .suggestion-item {
        padding: 10px 14px;
    }
    
    .suggestion-text {
        font-size: 13px;
    }
    
    .suggestion-icon {
        font-size: 13px;
    }
}

/* Search Footer - Fixed at bottom, doesn't scroll */
.search-footer {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    padding: 0;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    display: none;
}

.see-all-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    color: #198BEA;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
}

.see-all-results:hover {
    background: #e3f2fd;
    color: #1570c1;
}

