/* ============================================
   Universal Search Overlay
   ============================================ */

.fml-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    padding-top: 12vh;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.fml-search-overlay.active {
    display: flex;
    opacity: 1;
}

.fml-search-overlay.fading-out {
    opacity: 0;
}

/* Close button */
.fml-search-close {
    position: absolute;
    top: 20px;
    right: 28px;
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: color 0.15s;
}

.fml-search-close:hover {
    color: #fff;
}

/* Search input container */
.fml-search-input-wrap {
    width: 90%;
    max-width: 640px;
    position: relative;
}

.fml-search-input-wrap i.fa-search {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 20px;
    pointer-events: none;
}

.fml-search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-size: 20px;
    background: #1a1a2e;
    border: 1px solid #333;
    border-radius: 12px;
    color: #f0f0f0;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.fml-search-input::placeholder {
    color: #555;
}

.fml-search-input:focus {
    border-color: #e94560;
}

/* Results container */
.fml-search-results {
    width: 90%;
    max-width: 640px;
    margin-top: 16px;
    max-height: calc(88vh - 140px);
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Scrollbar styling */
.fml-search-results::-webkit-scrollbar {
    width: 6px;
}

.fml-search-results::-webkit-scrollbar-track {
    background: transparent;
}

.fml-search-results::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* Loading spinner */
.fml-search-loading {
    text-align: center;
    padding: 32px 0;
    color: #666;
    font-size: 14px;
}

.fml-search-loading i {
    margin-right: 8px;
}

/* Empty state */
.fml-search-empty {
    text-align: center;
    padding: 40px 0;
    color: #555;
    font-size: 15px;
}

.fml-search-hint {
    text-align: center;
    padding: 40px 0;
    color: #444;
    font-size: 14px;
}

/* Category section */
.fml-search-category {
    margin-bottom: 20px;
}

.fml-search-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    color: #888;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid #222;
    margin-bottom: 4px;
}

.fml-search-category-header i {
    font-size: 12px;
    color: #e94560;
}

/* Result item */
.fml-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    color: #ddd;
    transition: background 0.15s;
}

.fml-search-item:hover {
    background: rgba(233, 69, 96, 0.1);
    color: #fff;
}

/* Thumbnail */
.fml-search-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #222;
    flex-shrink: 0;
}

.fml-search-thumb.artist {
    border-radius: 50%;
}

/* Item text */
.fml-search-item-info {
    flex: 1;
    min-width: 0;
}

.fml-search-item-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fml-search-item-sub {
    font-size: 12px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Play button on song items */
.fml-search-play-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e94560;
    border: none;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, background 0.15s;
}

.fml-search-play-btn:hover {
    transform: scale(1.1);
    background: #ff5a78;
}

/* No-image placeholder icon */
.fml-search-icon-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 18px;
    flex-shrink: 0;
}

.fml-search-icon-placeholder.artist {
    border-radius: 50%;
}

/* Header search icon */
.show-search {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 18px;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.show-search:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 600px) {
    .fml-search-overlay {
        padding-top: 5vh;
    }

    .fml-search-input {
        font-size: 17px;
        padding: 14px 16px 14px 46px;
    }

    .fml-search-input-wrap i.fa-search {
        left: 14px;
        font-size: 17px;
    }

    .fml-search-close {
        top: 12px;
        right: 16px;
    }

    .fml-search-thumb,
    .fml-search-icon-placeholder {
        width: 38px;
        height: 38px;
    }
}
