/* ==========================================================================
   KHUNG NỀN PHỦ KÍN MOBILE & KHỐI CHỨA DANH SÁCH CUỘN (LIST.CSS)
   ========================================================================== */

.list-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);

    z-index: 99;

    display: none;
    opacity: 0;

    transition: opacity 0.3s ease;
}


/* ==========================================================================
   KHỐI DANH SÁCH CHÍNH
   ========================================================================== */

.list-container {
    position: absolute;

    bottom: 0;
    left: 0;

    width: 100%;
    height: 78%;

    background-color: var(--theme-app-bg);

    border-radius: 24px 24px 0 0;

    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.15);

    z-index: 100;

    transform: translateY(100%);

    transition:
        transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);

    display: flex;
    flex-direction: column;

    overflow: hidden;

    /* Không cho hiệu ứng overscroll lan ra ngoài */
    overscroll-behavior: contain;

    /* Tối ưu animation kéo toàn khối */
    will-change: transform;

    /* Cho phép thao tác vuốt dọc */
    touch-action: pan-y;
}


.list-overlay.active {
    opacity: 1;
}


.list-overlay.active .list-container {
    transform: translateY(0);
}


/* ==========================================================================
   Ô TÌM KIẾM
   ========================================================================== */

.search-box-wrapper {
    padding: 16px 16px 12px 16px;

    background-color: var(--theme-app-bg);

    border-bottom: 1px solid var(--border-action-row);

    flex-shrink: 0;
}


.playlist-search-input {
    width: 100%;

    padding: 12px 16px;

    font-size: 14px;

    color: var(--text-primary);

    background-color: var(--bg-action-row);

    border: 1px solid var(--border-action-row);

    border-radius: 12px;

    outline: none;

    box-sizing: border-box;

    transition: all 0.2s ease;
}


.playlist-search-input:focus {
    border-color: var(--text-primary);

    background-color: var(--theme-app-bg);

    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}


/* ==========================================================================
   VÙNG CHỨA DANH SÁCH BÀI HÁT
   ========================================================================== */

.songs-list-wrapper {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;

    /* Cuộn native mượt trên iOS */
    -webkit-overflow-scrolling: touch;

    /* Không kéo ảnh hưởng sang vùng bên ngoài */
    overscroll-behavior-y: contain;

    /* Cho phép trình duyệt xử lý vuốt dọc */
    touch-action: pan-y;

    /* Báo trình duyệt tối ưu vùng cuộn */
    will-change: scroll-position;
}


/* ==========================================================================
   CẤU TRÚC HÀNG BÀI HÁT
   ========================================================================== */

.song-item-row {
    display: flex;

    align-items: center;

    gap: 14px;

    padding: 12px 16px;

    border-bottom: 1px solid var(--border-action-row);

    transition: background-color 0.2s ease;
}


.song-item-row:active,
.song-item-row.active {
    background-color: var(--bg-action-row) !important;
}


.song-item-text-meta {
    display: flex;

    flex-direction: column;

    gap: 4px;

    flex: 1;

    min-width: 0;

    padding: 4px 0;

    cursor: pointer;
}


.song-item-title {
    font-size: 14px;

    font-weight: bold;

    color: var(--text-primary);
}


.song-item-artist {
    font-size: 11px;

    color: var(--text-secondary);
}


.song-item-row.active .song-item-title {
    color: var(--progress-current) !important;
}


/* ==========================================================================
   KHỐI ẢNH VÀ NÚT PLAY
   ========================================================================== */

.song-item-play-btn {
    width: 45px;
    height: 45px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 12px;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.song-item-play-btn .ui-icon-img {
    width: 45px;
    height: 45px;

    object-fit: contain;

    filter: brightness(0) invert(1);

    z-index: 2;
    pointer-events: none !important;
}


.song-item-play-btn.ui-icon-container {
    background-color: transparent !important;

    border: none !important;

    padding: 0 !important;
}


/* ==========================================================================
   THÔNG BÁO KHÔNG CÓ BÀI HÁT
   ========================================================================== */

.list-empty-msg {
    text-align: center;

    padding: 40px 16px;

    font-size: 14px;

    color: var(--text-secondary);
}