:root {
    --primary-color: #E85E2A;
    --text-light: #FFF;
    --bg-dark-1: #181818;
    --bg-dark-2: #333;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Ngăn cuộn trang ngoài ý muốn */
    font-family: Arial, sans-serif;
    background-color: transparent
}
#dmain {
    height: 100%;
}
/* 1. Thiết kế Mobile-First (Full màn hình) */
.video-swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
}

.swiper-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover; 
}

/* 2. Lớp phủ thông tin và nút bấm (Giữ nguyên) */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    box-sizing: border-box;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 40%);
}
.video-info {padding-right:28px}
.video-info h3 {margin:0 0 8px 0}
.video-info p {margin:3 0 5px 0;font-size:14px;color:#AAA}
.video-info small {font-size:13px;opacity: 0.9}
.video-controls {
    position: absolute;
    bottom: 20px;
    right: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.control-btn {
    background: transparent;
    border: none;
    color: #FFF;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    gap: 2px
}
.control-btn span { font-size:12px; margin-top:0;font-weight:bold}
.control-btn span:hover {background:rgba(255, 255, 255, 0.3)}

svg.ic {
    display: inline-block;
    vertical-align: middle;
    width: 23px;
    height: 23px;
    fill: #fff;
}
.ico-btn {
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}
#mobile-mute-btn .ico-btn {
    width: 100%;
    height: 100%;
}
.control-btn .ico-btn .ic {
    width: 24px;
    height: 24px;
    fill: #fff; 
}

.btn-like .ico-btn .ic,
.btn-share .ico-btn .ic,
.btn-comment .ico-btn .ic {
    width: 28px;
    height: 28px;
}

.play-pause-icon .ico-btn {
    width: 60px; /* Lớn hơn */
    height: 60px;
}
.play-pause-icon .ico-btn .ic {
    width: 30px; /* Icon bên trong */
    height: 30px;
    fill: rgba(255, 255, 255, 0.8);
}
/* 6. Kiểu khi Like (active) */
.control-btn.btn-like.active .ico-btn .ic {
    fill: #fd0404; /* Màu đỏ */
}
/* 7. Hiệu ứng tim đập */
.animation-heart-buzz .ico-btn {
    -webkit-animation-duration: .45s;
    animation-duration: .45s;
    -webkit-animation-name: heart-buzz;
    animation-name: heart-buzz;
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1)
}
@keyframes heart-buzz {
    0% { transform: scale(1) }
    25% { transform: scale(1.2) }
    50% { transform: scale(0.95) }
    100% { transform: scale(1) }
}
@-webkit-keyframes heart-buzz {
    0% { -webkit-transform: scale(1) }
    25% { -webkit-transform: scale(1.2) }
    50% { -webkit-transform: scale(0.95) }
    100% { -webkit-transform: scale(1) }
}

.play-pause-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.5);
    font-size: 50px;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease-out;
}
.play-pause-icon.show { opacity: 1; transform: translate(-50%, -50%) scale(1)}

#dhead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001; /* Luôn ở trên video */
}

#dhead nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    /* Gradient mờ ở trên cùng */
    background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 100%)
}

#dhead .logo a {
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    height: 36px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 0 10px
}

#dhead .logo a img {height: 26px;width: auto;max-width: 150px}
#dhead nav .nav-controls {display: flex;align-items: center;gap: 10px}
#mobile-mute-btn {
    display: flex;
    position: static;
    width: 36px;
    height: 36px;
    padding: 0;
    font-size: 16px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent; /* Tắt hiệu ứng vuông */
    transition: background-color 0.2s ease;
    background: hsla(0, 0%, 100%, .6); /* Nền trắng mờ */
}
#mobile-mute-btn .ic { 
    width: 20px; 
    height: 20px; 
    fill: #222; /* Icon đen */
}

/* (MỚI) Trạng thái Unmute (Bật tiếng) */
#mobile-mute-btn:not(.is-muted) {
    background: rgba(0, 0, 0, 0.2); /* Nền đen mờ */
}
#mobile-mute-btn:not(.is-muted) .ic {
    fill: #fff; /* Icon trắng */
}

.btn-mute {display: none}

#dhead button[data-toggle="collapse"] {
    display: flex; /* (Đã có) */
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    padding: 0;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
}

#dhead button[data-toggle="collapse"] .ic {
    width: 20px;
    height: 20px;
    fill: #FFF;
}
#dhead button[data-toggle="collapse"].is-active .ic {
    fill: #f39c12; /* Màu cam */
}

#close-menu-btn {
    position: absolute;
    top: 10px; /* Giống padding của nav */
    right: 15px; /* Giống padding của nav */
    z-index: 10000; /* Trên cả menu .pal */
    
    /* Style giống các nút khác */
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
#close-menu-btn .ic {
    width: 20px;
    height: 20px;
    fill: #fff;
    /* Dùng stroke (viền) thay vì fill (nền) cho icon X */
    fill: none;
    stroke: #fff;
    stroke-width: 2px;
}

/* Menu overlay (ẩn mặc định, dịch chuyển xuống dưới) */
.navbar-collapse {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    background: rgba(0, 0, 0, 0.6); /* Nền mờ hơn */
    z-index: 9998; /* Dưới header, trên video */
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0;
    transform: translateY(100%);
    pointer-events: none;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* JS sẽ thêm class .show khi click */
.navbar-collapse.show {
    opacity: 1; /* 1. Hiện ra */
    transform: translateY(0); /* 2. Chạy về vị trí 0 (ở trên) */
    pointer-events: auto; /* 3. Cho phép click */
}

/* Căn giữa các mục menu (giống ảnh mobile) */
.navbar-collapse .pal {
    display: flex;
    flex-direction: column;
    justify-content: center;
    /*height: 100%;*/
    max-width: 480px;
    margin: 0 auto
}

.navbar-collapse .pal h3 {
    color: #fff;
    text-align: left;
    margin-bottom: 10px;
    text-transform: uppercase;
    font-size: 16px;
    padding-left: 15px
}

.navbar-collapse .pal span {
    display: block;
    color: #AAA; /* Màu nhạt hơn h3 */
    font-size: 14px;
    padding-left: 15px; /* Giống h3 */
    margin-bottom: 15px;
}

.navbar-collapse .pal ul {
    list-style: none;
    padding: 0;
    margin: 0
}

/* Các nút menu (giống ảnh mobile) */
.navbar-collapse .pal li a {
    display: flex;
    align-items: center;
    background: #282828;
    color: #fff;
    text-decoration: none;
    padding: 10px 25px;
    margin-bottom: 12px;
    border-radius: 50px;
    font-weight: bold;
    font-size: 14px
}

.navbar-collapse .pal li a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    font-size: 18px
}

.navbar-collapse .pal li.act a {background:var(--primary-color)}

.video-controls, .video-overlay .video-info, #dhead {
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: auto
}

.video-swiper.video-is-playing .swiper-button-prev,
.video-swiper.video-is-playing .swiper-button-next,
.video-swiper.video-is-playing .video-controls,
.video-swiper.video-is-playing .video-overlay .video-info,
.video-swiper.video-is-playing #dhead {
    opacity: 0;
    pointer-events: none
}

.video-progress-bar {
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    z-index: 10;
    transition: height 0.2s ease
}
.progress-filled {
    height: 100%;
    width: 0%;
    background-color: var(--primary-color); /* Màu đỏ cam */
    transition: width 0.1s linear; /* Hiệu ứng mượt khi cập nhật */
    position: relative
}
.progress-handle {
    position: absolute;
    top: 50%;
    right: 0; /* Nằm ở mép phải (cuối) của .progress-filled */
    transform: translate(50%, -50%); /* Căn giữa handle trên mép */
    
    width: 14px;  /* Kích thước 14x14 */
    height: 14px;
    background-color: var(--primary-color); /* Màu cam */
    border: 2px solid #FFF; /* Viền trắng cho nổi bật */
    border-radius: 50%;
    
    z-index: 11; /* Nổi trên thanh */
    cursor: pointer; /* Đổi con trỏ */
    box-sizing: border-box;
    transition: transform 0.2s ease
}
.progress-filled[style*="width: 0%"] .progress-handle {display:none}

.video-progress-bar.is-seeking .progress-handle {transform:translate(50%, -50%) scale(1.5)}
.swiper-slide:hover .video-progress-bar {height:10px}
.swiper-button-prev,.swiper-button-next {display:none !important}
.video-swiper.video-is-playing .swiper-button-prev,.video-swiper.video-is-playing .swiper-button-next {display:none !important}

#comment-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5); /* Nền mờ */
    z-index: 1999; /* Dưới modal, trên mọi thứ khác */
    
    /* Cho phép cuộn nếu nội dung cao */
    overflow-y: auto; 
    
    /* Dùng flex để căn giữa modal */
    display: flex;
    align-items: flex-end; /* Căn xuống dưới cho mobile */
    justify-content: center;

    /* Thêm hiệu ứng blur (nếu muốn) */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);

    /* Ẩn mặc định */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease-out;
}

#comment-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

#comment-modal {
    /* Bỏ position: fixed và z-index (đã có ở overlay) */
    width: 100%; /* Chiếm 100% chiều rộng của overlay (trên mobile) */
    height: 60vh; 
    background: #181818;
    color: #fff;
    
    display: flex;
    flex-direction: column;
    
    box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
    border-radius: 15px 15px 0 0;
    
    /* Giữ nguyên hiệu ứng trượt lên */
    transform: translateY(100%);
    transition: transform 0.3s ease-out
}

#comment-overlay.show #comment-modal {
    transform: translateY(0);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--bg-dark-2);
}
.comment-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
}
.comment-header .close-comment-btn .ico-btn {
    width: 30px;
    height: 30px;
    background: var(--bg-dark-2);
}
.comment-header .close-comment-btn .ic {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #fff;
    stroke-width: 2px
}
.comment-list {flex-grow: 1;overflow-y: auto;padding: 15px}
.comment-list>p{text-align:center;color:#888;margin-top:50px}
.comment-item {margin-bottom: 15px}
.comment-item strong {
    display: block;
    font-size: 13px;
    color: #AAA;
    margin-bottom: 3px
}
.comment-item p {
    margin: 0;
    font-size: 15px;
    color: #FFF;
    line-height: 1.4
}

.comment-form {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
    border-top: 1px solid var(--bg-dark-2);
    background: var(--bg-dark-1);
    gap: 10px
}

.comment-user-info {display: flex;gap: 10px}
.comment-user-info .comment-input {flex-basis: 50%;width: 50%}
.comment-content-row {display: flex;gap: 10px}

.comment-input {
    flex-grow: 1;
    background: var(--bg-dark-2);
    border: 1px solid #444;
    border-radius: 20px;
    padding: 8px 15px;
    color: #fff;
    font-size: 15px;
    outline: none;
    box-sizing: border-box
}
.comment-input::placeholder {color: #888}
.comment-submit-btn {background: none;border: none;padding: 0;cursor: pointer;flex-shrink:0};
.comment-submit-btn .ic {width: 24px;height: 24px;fill: var(--primary-color);transform: rotate(-45deg)}


@media (min-width: 768px) {
    #dmain {
        max-width: 1400px;
        margin: 0 auto;
        height: 100vh;
        position: relative; /* Làm gốc cho menu */
        padding-left: 280px; 
        box-sizing: border-box;
        background: #062340;
        width: 915px;
        display: flow-root
    }

    #dhead {
        position: absolute; 
        top: 0;
        left: 0;
        bottom: 0; 
        width: 280px;
        background: #062340;
        padding: 20px;
        box-sizing: border-box;
        z-index: 10;
        overflow-y: auto; 
        border-right: 1px solid #222
    }
    
    #dhead nav {display: block;padding: 0;background: none}
    #dhead .logo {margin-bottom: 30px}
    #close-menu-btn,#dhead button[data-toggle="collapse"] {display: none}
    
    .navbar-collapse {
        display: block !important; 
        position: static; 
        background: none;
        padding: 0;
        height: auto;
        width: auto;
        opacity: 1; 
        transform: none; 
        pointer-events: auto
    }
    
    .navbar-collapse .pal {display: block;height: auto}
    .navbar-collapse .pal h3 {color: #888;text-transform: uppercase;font-size: 13px;padding-left: 10px}
    
    .navbar-collapse .pal li a {
        background: none;
        color: #ccc;
        padding: 12px 10px;
        border-radius: 8px;
        margin-bottom: 4px;
        font-size: 14px;
        font-weight: normal
    }
    
    .navbar-collapse .pal li a:hover {background:#222;color:#FFF}
    .navbar-collapse .pal li.act a:hover {background:#EA5823;color:#FFF}
    .video-swiper {max-height: 85vh;max-width: 540px;aspect-ratio: 9 / 16;width: auto;height: auto;margin: 5vh 0 0 50px}
    #mobile-mute-btn {display: none}
    .btn-mute {
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 20px;
        left: 20px;
        right: auto;
        bottom: auto;        
        border-radius: 50%;
        -webkit-tap-highlight-color: transparent; 
        transition: background-color 0.2s ease;
        background: hsla(0, 0%, 100%, .6); /* Nền trắng mờ */
    }
    .btn-mute .ic {width: 20px;height: 20px;fill: #222}
    .btn-mute:not(.is-muted) {background: rgba(0, 0, 0, 0.2)}
    .btn-mute:not(.is-muted) .ic {fill: #FFF}
    .video-swiper:hover .swiper-button-prev, .video-swiper:hover .swiper-button-next {display: none !important}
    .ico-btn {width:40px;height:40px}

    #comment-overlay {align-items:center}
    #comment-modal {
        width: 500px; /* Chiều rộng cố định trên desktop */
        height: 70vh; /* Có thể cao hơn một chút */
        border-radius: 15px; /* Bo tròn tất cả các góc */
        box-shadow: 0 5px 20px rgba(0,0,0,0.4);
        
        /* Điều chỉnh transform cho căn giữa */
        transform: scale(0.9) translateY(100vh);
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    
    #comment-overlay.show #comment-modal {transform: scale(1) translateY(0)}
}