/* styles.css */
@import url('https://fonts.googleapis.com/css2?family=Prompt:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');


/* กำหนดพื้นหลังของทั้งหน้าเป็นสีดำ */
body {
    background-color: #1c1c1c;
    color: #fff;
    font-family: 'Prompt', sans-serif;
}

/* Force Prompt on all elements to override Bootstrap defaults */
*, button, input, select, textarea, .btn, .form-control, .form-select, .modal-content {
    font-family: 'Prompt', sans-serif !important;
}

.navbar-brand {
    font-weight: 600;
}

.nav-tabs .nav-link {
    font-weight: 500;
}

/* สไตล์สำหรับ Tab ด้านขวา */
#tabs-container {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
    max-width: 100vw;
    background-color: #1c1c1c;
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.2);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    transition: width 0.3s;
    display: none;
    /* ซ่อนแถบโดยเริ่มต้น */
}

/* สไตล์สำหรับปุ่ม toggle */
#toggle-tab-button {
    position: fixed;
    top: 10%;
    right: 0;
    transform: translateY(-50%);
    border: none;
    padding: 10px 15px;
    border-radius: 5px 0 0 5px;
    cursor: pointer;
    z-index: 1000;
    transition: right 0.3s;
    /* เพิ่ม transition เพื่อให้การเคลื่อนที่ลื่นไหล */
}

#toggle-tab-button:hover {
    background-color: #0056b3;
}

/* ปรับตำแหน่งปุ่มเมื่อแท็บเปิด */
#toggle-tab-button.tabs-open {
    right: 600px;
    /* ขยับปุ่มไปทางซ้าย 600px เมื่อแท็บเปิด */
}

/* เมื่อแถบเปิดอยู่ */
#tabs-container.open {
    width: 600px;
    max-width: 100vw;
    display: block;
    /* แสดงแถบเมื่อเปิด */
}

/* เลื่อนหัวของ tab เมื่อแถบเปิด */
#tabs-container.open .nav-tabs {
    margin-top: 20px;
    /* ปรับค่าตามที่ต้องการ */
}


/* กำหนดคิวเพลง */
.playlist-container {
    width: 300px;
    background-color: #333;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* กำหนดให้ข้อความในคิวเพลงมีลักษณะพิเศษ */
.playlist {
    list-style-type: none;
    padding: 0;
}

.playlist li {
    background-color: #444;
    border-radius: 5px;
    margin: 8px 0;
    padding: 12px;
    font-size: 18px;
    font-weight: normal;
    color: #fff;
    transition: background-color 0.3s;
}

/* เปลี่ยนสีของคิวเพลงเมื่อเลื่อนเมาส์ */
.playlist li:hover {
    background-color: #666;
}

/* กำหนดข้อความในส่วนที่แสดงคิวเพลง */
#playlist-container h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

#search-results {
    /* max-height และ overflow ถูกลบออกเพื่อให้แสดงผลแบบยาวลงมา */
    padding: 10px;
    /* เพิ่มระยะห่างภายใน */
    margin-top: 20px;
    /* เพิ่มระยะห่างระหว่างปุ่มค้นหากับผลลัพธ์การค้นหา */
}

#tabs-container .tab-content {
    padding: 0 18px 24px;
}

#current-track {
    margin-top: 20px;
    font-size: 16px;
}

#song-queue {
    margin-top: 20px;
}


/* ปรับแต่งแท็บด้านข้าง */
#tabs-container .nav-tabs {
    background-color: #1c1c1c;
}

#tabs-container .nav-tabs .nav-link {
    color: white;
}

#tabs-container .nav-tabs .nav-link.active {
    background-color: #343a40;
    color: white;
}

#tabs-container .nav-tabs .nav-link:hover {
    background-color: #444;
    color: white;
}

.navbar-time-container {
    display: flex;
    align-items: center;
    background-color: #333333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
}

.navbar-time-container span {
    margin-right: 5px;
    color: #333;
}

.navbar-status-container {
    display: flex;
    align-items: center;
    background-color: #333333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 5px;
    margin-left: 5px;
}

.navbar-status-container span {
    margin-right: 5px;
    color: #333;
}

.status {
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.status i {
    margin-right: 10px;
    /* เว้นระยะห่างระหว่างไอคอนและข้อความ */
}

/* ให้เมนู dropdown อยู่บนสุด */
.dropdown-menu {
    z-index: 1060;
    /* ค่า z-index ที่สูงกว่า เพื่อให้เมนูอยู่บนสุด */
}

/* ปรับการจัดการโดยรวมของแต่ละรายการวิดีโอ */
.video-item {
    display: flex;
    /* ใช้ Flexbox */
    gap: 10px;
    /* เพิ่มระยะห่างระหว่าง Thumbnail และรายละเอียด */
    background-color: #1e1e1e;
    /* เพิ่มพื้นหลังสีดำ */
    padding: 15px;
    /* เพิ่มพื้นที่ภายใน */
    border-radius: 8px;
    /* มุมโค้ง */
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
    /* เงาสำหรับเพิ่มความสวยงาม */
}

/* Drag and Drop Queue Reorder Styles */
.drag-handle {
    cursor: grab;
    user-select: none;
    touch-action: none;
    color: #888;
    transition: color 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.drag-handle:hover, .drag-handle:active {
    color: #0d6efd;
    cursor: grabbing;
    transform: scale(1.15);
}

.sortable-ghost {
    opacity: 0.4;
    background-color: #2a2a2a !important;
    border: 2px dashed #0d6efd !important;
}

.sortable-chosen {
    background-color: #2c2c2c !important;
}

/* Custom Membership SweetAlert Popup Design (Balanced Medium Size) */
.member-swal-popup {
    background: #161622 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 22px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(13, 110, 253, 0.15) !important;
    padding: 1.25rem 1.4rem !important;
    max-width: 410px !important;
}

.member-swal-popup .swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

.member-swal-popup .swal2-actions {
    margin-top: 1.1rem !important;
}

.member-avatar {
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.4);
    transition: transform 0.3s ease;
}

.member-avatar:hover {
    transform: scale(1.05);
}

/* ลบออก - ใช้ .thumbnail-container ด้านล่างแทน */

.thumbnail-img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* จำนวนการเล่นสำหรับเพลงแนะนำ - รูปแบบเดียวกับ queue-label */
.recommend-count-badge {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.95) 0%, rgba(126, 34, 206, 0.95) 100%) !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    box-shadow: 0 3px 10px rgba(147, 51, 234, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
}

.recommend-count-badge i {
    font-size: 16px;
    animation: pulse-icon 2s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

.recommend-count-badge:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 14px rgba(147, 51, 234, 0.6), 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.order-overlay {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #FFC008;
    font-size: 14px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    min-width: 28px;
}

.thumbnail-container {
    position: relative;
    width: 160px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.thumbnail-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
    transition: transform 0.3s ease;
}

.thumbnail-container:hover img {
    transform: scale(1.05);
}

/* คิวเพลงถัดไป Q1, Q2, Q3... ( Badge ขนาดเล็กกะทัดรัด ) */
.queue-label-overlay {
    position: absolute;
    top: 4px;
    left: 4px;
    background: linear-gradient(135deg, rgba(255, 192, 8, 0.95) 0%, rgba(255, 170, 0, 0.95) 100%);
    color: #1a1a1a;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.4);
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.queue-label-overlay:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(255, 192, 8, 0.5);
}

/* Overlay สีดำโปร่งแสงทับปกเพลงที่กำลังเล่น */
.playing-dark-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
    pointer-events: none;
}

/* ไอคอนกลางปกสำหรับเพลงที่กำลังเล่น */
.playing-center-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none;
}

.playing-center-overlay .play-icon {
    font-size: 32px;
    color: #ff0000;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: pulse-play 1.5s ease-in-out infinite;
}

@keyframes pulse-play {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* แถบคาด "กำลังเล่น" แบบเต็มความกว้าง */
.playing-label-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(90deg, rgba(255, 0, 0, 0.9) 0%, rgba(220, 0, 0, 0.9) 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 0;
    white-space: nowrap;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.3);
}

.playing-label-overlay i {
    font-size: 14px;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.thumbnail {
    width: 100%;
    border-radius: 8px;
    /* มุมโค้งของรูป */
}

.video-info {
    color: #fff;
    /* สีข้อความ */
}

.video-title a {
    color: #fff;
    /* สีลิงก์ */
    font-size: 1.1em;
    text-decoration: none;
    /* เอาเส้นใต้ลิงก์ออก */
}

.video-title a:hover {
    text-decoration: underline;
    /* เพิ่มเส้นใต้เมื่อ hover */
}

.channel-name,
.video-stats {
    font-size: 0.9em;
    color: #aaa;
    /* สีเทาสำหรับรายละเอียด */
}


/* เพิ่มการจัดการการแสดงผลสำหรับภาพและข้อมูลเมื่อขนาดหน้าจอเล็กลง */
@media (max-width: 768px) {
    .video-item {
        flex-direction: column;
        align-items: center;
    }

    .video-item img {
        width: 100%;
        max-width: 150px;
        /* ให้ภาพไม่ใหญ่เกินไป */
        margin-bottom: 10px;
    }

    .video-info {
        text-align: center;
    }

    /* ให้ btn-group อยู่ในแนวนอนเสมอ */
    .btn-group {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
    }
}

/* จัดตำแหน่งและสไตล์ปุ่มควบคุม */
.player-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.player-controls .control-btn {
    flex: 1 1 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #4a5568;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.player-controls .control-btn i {
    font-size: 18px;
}

.player-controls .control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.player-controls .control-btn:active {
    transform: translateY(0);
}

.player-controls .control-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.4);
}

/* ปุ่มเล่น/หยุด - น้ำเงินสดใส (เน้นเป็นปุ่มหลัก) */
#play-pause-button {
    background-color: #3b82f6;
    border-color: rgba(255, 255, 255, 0.15);
}

#play-pause-button:hover {
    background-color: #2563eb;
}

#play-pause-button:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.4);
}

/* ปุ่มอื่นๆ นอกจากปุ่มเล่น - ใช้สีเดียวกันหมด */
#play-again-button,
#next-button,
.player-controls .control-btn[onclick="increaseVolume()"],
.player-controls .control-btn[onclick="decreaseVolume()"],
#mute-button,
#toggle-score-btn,
#fullscreen-button,
#refresh-button,
#shortcut-button {
    background-color: #475569;
    border-color: rgba(255, 255, 255, 0.15);
}

#play-again-button:hover,
#next-button:hover,
.player-controls .control-btn[onclick="increaseVolume()"]:hover,
.player-controls .control-btn[onclick="decreaseVolume()"]:hover,
#mute-button:hover,
#toggle-score-btn:hover,
#fullscreen-button:hover,
#refresh-button:hover,
#shortcut-button:hover {
    background-color: #334155;
}

#play-again-button:focus,
#next-button:focus,
.player-controls .control-btn[onclick="increaseVolume()"]:focus,
.player-controls .control-btn[onclick="decreaseVolume()"]:focus,
#mute-button:focus,
#toggle-score-btn:focus,
#fullscreen-button:focus,
#refresh-button:focus,
#shortcut-button:focus {
    box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.4);
}


/* คลาส danger ใช้เพื่อเปลี่ยนสีปุ่มเป็นสีแดง (สำหรับสถานะหยุด/ปิด) */
.danger-btn {
    background-color: #dc2626 !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.danger-btn:hover {
    background-color: #991b1b !important;
}

/* คลาส success ใช้เพื่อเปลี่ยนสีปุ่มเป็นสีเขียว (สำหรับสถานะเปิด/ทำงาน) */
.success-btn {
    background-color: #16a34a !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

.success-btn:hover {
    background-color: #15803d !important;
}

/* ปรับขนาดของ SweetAlert */
.custom-popup {
    font-size: 14px;
    /* ปรับขนาดข้อความ */
    padding: 10px;
    /* ปรับขนาดช่องว่าง */
    width: 300px;
    /* กำหนดความกว้างของ SweetAlert */
    margin-right: 20px;
    /* เว้นระยะจากขอบด้านขวา */
    margin-bottom: 20px;
    /* เว้นระยะจากขอบด้านล่าง */
}

/* ปรับขนาด title */
.custom-title {
    font-size: 16px;
    /* ปรับขนาดของชื่อ */
}

/* ปรับขนาด content */
.custom-content {
    font-size: 12px;
    /* ปรับขนาดข้อความ */
}

/* ปรับขนาดของปุ่ม */
.custom-confirm-button {
    font-size: 12px;
    /* ปรับขนาดของข้อความในปุ่ม */
    padding: 6px 12px;
    /* ปรับขนาดของปุ่ม */
}

/* ปรับสีของ Toast */
.toast {
    background-color: #f8f9fa;
    /* สีพื้นหลังเป็นสีดำหรือสีเทามืด */
    color: #000;
    /* สีข้อความเป็นสีขาว */
}

/* ปรับแต่งหัวของ Toast */
.toast-header {
    background-color: #f8f9fa;
    /* สีพื้นหลังของ header เป็นสีเทาเข้ม */
    color: #000;
    /* สีข้อความใน header เป็นสีขาว */
}

/* ปรับแต่งปุ่มปิด */
.toast-header .btn-close {
    color: #fff;
    /* ปรับปุ่มปิดให้เป็นสีขาว */
}

/* ถ้าต้องการใช้สีแยกตามประเภท (success, error, etc.) */
.toast.bg-success {
    background-color: #28a745;
    /* สีเขียวสำหรับสำเร็จ */
    color: white;
}

.toast.bg-danger {
    background-color: #dc3545;
    /* สีแดงสำหรับผิดพลาด */
    color: white;
}

.queue-header {
    text-align: center;
    background-color: #333;
    padding: 10px 0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.queue-header h5 {
    margin: 0;
    font-size: 18px;
}

.text-pink {
    color: pink;
}

.btn-group {
    display: flex;
    gap: 10px;
    /* กำหนดช่องว่างระหว่างปุ่ม */
    align-items: center;
    /* จัดแนวให้ปุ่มอยู่ในแนวนอน */
}

.btn-rounded {
    border-radius: 999px;
}

/* ปุ่มต่างๆ ใช้ Bootstrap default styling */
/* ปุ่มสีชมพูสำหรับรายการโปรด */
.btn-pink {
    background-color: #ff69b4 !important;
    border-color: #ff69b4 !important;
    color: #fff !important;
}

.btn-pink:hover {
    background-color: #ff1493 !important;
    border-color: #ff1493 !important;
    color: #fff !important;
}

.btn-pink:focus,
.btn-pink:active {
    background-color: #ff1493 !important;
    border-color: #ff1493 !important;
    color: #fff !important;
}

/* ขยายคอนเทนเนอร์ในโหมด Fullscreen */
#video-player-container:fullscreen {
    width: 100vw;
    /* ครอบคลุมความกว้างหน้าจอ */
    height: 100vh;
    /* ครอบคลุมความสูงหน้าจอ */
    margin: 0;
    /* ลบ margin ทั้งหมด */
    padding: 0;
    /* ลบ padding */
    overflow: hidden;
    /* ซ่อนส่วนเกิน */
    background-color: #000;
}

/* Toast Container ใน Fullscreen Mode */
#video-player-container:fullscreen .toast-container {
    position: fixed !important;
    z-index: 2147483647 !important;
    /* Max Int32 - อยู่บนสุด */
    bottom: 20px !important;
    right: 20px !important;
    pointer-events: none;
    /* ให้คลิกทะลุพื้นที่ว่าง */
}

#video-player-container:fullscreen .toast-container>div {
    pointer-events: auto;
    /* ให้คลิกที่ตัว Toast ได้ (ถ้าต้องการ) */
}

/* SweetAlert2 ใน Fullscreen Mode */
#video-player-container:fullscreen .swal2-container {
    z-index: 2147483640 !important;
    /* Lower than Floating Messages (Max Int) */
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

#video-player-container:fullscreen .swal2-popup {
    z-index: 2147483640 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

.swal2-timer-progress-bar {
    background-color: #4CAF50 !important;
    /* เปลี่ยนสีเป็นสีเขียว */
    height: 4px !important;
    opacity: 0.8;
}

/* Current song */
.current-track-container {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #333;
    /* เปลี่ยนพื้นหลังเป็นสีเข้ม */
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.song-container {
    flex: 1;
    padding: 10px;
    background: #444;
    /* เปลี่ยนพื้นหลังของแต่ละกล่อง */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #fff;
    /* ฟอนต์สีขาว */
}

.current-song-details,
.next-song-details {
    display: flex;
    gap: 14px;
    align-items: center;
}

.current-song-details .thumbnail,
.next-song-details .thumbnail {
    width: 220px;
    height: 124px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.current-song-details .thumbnail img,
.next-song-details .thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.current-song-details .details,
.next-song-details .details {
    flex: 1;
}

.section-title {
    margin-bottom: 10px;
    font-size: 20px;
    color: #fff;
    /* ฟอนต์สีขาว */
}


.thumbnail img {
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
    max-width: 600px;
    height: 180px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.song-title {
    font-size: 22px;
    font-weight: 400;
    margin: 5px 0;
    color: #fff;
    /* ฟอนต์สีขาว */
}

/* ปรับแต่งรูปแบบของ SweetAlert2 */
.custom-popup {
    background: #f9f9f9;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 80%;
    /* กำหนดความกว้าง */
    max-width: 400px;
    /* กำหนดขนาดสูงสุด */
}

.custom-title {
    color: #007bff;
    font-size: 24px;
    font-weight: bold;
}

.custom-html-container {
    font-size: 16px;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* เปลี่ยนสีพื้นหลัง และข้อความของ Tooltip */
.custom-tooltip .tooltip-inner {
    background-color: #ff5733;
    /* สีพื้นหลัง */
    color: white;
    /* สีตัวอักษร */
    font-size: 14px;
    /* ขนาดตัวอักษร */
    font-family: 'Prompt', sans-serif;
}

/* ปรับสีลูกศร (Arrow) */
.custom-tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #ff5733 !important;
}

.custom-tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #ff5733 !important;
}

.custom-tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #ff5733 !important;
}

.custom-tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #ff5733 !important;
}

#video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transform: translateZ(0);
}

#video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 10;
}

#persistent-logo-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 80px;
    height: auto;
    z-index: 2147483647;
    /* Ensure it stays on top of everything */
    opacity: 0.7 !important;
    pointer-events: none;
    /* Let clicks pass through */
    transform: translateZ(0); /* Force layer to avoid iframe clipping */
    will-change: transform;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.8)); /* เพิ่มเงาให้เห็นชัดแม้พื้นหลังสว่าง */
}

/* Force logo visibility in fullscreen */
#video-player-container:fullscreen #persistent-logo-overlay {
    position: fixed !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 2147483647 !important;
    display: block !important;
    opacity: 0.7 !important;
}

#persistent-logo-overlay:hover {
    opacity: 1 !important;
}

#player {
    width: 100%;
    height: 100%;
    min-height: 720px;
    /* ป้องกันไม่ให้เล็กเกินไป */
}

#video-player-container {
    position: relative;
    /* สร้าง Context ให้ลูกที่ Absolute */
    width: 100%;
    /* ... existing styles ... */
}

#video-player-container:hover {
    cursor: zoom-in;
    /* เปลี่ยน cursor เป็น zoom-in เมื่อ hover */
}

.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 260px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    background-color: #1a1a1a;
}

.search-suggestions .suggestion-item {
    background-color: #1f1f1f;
    color: #fff;
    border: none;
    transition: background-color 0.15s ease;
}

.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item:focus,
.search-suggestions .suggestion-item.active {
    background-color: #2d2d2d;
    color: #fff;
}

.search-suggestions .suggestion-item.active {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(102, 16, 242, 0.2) 100%);
}

.search-suggestions .suggestion-item small {
    font-size: 0.75rem;
}

/* QR Code Container */
#qrcode-container {
    padding: 20px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#qrcode-container img {
    display: block;
    margin: 0 auto;
}

/* ปุ่มลบและค้นหาใน search input - ใช้ Bootstrap input-group แทน */

.tab-content .btn-group {
    gap: 10px;
    /* กำหนดช่องว่างระหว่างปุ่ม */
    align-items: center;
    /* จัดแนวให้ปุ่มอยู่ในแนวนอน */
}

.progress-container {
    background-color: #1f1f1f;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.progress-container .text-muted {
    color: #cfd2d8 !important;
    font-weight: 500;
}

#elapsed-time,
#total-duration {
    color: #cfd2d8;
    font-weight: 500;
}

.playback-progress {
    background-color: #333;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
}

.playback-progress .progress-bar {
    background: linear-gradient(90deg, #ff5f6d 0%, #ffc371 100%);
}

/* ปรับสำหรับหน้าจอขนาดเล็กลง */
@media (max-width: 992px) {
    #toggle-tab-button {
        bottom: 20px;
        right: 20px !important;
        /* ใช้ !important เพื่อให้แน่ใจว่าไม่ถูก override โดย tabs-open */
        top: auto;
        transform: none;
    }

    /* ปิดการใช้งาน tabs-open class บนหน้าจอเล็ก */
    #toggle-tab-button.tabs-open {
        right: 20px !important;
    }

    #tabs-container {
        height: 100vh;
        padding: 20px 15px 60px;
    }

    .player-controls .control-btn {
        flex: 1 1 calc(50% - 12px);
        min-width: 140px;
    }

    #player {
        min-height: 420px;
    }

    .current-track-container {
        flex-direction: column;
        gap: 15px;
    }

    .song-container {
        width: 100%;
    }

    .thumbnail img {
        height: auto;
        max-height: 220px;
    }

    .current-song-details,
    .next-song-details {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .current-song-details .thumbnail,
    .next-song-details .thumbnail {
        width: 100%;
        max-width: 320px;
        height: 180px;
    }

    .current-song-details .details,
    .next-song-details .details {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .player-controls .control-btn {
        flex: 1 1 100%;
        min-width: 0;
    }

    #player {
        min-height: 260px;
    }

    #tabs-container {
        padding: 15px 10px 60px;
    }

    #tabs-container .nav-tabs {
        flex-wrap: wrap;
    }

    #tabs-container .nav-tabs .nav-link {
        width: 100%;
        text-align: center;
    }

    .current-song-details .thumbnail,
    .next-song-details .thumbnail {
        height: 160px;
    }

    /* ซ่อนข้อความในปุ่ม แสดงเฉพาะไอคอน */
    .add-to-queue-btn,
    .add-to-fav-btn,
    .delete-btn,
    .delete-fav-song-btn,
    .fastqueue-btn {
        font-size: 0;
        padding: 0.375rem 0.75rem;
    }

    .add-to-queue-btn i,
    .add-to-fav-btn i,
    .delete-btn i,
    .delete-fav-song-btn i,
    .fastqueue-btn i {
        font-size: 1.125rem;
    }
}

/* Fullscreen Controls Overlay */
#fullscreen-controls-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2147483640;
    /* Lower than Toast/SweetAlert but high enough */
    display: none;
    /* Hidden by default */
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    /* Let clicks pass through to video when controls are hidden/transparent */
    transition: opacity 0.3s ease;
    opacity: 0;
}

#video-player-container:fullscreen #fullscreen-controls-overlay {
    display: flex;
}

#video-player-container:fullscreen.show-controls #fullscreen-controls-overlay {
    opacity: 1;
    pointer-events: auto;
    /* Enable clicks on controls */
}

/* Gradients backgrounds */
.fs-controls-top {
    padding: 20px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
}

.fs-controls-bottom {
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
}

.fs-controls-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text Styles */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.fs-time {
    font-size: 14px;
    color: #ddd;
    text-shadow: 1px 1px 2px black;
    min-width: 45px;
    text-align: center;
}

/* Buttons */
.fs-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    padding: 5px 10px;
    filter: drop-shadow(0px 0px 3px rgba(0, 0, 0, 0.8));
}

.fs-btn:hover {
    transform: scale(1.1);
    color: #3b82f6;
}

.fs-btn:active {
    transform: scale(0.95);
}

/* Progress Bar */
.fs-progress-bar-bg {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
}

/* Volume Slider */
.fs-volume-slider {
    width: 100px;
    cursor: pointer;
}

/* Hide center play button if controls are fading out, or maybe keep it? 
   Let's keep simple: opacity 0 on overlay hides everything. 
*/

/* Normal Player Overlay (Non-Fullscreen) */
#normal-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 15;
    /* Above video-overlay (10) */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Let clicks pass through to container (enter fullscreen) */
    background: rgba(0, 0, 0, 0.1);
}

#video-player-container.show-controls #normal-player-overlay {
    opacity: 1;
}

#normal-player-overlay .overlay-top {
    height: 40px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 100%);
}

#normal-player-overlay .overlay-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

#normal-player-overlay .overlay-bottom {
    /* Styles are mostly inlined in HTML for this specific request or handled here */
    pointer-events: auto;
    /* Enable clicking controls */
}

#normal-play-btn {
    pointer-events: auto;
    /* Enable clicking button */
}

/* Hide normal overlay when in fullscreen */
#video-player-container:fullscreen #normal-player-overlay {
    display: none !important;
}