/* Global Search Base */
.search-input-wrapper {
    width: 300px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input {
    border-radius: 50px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding-left: 2.5rem !important;
    /* Space for icon */
    padding-right: 1rem !important;
    color: var(--bs-body-color) !important;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

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

.search-input:focus {
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
    border-color: transparent !important;
    color: #333 !important;
    width: 340px;
    /* Expand on focus */
}

.search-input:focus::placeholder {
    color: #999 !important;
}

/* Icon Styles */
.search-icon-wrapper {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    pointer-events: none;
}

.search-icon-wrapper i {
    color: rgba(255, 255, 255, 0.7);
    transition: color 0.3s ease;
}

.search-input:focus~.search-icon-wrapper i {
    color: var(--bs-primary);
}

/* Suggestions Dropdown */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 10px;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    z-index: 1000;
}

.search-suggestion-item {
    padding: 0.75rem 1rem;
    color: var(--bs-body-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.search-suggestion-item:hover,
.search-suggestion-item.selected {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.search-suggestion-item.selected {
    border-left: 3px solid var(--bs-primary);
    padding-left: calc(1rem - 3px);
}

.suggestion-thumbnail {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.suggestion-thumbnail img,
.placeholder-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.placeholder-thumbnail {
    background-color: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

.suggestion-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.suggestion-type .badge {
    font-weight: 400;
    font-size: 0.7rem;
    padding: 0.3em 0.6em;
    border-radius: 4px;
}

.search-dropdown-footer {
    background-color: rgba(0, 0, 0, 0.02);
    padding: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Clear Button */
.btn-clear-search {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    padding: 0;
    cursor: pointer;
    z-index: 10;
}

.btn-clear-search:hover {
    color: #333;
}

/* Dark Mode Adjustments */
[data-bs-theme="dark"] .search-input {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-bs-theme="dark"] .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6) !important;
}

[data-bs-theme="dark"] .search-input:focus {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: white !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
}

[data-bs-theme="dark"] .search-dropdown {
    background-color: rgba(30, 41, 59, 0.95);
    color: white;
}

[data-bs-theme="dark"] .suggestion-title {
    color: white;
}

[data-bs-theme="dark"] .search-dropdown-footer {
    background-color: rgba(255, 255, 255, 0.05);
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .btn-clear-search:hover {
    color: white;
}