/* Minimal styles for search dropdown only - using default Bootstrap 5 for everything else */

.search-results-dropdown {
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.175);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    margin-top: 0.25rem;
    min-width: 250px;
}

.search-item {
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
}

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

.search-item:hover,
.search-item.selected {
    background-color: #f8f9fa;
}

.search-link {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #212529;
}

.search-link:hover {
    text-decoration: none;
    color: #212529;
}

.search-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.search-excerpt {
    color: #6c757d;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.search-type {
    font-size: 0.625rem;
    color: #adb5bd;
    text-transform: uppercase;
}

.search-item.loading,
.search-item.error,
.search-item.no-results {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.875rem;
}

/* Bootstrap 5 Responsive Design */
@media (max-width: 991.98px) {
    .search-wrapper {
        min-width: 180px;
    }
    
    .search-input {
        min-width: auto !important;
    }
    
    .search-results-dropdown {
        min-width: 280px;
        left: -40px;
    }
}

@media (max-width: 767.98px) {
    .search-container {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .search-wrapper {
        width: 100%;
        min-width: auto;
    }
    
    .search-input {
        min-width: auto !important;
    }
    
    .search-results-dropdown {
        left: 0;
        right: 0;
        min-width: auto;
    }
}

@media (max-width: 575.98px) {
    .navbar-nav .search-container {
        padding: 0 1rem;
    }
    
    .search-wrapper {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    }
}

/* Bootstrap 5 Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-0.5rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results-dropdown {
    animation: fadeIn 0.15s ease-out;
}

/* Focus states matching Bootstrap 5 */
.search-wrapper:focus-within .search-input {
    border-color: #86b7fe !important;
}

/* Bootstrap 5 compatible hover states */
.search-item:hover .search-title {
    color: #0d6efd;
}

/* Loading spinner Bootstrap 5 style */
.search-item.loading::before {
    content: "";
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
    vertical-align: text-bottom;
}

/* Highlight matching text */
.search-highlight {
    background-color: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Search icon styles */
.search-form .fas {
    font-size: 14px;
}

/* Loading spinner */
.search-item.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Navbar integration styles */
.navbar .search-container {
    margin-left: 1rem;
}

.navbar-light .search-input {
    background-color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-light .search-input:focus {
    background-color: #ffffff !important;
}

.navbar-dark .search-input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff;
}

.navbar-dark .search-input:focus {
    background-color: rgba(255, 255, 255, 0.15) !important;
}

.navbar-dark .search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.navbar-dark #search-button {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff;
}

.navbar-dark #search-button:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

/* Ensure proper z-index for dropdown in navbar */
.navbar .search-results-dropdown {
    z-index: 1055;
}