/**
 * Global Search Styles
 * Enhanced search results display
 */

/* Search Results Container */
.search-results-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0.375rem;
    box-shadow: 0 4px 25px 0 rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    max-height: 500px;
    overflow: hidden;
    display: none;
    z-index: 1050;
}

.navbar-search-wrapper.search-input-wrapper {
    position: relative;
}

/* Dark mode support */
html.dark-style .search-results-container {
    background: #2b2c40;
    box-shadow: 0 4px 25px 0 rgba(0, 0, 0, 0.4);
}

/* Search Results Header */
.search-results-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

html.dark-style .search-results-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.search-results-header h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

/* Search Results Body */
.search-results-body {
    max-height: 450px;
    overflow-y: auto;
}

.search-results-body .list-group-item {
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

html.dark-style .search-results-body .list-group-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.search-results-body .list-group-item:last-child {
    border-bottom: none;
}

.search-results-body .list-group-item:hover {
    background-color: rgba(105, 108, 255, 0.05);
    transform: translateX(5px);
}

html.dark-style .search-results-body .list-group-item:hover {
    background-color: rgba(105, 108, 255, 0.1);
}

/* Search Result Title */
.search-result-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #566a7f;
    margin-bottom: 0.25rem;
}

html.dark-style .search-result-title {
    color: #dcdfe4;
}

.search-result-desc {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #a1acb8;
}

html.dark-style .search-result-desc {
    color: #858b97;
}

/* Highlight matched text */
.search-result-title mark,
.search-result-desc mark {
    background-color: rgba(105, 108, 255, 0.2);
    color: #696cff;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

html.dark-style .search-result-title mark,
html.dark-style .search-result-desc mark {
    background-color: rgba(105, 108, 255, 0.3);
    color: #8b8dff;
}

/* Category Badge */
.search-results-body .badge-sm {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
}

/* Avatar in search results */
.search-results-body .avatar-sm {
    width: 2.5rem;
    height: 2.5rem;
}

.search-results-body .avatar-initial {
    font-size: 1.125rem;
}

/* Loading state */
.search-results-body .spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
}

/* Scrollbar styling */
.search-results-body::-webkit-scrollbar {
    width: 6px;
}

.search-results-body::-webkit-scrollbar-track {
    background: transparent;
}

.search-results-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.search-results-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

html.dark-style .search-results-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

html.dark-style .search-results-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* No results state */
.search-results-body .ri-48px {
    font-size: 3rem;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 767.98px) {
    .search-results-container {
        position: fixed;
        top: auto;
        left: 1rem;
        right: 1rem;
        margin-top: 0;
    }
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-container {
    animation: slideDown 0.2s ease;
}