/* File: assets/rophim-style.css */
@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;700&display=swap');

body {
    font-family: 'Be Vietnam Pro', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-base);
    margin: 0;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.main-header {
    background-color: var(--top-bg-default);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}
.main-header .container {
    display: flex;
    align-items: center;
}
.logo {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    margin-right: 40px;
}
.main-nav {
    display: flex;
    gap: 25px;
}
.main-nav a {
    text-decoration: none;
    color: var(--text-base);
    font-weight: 500;
    transition: color 0.2s;
}
.main-nav a:hover {
    color: var(--primary-text);
}
.header-actions {
    margin-left: auto;
}
.search-box {
    position: relative;
}
.search-box input {
    background-color: var(--bg-2);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 15px 8px 35px;
    color: #fff;
    width: 250px;
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-base);
}

/* --- Hero Slider --- */
.hero-slider {
    width: 100%;
    height: 400px;
}
.swiper, .swiper-wrapper, .swiper-slide {
    width: 100%;
    height: 100%;
}
.swiper-slide {
    position: relative;
    color: #fff;
    display: flex;
    align-items: flex-end;
}
.slide-link {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
}
.slide-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
}
.slide-bg::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 10%, transparent 50%);
}
.slide-content {
    position: relative;
    z-index: 2;
    padding-bottom: 60px;
}
.slide-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}
.slide-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    opacity: 0.8;
}
.slide-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    z-index: 2;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--primary-button-text);
}
.btn-primary:hover {
    background-color: var(--primary-color-hover);
}

/* --- Content --- */
.content-wrapper { padding: 40px 20px; }
.cards-row { margin-bottom: 40px; }
.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.category-name {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
}
.cat-more {
    color: var(--text-base);
    text-decoration: none;
}
.row-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* --- Poster Card --- */
.video-card-poster a {
    text-decoration: none;
}
.card-thumbnail {
    position: relative;
    aspect-ratio: 16 / 9;
    background-color: var(--bg-2);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
}
.video-card-poster:hover .card-thumbnail {
    transform: scale(1.05);
}
.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 50px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}
.video-card-poster:hover .play-icon {
    opacity: 0.8;
}
.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 4px;
}
.card-title {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-card-poster:hover .card-title {
    color: var(--primary-text);
}

/* --- Footer --- */
.main-footer {
    background-color: var(--footer-bg);
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
/* --- CSS CHO FOOTER MỚI --- */
.multi-column-footer {
    background-color: var(--footer-bg);
    padding: 50px 0 20px 0;
    color: var(--text-base);
    border-top: 1px solid var(--border-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.footer-col-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 15px;
}
.footer-col p {
    line-height: 1.7;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul a {
    text-decoration: none;
    color: var(--text-base);
    transition: color 0.2s;
}
.footer-col ul a:hover {
    color: var(--primary-text);
}
.social-links {
    display: flex;
    gap: 15px;
}
.social-links a {
    font-size: 20px;
    color: var(--text-base);
    transition: color 0.2s;
}
.social-links a:hover {
    color: var(--primary-text);
}
.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
}
/* --- CSS CHO TRANG VIDEO CHI TIẾT --- */
.video-detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
@media (min-width: 1024px) {
    .video-detail-layout {
        grid-template-columns: 3fr 1fr;
    }
}
.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}
.video-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.video-info-box {
    margin-top: 20px;
    padding: 20px;
    background-color: var(--bg-2);
    border-radius: 8px;
}
.video-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}
.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    color: var(--text-base);
}
.video-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}
.related-videos-box {
    background-color: var(--bg-2);
    padding: 20px;
    border-radius: 8px;
}
.sidebar-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
}
.related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.related-item {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: var(--text-base);
}
.related-item img {
    width: 120px;
    height: 68px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}
.related-info h4 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.related-item:hover .related-info h4 {
    color: var(--primary-text);
}
.related-info span {
    font-size: 12px;
}
.not-found-box {
    text-align: center;
    padding: 80px 20px;
}
.not-found-box h2 {
    font-size: 28px;
    margin-bottom: 15px;
}
.not-found-box p {
    margin-bottom: 30px;
}
/* --- CLASS GIỚI HẠN DÒNG CHO TIÊU ĐỀ DÀI --- */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* --- CSS CHO BẢNG VIDEO REPONSIVE (Bản sửa lỗi) --- */
.details-row {
    background-color: #272c3a;
}
.details-row.hidden {
    display: none;
}
.details-row.is-open {
    display: table-row;
}
.details-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: var(--text-base);
}
.details-content strong {
    color: #fff;
}
.expand-details-btn i {
    transition: transform 0.2s;
}
/* Xoay mũi tên khi mở */
tr.is-open + .details-row .expand-details-btn i {
    transform: rotate(180deg);
}

/* --- LOGIC ẨN/HIỆN CỘT --- */
/* Mặc định, ẩn các cột không cần thiết trên mobile */
.mobile-hidden {
    display: none;
}
/* Mặc định, hiện các cột chỉ dành cho mobile */
.mobile-only-cell {
    display: table-cell;
}
/* Khi màn hình lớn hơn 768px (máy tính) */
@media (min-width: 768px) {
    /* Hiện lại các cột đã ẩn */
    .mobile-hidden {
        display: table-cell;
    }
    /* Ẩn đi các cột chỉ dành cho mobile */
    .mobile-only-cell {
        display: none;
    }
}
/* CSS chỉnh lại kích thước logo */
.logo img {
    height: 35px; /* Mày có thể chỉnh lại chiều cao này cho vừa ý */
    width: auto;
}
/* --- CSS CHO SLIDER CÓ NỘI DUNG ĐÈ LÊN --- */
.hero-slider {
    position: relative; /* Rất quan trọng để lớp phủ hoạt động */
    height: 400px;
    background-color: var(--bg-2);
}

/* Lớp phủ nội dung tĩnh */
.home-board-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10; /* Nằm trên slider */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    /* Lớp phủ tối màu để chữ dễ đọc hơn */
    background-color: rgba(0, 0, 0, 0.5);
}

.home-board-overlay .home-logo img {
    height: 50px;
    margin-bottom: 25px;
}

.home-board-overlay .heading-xl {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    max-width: 600px;
    line-height: 1.4;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.7); /* Thêm bóng đổ cho chữ nổi bật */
}

/* Giấu các nút của slider đi cho gọn gàng */
.hero-slider .swiper-pagination,
.hero-slider .swiper-button-prev,
.hero-slider .swiper-button-next {
    display: none;
}
/* --- CSS CHO PHÂN TRANG MỚI (V-PAGINATION) --- */

/* Utility class để căn giữa theo chiều ngang (Nếu chưa có) */
.line-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.v-pagination {
    padding: 20px 0;
    margin-top: 20px;
}

.page-control {
    gap: 10px; /* Khoảng cách giữa các nút */
    background-color: var(--bg-2);
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

/* Nút tròn (Previous/Next Button) */
.btn-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; /* Kích thước nút */
    height: 40px;
    border-radius: 50%; /* Tròn hoàn toàn */
    font-size: 18px;
    transition: background-color 0.2s, box-shadow 0.2s;
}

/* Style cho nút bị disabled */
.btn-circle[disabled] {
    background-color: var(--bg-3) !important;
    color: var(--text-muted) !important;
    box-shadow: none;
    cursor: not-allowed;
}

/* Phần hiển thị trang hiện tại */
.page-current {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    gap: 5px;
}

/* Input nhập trang */
.v-form-control {
    padding: 4px;
    width: 50px; /* Chiều rộng input */
    height: 30px;
    border: 1px solid var(--border-color);
    text-align: center;
    font-size: 16px;
    border-radius: 6px;
    -moz-appearance: textfield; /* Ẩn mũi tên mặc định của input type="number" cho Firefox */
}
/* Ẩn mũi tên mặc định của input type="number" cho Chrome/Safari */
.v-form-control::-webkit-outer-spin-button,
.v-form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* --- ADMIN LAYOUT FIX (MIN-HEIGHT) --- */


/* 2. Admin Wrapper (Bọc Sidebar và Content) */
.admin-wrapper {
    flex-grow: 1; 
    display: flex;
    /* 67px là chiều cao header (khoảng 67px) */
    min-height: calc(100vh - 67px); 
    background-color: var(--bg-color);
}

/* 3. Admin Sidebar (Phần có màu nền full height) */
.admin-sidebar {
    width: 250px; 
    flex-shrink: 0; 
    background-color: var(--top-bg-default); 
    padding: 20px 0;
    border-right: 1px solid var(--border-color);
    /* FIX: Kéo dài Sidebar hết chiều cao của admin-wrapper */
    min-height: 100%; 
}

/* 4. Admin Content Wrapper */
.admin-content-wrapper {
    flex-grow: 1; 
    padding: 40px 20px; 
}

/* 5. Style Sidebar Menu (Để đảm bảo nó hoạt động trong layout mới) */
.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-base);
    opacity: 0.7;
    text-transform: uppercase;
    padding: 0 20px;
    margin-top: 15px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-base);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background-color: var(--bg-2); 
    color: #fff;
}

/* 6. Đảm bảo Footer bị đẩy xuống cuối màn hình */
.main-footer {
    margin-top: auto;
}
/* --- FIX LỆCH ICON Ở FOOTER --- */
.footer-col .social-links {
    margin-left: 0;
    padding-left: 0;
}
/* --- CSS CHO HEADER RESPONSIVE (Bản sửa lỗi cuối cùng) --- */

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-left { display: flex; align-items: center; }
.header-center { display: none; }
.header-right { display: flex; justify-content: flex-end; }
.desktop-nav { display: flex; gap: 25px; }
.mobile-nav { display: none; }
.mobile-only-btn, .search-close-btn { display: none; background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; }
.search-icon-btn { background: none; border: none; color: var(--text-base); font-size: 22px; cursor: pointer; }

/* Áp dụng cho màn hình mobile (chiều rộng dưới 768px) */
@media (max-width: 768px) {
    /* Chia header thành 3 cột đều nhau */
    .main-header .container {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }
    .header-left { justify-self: start; }
    .header-center { display: block; justify-self: center; }
    .header-right { justify-self: end; }

    .desktop-nav { display: none; }
    .mobile-only-btn { display: block; }
    .search-box input { display: none; }
    .search-icon-btn { margin: 5px; }

    /* Menu xổ xuống */
    .mobile-nav {
        background-color: var(--top-bg-default);
        flex-direction: column;
        padding: 0 20px;
        border-top: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    }
    .mobile-nav.is-open {
        display: flex;
        max-height: 500px; /* Chiều cao đủ lớn để chứa hết menu */
        padding: 10px 20px;
    }
    .mobile-nav a { padding: 10px 0; text-decoration: none; color: var(--text-base); }

    /* Khi ô search được mở */
    .search-box.is-open {
        position: absolute; top: 0; left: 0;
        width: 100%; height: 100%;
        background-color: var(--top-bg-default);
        display: flex; align-items: center;
        padding: 0 15px; z-index: 101;
    }
    .search-box.is-open input { display: block; width: 100%; padding-right: 40px; }
    .search-box.is-open .search-icon-btn { display: none; }
    .search-box.is-open .search-close-btn {
        display: block; position: absolute; right: 15px; top: 50%;
        transform: translateY(-50%);
    }
}
/* --- CSS CHO KHU VỰC PHIM HOT --- */
.horizontal-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(50% - 10px); /* Trên mobile, 2 thẻ 1 hàng */
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 20px; /* Thêm padding để thanh cuộn không che mất bóng đổ */
    /* Ẩn thanh cuộn xấu xí */
    scrollbar-width: none; /* Firefox */
}
.horizontal-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

@media (min-width: 768px) {
    .horizontal-scroll {
        grid-auto-columns: calc(25% - 15px); /* 4 thẻ 1 hàng */
    }
}

@media (min-width: 1024px) {
    .horizontal-scroll {
        grid-auto-columns: calc(20% - 16px); /* 5 thẻ 1 hàng */
    }
}
