/* =========================================================================
 * components.css - ส่วนประกอบ UI (Cards, Tabs, Modals, Mini Player)
 * ========================================================================= */

/* 1. การ์ดวิดีโอ (Video Cards) */
.vcard {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.vcard:hover {
    transform: translateY(-2px);
    border-color: #444;
}

.vcard-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.vcard-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vcard-title {
    font-size: 13px;
    font-weight: 600;
    margin: 8px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vcard-ch {
    font-size: 11px;
    color: var(--dim);
}

.dur {
    position: absolute;
    right: 5px;
    bottom: 5px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 11px;
    padding: 2px 4px;
    border-radius: 4px;
}

/* 2. แท็บหมวดหมู่ (Filter Tabs) */
.filter-tabs-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.filter-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--dim);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--txt);
}

.filter-tab.active {
    background: var(--acc);
    color: #fff;
    border-color: var(--acc);
    font-weight: 600;
}

/* 3. การแสดงผลวิดีโอ (สลับซ่อน/แสดง) */
#video-display-area.hide-video {
    display: none !important;
}

/* ลบ .player-handle และ CSS ที่เกี่ยวกับโหมดลอยทั้งหมดทิ้งได้เลยครับ */

/* 4. Modals (กล่อง Popup) */
.modal-hidden { display: none; }

/* =========================================================================
 * 5. แถบควบคุมบน-ล่างแบบย่อ/ขยาย (Collapsible Bars)
 * ========================================================================= */

/* แถบด้านบน (Header) */
.lst-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #0b0b0d;
    border-bottom: 1px solid var(--line);
    position: fixed; /* ยึดติดขอบบนเสมอ */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* แอนิเมชันเลื่อนนุ่มนวล */
}

/* แถบด้านล่าง (Global Player Bar) */
#global-player-bar {
    position: fixed; /* ยึดติดขอบล่างเสมอ */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #18181b;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.6);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* แอนิเมชันเลื่อนนุ่มนวล */
}

/* ปุ่มแท็บสำหรับดึงขึ้น-ลง (เปลี่ยนเป็นแบบ Sleek Handle มินิมอล) */
.toggle-tab {
    position: absolute;
    background: #555;
    width: 50px;
    height: 6px;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
    z-index: 1001;
    padding: 0;
    left: 50%;
    transform: translateX(-50%); /* จัดให้อยู่กึ่งกลางหน้าจอเสมอ */
}

.toggle-tab:hover {
    background: #3b82f6; /* เปลี่ยนเป็นสีฟ้าเมื่อเอาเมาส์ชี้ */
}

/* ตำแหน่งปุ่มแท็บบน */
#btn-toggle-top { bottom: -14px; }

/* ตำแหน่งปุ่มแท็บล่าง */
#btn-toggle-bottom { top: -14px; }

/* คลาสสำหรับซ่อนแถบ (เลื่อนออกไปนอกจอ) */
.bar-hidden-top {
    transform: translateY(-100%);
}

.bar-hidden-bottom {
    transform: translateY(100%);
}