/* =========================================
   MOVIE DETAIL REDESIGN STYLES
   ========================================= */

:root {
    --toolbar-bg: rgba(20, 20, 30, 0.95);
    --switch-on: #4db8ff;
    --switch-off: #333;
    --section-gap: 25px; /* Khoảng cách thống nhất giữa các phần */
}

.movie-detail-redesign {
    display: none; /* Mặc định ẩn để không đè lên trang chủ */
    flex-direction: column;
    gap: 0;
    background: var(--bg-primary);
    min-height: 100vh;
    padding-top: 110px !important; /* Đẩy xuống thêm để hiện rõ tiêu đề phim */
    margin-top: 0 !important;
}

/* CHỈ HIỂN THỊ KHI ĐƯỢC KÍCH HOẠT (SPA) */
.movie-detail-redesign.active {
    display: flex !important;
}

/* Ép nền body màu đen khi bật rạp phim để lấp hoàn toàn khung hở */
body.cinema-mode {
    background: #000 !important;
}

/* Xóa padding khi ở chế độ rạp phim để 100vh không bị đẩy xuống */
body.cinema-mode .movie-detail-redesign,
[data-theme="light"] body.cinema-mode .movie-detail-redesign {
    padding-top: 0 !important;
    background: #000 !important; /* Đen tuyệt đối cho rạp phim */
}

/* --- TOP BAR --- */
.detail-top-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 20px; /* Thu hẹp thanh tiêu đề */
    background: rgba(0,0,0,0.5); /* Nền tối nhẹ để nổi bật trên mọi background */
    position: relative;
    z-index: 100;
}

.btn-back-square {
    width: 35px;
    height: 35px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-back-square:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

.detail-page-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- PLAYER AREA --- */
.player-section {
    position: relative;
    width: 100%;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; /* Cho phép floating reaction bay ra ngoài nếu cần */
    min-height: 200px;
}

.video-container {
    width: 85%; /* Giảm kích thước khung video trên PC */
    margin: 0 auto; /* Căn giữa */
    aspect-ratio: 16/9;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* Khi chế độ Reaction ON -> Co khung video lại thêm một chút để nhường chỗ cho sidebar */
.player-section.reaction-active .video-container {
    width: 80%;
}

@media (max-width: 1200px) {
    .video-container {
        width: 92%;
    }
    .player-section.reaction-active .video-container {
        width: 88%;
    }
}

@media (max-width: 768px) {
    .video-container {
        width: 100%;
        border-radius: 0;
    }
    .player-section.reaction-active .video-container {
        width: 90%; /* Vẫn co lại để hiện reaction trên mobile */
    }
}

@media (max-width: 768px) {
    .player-section {
        height: auto;
        min-height: auto;
    }
}

/* --- REACTION SIDEBAR --- */
.reaction-sidebar {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(15px);
    padding: 12px 8px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.15);
    z-index: 200; /* Đảm bảo nằm trên mọi lớp của video-container */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.reaction-sidebar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(50px, -50%);
}

.reaction-btn {
    font-size: 24px;
    cursor: pointer;
    transition: transform 0.2s;
    user-select: none;
    padding: 5px;
    display: inline-block;
}

.reaction-btn:hover {
    transform: scale(1.3);
}

/* --- BOTTOM TOOLBAR --- */
.detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    flex-wrap: wrap;
    gap: 15px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* OVERRIDE LIGHT THEME CHO TOOLBAR DƯỚI VIDEO */
[data-theme="light"] .detail-toolbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .btn-toolbar {
    color: var(--text-muted);
}

[data-theme="light"] .btn-toolbar:hover {
    color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

[data-theme="light"] .btn-toolbar.active {
    color: var(--error);
}

[data-theme="light"] .switch-item {
    color: var(--text-muted);
}

[data-theme="light"] .badge-switch {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-toolbar {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px 10px;
}

.btn-toolbar:hover {
    color: #fff;
}

.btn-toolbar i {
    font-size: 16px;
}

.btn-toolbar.active {
    color: var(--error);
}

/* Switches */
.switch-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.badge-switch {
    background: #222;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
}

.badge-switch.on {
    color: var(--accent-primary);
    background: rgba(77, 184, 255, 0.1);
}

.badge-switch.off {
    color: #888;
}

/* --- FLOATING REACTIONS --- */
.floating-reaction {
    position: absolute;
    font-size: 24px;
    z-index: 9999;
    pointer-events: none;
    animation: floatingUp 3s ease-out forwards;
}

@keyframes floatingUp {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        transform: translateY(-200px) scale(1);
        opacity: 0;
    }
}

/* --- ALBUM MODAL & ITEMS --- */
.album-item:hover {
    background: rgba(255,255,255,0.1) !important;
}

.album-item i.fas.fa-check-circle {
    animation: scaleIn 0.3s ease-out;
}

@keyframes scaleIn {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* --- CINEMA MODE --- */
body.cinema-mode #navbar,
body.cinema-mode footer {
    opacity: 0 !important; /* Ẩn hoàn toàn để không gây xao nhãng */
    pointer-events: none;
    transition: opacity 0.5s;
}

/* Ẩn các phần gây xao nhãng trong chế độ Rạp phim */
body.cinema-mode .movie-info-redesign,
body.cinema-mode .episodes-section,
body.cinema-mode .comments-section,
    body.cinema-mode #versionContainer,
    body.cinema-mode #recommendedMoviesContainer,
    body.cinema-mode .reaction-sidebar,
    body.cinema-mode .detail-main-grid {
        display: none !important;
    }

body.cinema-mode .detail-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10002;
    opacity: 0 !important; /* Mặc định ẩn trong rạp phim */
    pointer-events: none !important;
    background: linear-gradient(to bottom, rgba(0,0,0,0.95), transparent) !important;
    display: flex !important;
    transition: all 0.5s ease-in-out !important; /* Hiệu ứng mượt mà */
}

body.cinema-mode .detail-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0 !important; /* Mặc định ẩn trong rạp phim */
    pointer-events: none !important;
    z-index: 10001;
    background: rgba(15, 15, 25, 0.98);
    border-top: 1px solid rgba(255,255,255,0.1);
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 25px;
    transition: all 0.5s ease-in-out !important; /* Hiệu ứng mượt mà */
}

body.cinema-mode .player-section,
[data-theme="light"] body.cinema-mode .player-section {
    height: calc(100vh - 120px); /* Dành khoảng trống 50px top + 70px bottom toolbar */
    max-height: none;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 0; /* Giảm padding để video to hơn */
    margin-top: 50px; /* Đẩy xuống để không bị thanh top bar che khi hiện */
    background: #000 !important;
}

body.cinema-mode .video-container {
    height: auto !important;
    width: auto !important;
    max-width: 93% !important; /* Tăng từ 85% lên 93% theo yêu cầu */
    max-height: 93% !important; /* Tăng từ 85% lên 93% theo yêu cầu */
    aspect-ratio: 16 / 9;
    border-radius: 0 !important; /* Reset cho rạp phim */
    box-shadow: none !important; /* Reset cho rạp phim */
}

body.cinema-mode #videoPlayer,
body.cinema-mode #html5Player {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

/* Hiện lại khi có class .controls-visible (do JS điều khiển) */
body.cinema-mode.controls-visible .detail-top-bar,
body.cinema-mode.controls-visible .detail-toolbar {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    :root {
        --section-gap: 15px; /* Giảm gap triệt để cho Tablet và Mobile */
    }
    .detail-toolbar {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .toolbar-group {
        width: 100%;
        justify-content: space-around;
        flex-wrap: wrap;
    }
    .detail-page-title {
        font-size: 0.9rem;
    }
    .reaction-sidebar {
        right: 10px;
        padding: 5px;
        gap: 5px;
    }
    .reaction-btn {
        font-size: 16px;
    }
}

/* --- MY ALBUMS VIEW --- */
.my-album-card {
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.05);
}

.my-album-card:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.1) !important;
    border-color: var(--accent-primary) !important;
}

.my-album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s;
}

.my-album-card:hover img {
    transform: scale(1.1);
}

.album-movie-item:hover {
    transform: scale(1.05);
}

.album-movie-item img {
    transition: 0.3s;
}

.album-movie-item:hover img {
    box-shadow: 0 0 15px var(--accent-primary);
}

/* --- BACK BUTTON ALBUM --- */
.btn-back-album {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: 0.3s;
}

.btn-back-album:hover {
    background: var(--accent-primary);
    color: #000 !important;
    transform: translateX(-3px);
}

.btn-back-album i {
    font-size: 14px;
}
/* --- MOVIE INFO REDESIGN SECTION --- */
.movie-info-redesign {
    margin-top: var(--section-gap); /* Thống nhất khoảng cách */
    margin-bottom: 0;
    padding: 0 40px; /* Thụt toàn bộ phần này vào 2 bên */
    animation: fadeInUp 0.5s ease;
}

.info-layout {
    display: grid;
    grid-template-columns: 100px 1fr 280px; /* Poster, Info, Actors */
    gap: 30px; 
    align-items: start;
}

.info-poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

.info-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-price-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
    color: #fff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.info-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.info-title {
    font-size: 1.7rem; /* Giảm cỡ chữ lại cho phù hợp poster nhỏ */
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.meta-item {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-item.year {
    background: rgba(255,255,255,0.1);
    padding: 2px 10px;
    border-radius: 4px;
}

.info-categories {
    font-size: 15px;
    color: var(--accent-primary);
    font-weight: 500;
}

.info-description-box {
    background: rgba(255,255,255,0.03);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
}

.info-description-short {
    font-size: 14.5px;
    line-height: 1.6;
    color: #ccc;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* OVERRIDE LIGHT THEME CHO PHẦN THÔNG TIN PHIM */
[data-theme="light"] .info-title {
    background: none;
    -webkit-text-fill-color: initial;
    color: var(--text-primary);
}

[data-theme="light"] .info-description-short {
    color: var(--text-secondary);
}

[data-theme="light"] .info-description-box {
    background: rgba(0, 0, 0, 0.03);
    border-color: var(--border-color);
}

[data-theme="light"] .meta-item.year {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

.info-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}

.info-link:hover {
    gap: 10px;
    filter: brightness(1.2);
}

/* Payment Action */
.info-payment-action {
    margin-top: 10px;
    animation: fadeIn 0.5s ease;
}

.btn-buy-ticket {
    background: linear-gradient(135deg, #E50914 0%, #ff4b2b 100%);
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 20px rgba(229, 9, 20, 0.3);
}

.btn-buy-ticket:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(229, 9, 20, 0.5);
    filter: brightness(1.1);
}

.payment-hint {
    font-size: 12px;
    color: #888;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- UNIFIED MOVIE CONTROLS ROW --- */
.movie-extra-controls-inner {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 18px;
    gap: 15px;
}

.part-selector-dropdown {
    position: relative;
    user-select: none;
}

.part-selector-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.part-selector-trigger i.fa-bars {
    color: var(--accent-primary);
    font-size: 1.1rem;
}

.part-selector-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
}

.part-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    min-width: 180px;
    z-index: 1000;
    display: none;
    flex-direction: column;
    padding: 8px 0;
    overflow: hidden;
    animation: fadeInDown 0.3s ease;
}

.part-dropdown-menu.active {
    display: flex;
}

.part-dropdown-item {
    padding: 10px 18px;
    color: #ccc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.part-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.part-dropdown-item.active {
    background: var(--accent-primary);
    color: #fff;
}

.divider-vertical {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
}

.version-list-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.version-btn-modern {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #aaa;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.version-btn-modern:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
}

.version-btn-modern.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: #fff;
    color: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.version-btn-modern i {
    font-size: 14px;
    opacity: 0.7;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#movieExtraControlsRow,
#recommendedMoviesContainer {
    margin-top: 10px !important; /* Thu hẹp tối đa khoảng cách phía trên */
    padding: 0 40px !important;
}

#episodesSectionWrapper {
    margin-top: 5px !important; /* Khoảng cách tối thiểu */
}


/* --- DETAIL MAIN GRID (Episodes + Comments) --- */
.detail-main-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 0 40px;
    margin-top: 20px; /* Giảm khoảng cách phía trên */
}

.detail-main-col {
    width: 100%;
}

/* --- ACTOR SIDEBAR (Now in info-layout) --- */
.detail-sidebar-col {
    display: none; /* Element removed from HTML, hiding just in case */
}

.detail-actor-sidebar {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 12px;
}

.sidebar-title i {
    color: var(--accent-primary);
    font-size: 14px;
}

.sidebar-actor-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sidebar-actor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
}

.sidebar-actor-item:hover {
    transform: translateY(-3px);
}

.sidebar-actor-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-actor-item:hover img {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.3);
}

.sidebar-actor-name {
    font-size: 0.72rem;
    color: var(--text-secondary, #aaa);
    text-align: center;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.sidebar-actor-item:hover .sidebar-actor-name {
    color: #fff;
}

/* Light theme cho sidebar */
[data-theme="light"] .detail-actor-sidebar {
    background: rgba(0, 0, 0, 0.02);
    border-color: var(--border-color);
}

[data-theme="light"] .sidebar-title {
    border-bottom-color: var(--border-color);
}

[data-theme="light"] .sidebar-actor-item img {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .sidebar-actor-item:hover .sidebar-actor-name {
    color: var(--text-primary);
}

/* --- COMMENTS SECTION OVERRIDE --- */
.comments-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
}

/* --- EPISODES LIST REDESIGN --- */
#episodesSection {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    padding: 15px 30px !important; /* Giảm padding thêm nữa */
    border-radius: 10px !important; 
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.episodes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.episode-item {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.episode-item:hover {
    background: #252545;
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.episode-item.active {
    background: linear-gradient(135deg, #ff0080, #ff8c00);
    border: none;
    box-shadow: 0 0 20px rgba(255, 0, 128, 0.4);
}

.episode-item.active .ep-number,
.episode-item.active .ep-label {
    color: #fff;
}

.ep-number {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.ep-label {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .info-layout {
        grid-template-columns: 180px 1fr;
        gap: 20px;
    }
    .info-title {
        font-size: 1.8rem;
    }
    /* Fix vỡ layout diễn viên khi xoay ngang mobile */
    .detail-actor-sidebar {
        grid-column: 1 / -1; /* Chiếm full chiều rộng hàng mới */
        width: 100%;
        margin-top: 15px;
    }
    .sidebar-actor-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        justify-items: center;
    }
}

@media (max-width: 768px) {
    .movie-detail-redesign {
        padding-top: 70px !important; /* Khớp với chiều cao navbar mobile */
    }

    .movie-info-redesign,
    .detail-main-grid,
    #versionContainer,
    #episodesSectionWrapper,
    #recommendedMoviesContainer {
        padding: 0 15px !important;
        margin-top: 10px !important; /* Thu hẹp thêm trên mobile */
    }

    .episodes-section {
        padding: 20px !important;
        border-radius: 10px !important;
    }


    .info-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .info-poster-wrapper {
        max-width: 130px; /* Giảm thêm kích thước poster cho phù hợp mobile */
        margin: 0 auto;
    }
    .info-content-wrapper {
        text-align: center;
        align-items: center;
        width: 100%; /* Đảm bảo chiếm hết chiều rộng đã trừ padding */
    }
    .info-meta {
        justify-content: center;
    }
    
    .info-title {
        font-size: 1.5rem; /* Thu nhỏ tiêu đề trên mobile */
    }

    .info-description-box {
        padding: 15px; /* Giảm padding box mô tả */
        width: 100%;
    }
    
    /* Actor sidebar on mobile */
    .detail-actor-sidebar {
        margin-top: 10px;
        width: 100%;
    }
    .sidebar-actor-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); /* Linh hoạt hơn để tự căn giữa */
        justify-items: center;
    }
    .sidebar-actor-item img {
        width: 50px;
        height: 50px;
    }

    .episodes-list {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
