/* ============================================================
   FamousTube Live Search Dropdown
   Fixed: appended to body, outside all stacking contexts
   ============================================================ */

#ftt-ls-dropdown {
    display: none;
    position: absolute;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 999999; /* Above EVERYTHING */
    scrollbar-width: thin;
    scrollbar-color: #333 #141414;
}

#ftt-ls-dropdown::-webkit-scrollbar {
    width: 5px;
}
#ftt-ls-dropdown::-webkit-scrollbar-track {
    background: #141414;
}
#ftt-ls-dropdown::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 3px;
}

#ftt-ls-dropdown.ftt-ls-visible {
    display: block;
    animation: fttLsFadeIn 0.18s ease-out;
}

@keyframes fttLsFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Sections --- */
.ftt-ls-section {
    border-bottom: 1px solid #222;
}
.ftt-ls-section:last-of-type {
    border-bottom: none;
}

.ftt-ls-section-title {
    padding: 10px 16px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ftt-ls-section-title i {
    font-size: 11px;
    color: #555;
}

/* --- Result Items (all types) --- */
.ftt-ls-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none !important;
    color: #ccc !important;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
    position: relative;
}
.ftt-ls-item:hover,
.ftt-ls-item.ftt-ls-highlighted {
    background: #1e1e1e;
    color: #fff !important;
    border-left-color: #e53935;
    text-decoration: none !important;
}

/* --- POSTER-STYLE Thumbnail (portrait 2:3 ratio) --- */
.ftt-ls-thumb-poster {
    flex: 0 0 52px;
    width: 52px;
    height: 78px; /* 2:3 poster ratio */
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    background: #0a0a0a;
    margin-right: 14px;
}

.ftt-ls-thumb-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.ftt-ls-duration {
    position: absolute;
    bottom: 3px;
    right: 2px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

/* --- Info --- */
.ftt-ls-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ftt-ls-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: #ddd;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
    transition: color 0.15s;
}
.ftt-ls-item:hover .ftt-ls-title,
.ftt-ls-item.ftt-ls-highlighted .ftt-ls-title {
    color: #fff;
}

.ftt-ls-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #777;
}
.ftt-ls-meta i {
    margin-right: 3px;
    font-size: 10px;
    opacity: 0.6;
}
.ftt-ls-views,
.ftt-ls-date {
    white-space: nowrap;
}

/* --- Tag/Category Items --- */
.ftt-ls-tag-item {
    justify-content: space-between;
    padding: 8px 16px;
}
.ftt-ls-tag-name {
    font-size: 13px;
    font-weight: 500;
    color: #bbb;
}
.ftt-ls-tag-name i {
    margin-right: 6px;
    opacity: 0.5;
    font-size: 12px;
}
.ftt-ls-tag-count {
    font-size: 11px;
    color: #555;
    white-space: nowrap;
    margin-left: 12px;
}
.ftt-ls-item:hover .ftt-ls-tag-name,
.ftt-ls-item.ftt-ls-highlighted .ftt-ls-tag-name {
    color: #fff;
}

/* --- Loading --- */
.ftt-ls-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 16px;
    color: #777;
    font-size: 13px;
}
.ftt-ls-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #2a2a2a;
    border-top-color: #e53935;
    border-radius: 50%;
    animation: fttLsSpin 0.65s linear infinite;
}
@keyframes fttLsSpin {
    to { transform: rotate(360deg); }
}

/* --- No Results --- */
.ftt-ls-no-results {
    text-align: center;
    padding: 32px 16px;
    color: #555;
}
.ftt-ls-no-results i {
    font-size: 30px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.3;
}
.ftt-ls-no-results p {
    margin: 0;
    font-size: 14px;
}

/* --- View All Link --- */
.ftt-ls-view-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 13px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #e53935 !important;
    text-decoration: none !important;
    border-top: 1px solid #222;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.ftt-ls-view-all:hover {
    background: #1a1a1a;
    color: #ff6659 !important;
    text-decoration: none !important;
}
.ftt-ls-view-all i {
    font-size: 11px;
    transition: transform 0.2s;
}
.ftt-ls-view-all:hover i {
    transform: translateX(4px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Mobile — fixed bottom sheet */
@media (max-width: 767.98px) {
    #ftt-ls-dropdown {
        border-radius: 14px 14px 0 0;
        border: none;
        border-top: 1px solid #2a2a2a;
        box-shadow: 0 -12px 50px rgba(0, 0, 0, 0.9);
        max-height: 70vh;
    }
    #ftt-ls-dropdown.ftt-ls-visible {
        animation: fttLsSlideUp 0.22s ease-out;
    }
    @keyframes fttLsSlideUp {
        from { opacity: 0; transform: translateY(40px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .ftt-ls-thumb-poster {
        flex: 0 0 46px;
        width: 46px;
        height: 69px;
    }
    .ftt-ls-title {
        font-size: 12px;
    }
    .ftt-ls-meta {
        font-size: 10px;
    }
    .ftt-ls-section-title {
        padding: 8px 12px 4px;
        font-size: 9px;
    }
    .ftt-ls-item {
        padding: 7px 12px;
    }
}
