/**
 * Global Search Dropdown Styles
 * Professional instant search autocomplete design
 */

.global-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 600px;
    overflow-y: auto;
    z-index: 1050;
    border: 1px solid #e0e0e0;
}

.global-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.global-search-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Empty State */
.search-dropdown-empty {
    padding: 3rem 2rem;
    text-align: center;
    color: #9e9e9e;
}

.search-dropdown-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.search-dropdown-empty p {
    margin: 0;
    font-size: 1rem;
    color: #757575;
}

/* Category */
.search-dropdown-category {
    margin: 0.5rem 0;
}

.search-dropdown-category:first-child {
    margin-top: 0;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #616161;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e0e0e0;
}

.category-header i {
    font-size: 0.875rem;
}

.category-header .badge {
    margin-left: auto;
    font-size: 0.7rem;
}

.category-more {
    padding: 0.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #757575;
    background: #fafafa;
    border-top: 1px dashed #e0e0e0;
}

/* Result Item */
.search-dropdown-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.search-dropdown-item:hover,
.search-dropdown-item.selected {
    background: #f5f5f5;
}

.search-dropdown-item.selected {
    background: #e3f2fd;
}

/* Item Icon */
.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.item-icon.bg-primary-light {
    background: #e3f2fd;
    color: #1976d2;
}

.item-icon.bg-purple-light {
    background: #f3e5f5;
    color: #7b1fa2;
}

.item-icon.bg-success-light {
    background: #e8f5e9;
    color: #388e3c;
}

.item-icon.bg-warning-light {
    background: #fff3e0;
    color: #f57c00;
}

.item-icon.bg-danger-light {
    background: #fce4ec;
    color: #c2185b;
}

/* Item Content */
.item-content {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #212121;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-title mark {
    background-color: #fff3cd;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.item-meta {
    font-size: 0.8125rem;
    color: #757575;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.item-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.search-dropdown-item .badge {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

/* Footer */
.search-dropdown-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
}

.btn-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1976d2;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-view-all:hover {
    background: #e3f2fd;
    border-color: #1976d2;
}

.btn-view-all i {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .global-search-dropdown {
        position: fixed;
        top: 60px;
        left: 1rem;
        right: 1rem;
        max-height: calc(100vh - 100px);
    }
    
    .search-dropdown-item {
        padding: 1rem 0.75rem;
    }
    
    .item-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .item-title {
        font-size: 0.875rem;
    }
    
    .item-meta {
        font-size: 0.75rem;
    }
}

/* Loading State in Dropdown */
.search-dropdown-loading {
    padding: 2rem;
    text-align: center;
}

.search-dropdown-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    color: #1976d2;
}
