/* ==========================================================================
   SEARCH FEATURE STYLES
   Simple: Always-visible centered search bar with wide dropdown
   ========================================================================== */

/* SEARCH BAR IN HEADER - New unique class names to avoid legacy conflicts */
.search-bar-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 360px;
    margin: 0 auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 8px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-bar-wrapper:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}

.search-bar-wrapper .search-icon {
    font-size: 20px;
    color: var(--color-text-secondary);
    margin-right: 10px;
    flex-shrink: 0;
}

.search-bar-wrapper .search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
    color: var(--color-text);
    min-width: 0;
}

.search-bar-wrapper .search-input::placeholder {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .search-bar-wrapper {
    background: #3c4043;
    border-color: #5f6368;
}

[data-theme="dark"] .search-bar-wrapper:focus-within {
    border-color: #8ab4f8;
}

/* ==========================================================================
   SEARCH RESULTS DROPDOWN - Wide, centered on screen
   ========================================================================== */
#search-results-dropdown {
    position: fixed !important;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 700px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    display: none;
}

#search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.15s ease;
}

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

.search-result-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.search-result-item .material-symbols-outlined {
    font-size: 22px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.search-result-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.search-result-name {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-location {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.search-no-results {
    padding: 32px 20px;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 14px;
}

[data-theme="dark"] #search-results-dropdown {
    background: #292a2d;
    border-color: #3c4043;
}

[data-theme="dark"] .search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Hide all old search elements */
.search-expand-container,
.search-toggle-btn,
.search-expanded,
.search-popup-overlay,
.search-popup,
.header-search-container,
.search-input-wrapper {
    display: none !important;
}

/* ==========================================================================
   MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .search-bar-wrapper {
        max-width: 200px;
        padding: 6px 12px;
    }

    .search-bar-wrapper .search-input {
        font-size: 13px;
    }

    .search-bar-wrapper .search-icon {
        font-size: 18px;
        margin-right: 8px;
    }

    #search-results-dropdown {
        top: 70px;
        width: calc(100% - 16px);
        max-height: calc(100vh - 100px);
    }

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

@media (max-width: 480px) {
    .search-bar-wrapper {
        max-width: 140px;
        padding: 5px 10px;
    }

    .search-bar-wrapper .search-input::placeholder {
        font-size: 11px;
    }

    #search-results-dropdown {
        left: 8px;
        right: 8px;
        transform: none;
        width: auto;
    }
}