/**
 * Search Popup Styles
 * Clean, minimal design - click outside to close
 */

/* Popup Container */
.bf-search-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0s 0.2s;
}

.bf-search-popup.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.2s ease, visibility 0s;
}

/* Overlay - click to close */
.bf-search-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Modal Container */
.bf-search-modal {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 40px rgba(126, 217, 87, 0.3), 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Search Box */
.bf-search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bf-search-icon {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.4);
}

.bf-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 400;
    color: #fff;
    padding: 0;
}

.bf-search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Hide browser default search cancel button */
.bf-search-input::-webkit-search-cancel-button {
    display: none;
}

/* Results Container */
.bf-search-results {
    max-height: 50vh;
    overflow-y: auto;
}

.bf-search-results:empty {
    display: none;
}

/* Loading & Messages */
.bf-search-loading,
.bf-search-no-results {
    padding: 24px;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* Results List */
.bf-search-results-list {
    padding: 8px;
}

/* Result Item */
.bf-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #fff;
    transition: background 0.15s ease;
}

.bf-search-result:hover,
.bf-search-result:focus {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

/* Result Thumbnail */
.bf-search-thumb {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.bf-search-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Result Info */
.bf-search-info {
    flex: 1;
    min-width: 0;
}

.bf-search-type {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bf-primary, #7ed957);
    margin-bottom: 2px;
}

.bf-search-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffff00;
}

/* Remove search term highlighting - keep text consistent */
.bf-search-title mark {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* Mobile */
@media (max-width: 640px) {
    .bf-search-popup {
        padding-top: 10vh;
    }

    .bf-search-modal {
        width: 95%;
        max-width: none;
        margin: 0 10px;
    }

    .bf-search-box {
        padding: 14px 16px;
        gap: 10px;
    }

    .bf-search-input {
        font-size: 16px; /* Prevent iOS zoom */
    }

    .bf-search-results {
        max-height: 60vh;
    }

    .bf-search-result {
        padding: 8px 10px;
    }

    .bf-search-thumb {
        width: 36px;
        height: 36px;
    }
}