/* Chỉ áp dụng dark mode cho plugin container, không override body */
.web-phim-container,
.web-phim-content,
.web-phim-categories,
.web-phim-pagination {
    color: #e0e0e0;
    font-family: Arial, sans-serif;
}

/* Container chính */
.web-phim-container {
    padding: 20px;
    background: #0d0d0d;
    color: #e0e0e0;
}

/* Fullbody mode - không padding khi không có topbar */
.web-phim-categories:first-child {
    margin-top: 0;
}

/* CSS cho title có thể click */
h1, .page-title, .entry-title {
    cursor: pointer;
    transition: color 0.3s ease;
}

h1:hover, .page-title:hover, .entry-title:hover {
    color: #ff4444 !important;
}

/* Xóa khoảng trống không cần thiết trên header khi có plugin */
.wp-block-spacer[style*="height:var(--wp--preset--spacing--50)"] {
    display: none !important;
}

.wp-block-spacer[style*="height:var(--wp--preset--spacing--30)"] {
    height: 10px !important;
}

/* Xóa margin/padding không cần thiết cho container chứa plugin */
.wp-block-group.has-global-padding {
    padding-top: 20px !important;
}

/* Giảm khoảng cách trên header khi có plugin */
.has-text-align-center.wp-block-post-title {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ẩn spacer cụ thể cho layout WordPress */
.wp-block-group .wp-block-spacer:first-child {
    display: none !important;
}

/* Ẩn các phần không cần thiết khi có plugin web phim */
body:has(.web-phim-categories) footer,
body:has(.web-phim-categories) .site-footer,
body:has(.web-phim-categories) #colophon,
body:has(.web-phim-content) footer,
body:has(.web-phim-content) .site-footer,
body:has(.web-phim-content) #colophon {
    display: none !important;
}

/* Ẩn sidebar khi có plugin */
body:has(.web-phim-categories) .sidebar,
body:has(.web-phim-categories) .widget-area,
body:has(.web-phim-categories) aside,
body:has(.web-phim-content) .sidebar,
body:has(.web-phim-content) .widget-area,
body:has(.web-phim-content) aside {
    display: none !important;
}

/* Ẩn navigation menu không cần thiết */
body:has(.web-phim-categories) .site-navigation,
body:has(.web-phim-categories) .main-navigation,
body:has(.web-phim-content) .site-navigation,
body:has(.web-phim-content) .main-navigation {
    display: none !important;
}

/* Mở rộng content area khi ẩn sidebar */
body:has(.web-phim-categories) .site-main,
body:has(.web-phim-categories) .content-area,
body:has(.web-phim-content) .site-main,
body:has(.web-phim-content) .content-area {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Clean Mode - Ẩn tất cả phần không cần thiết */
body:has(.web-phim-clean-mode) header:not(.web-phim-topbar),
body:has(.web-phim-clean-mode) .site-header,
body:has(.web-phim-clean-mode) nav,
body:has(.web-phim-clean-mode) .navigation,
body:has(.web-phim-clean-mode) footer,
body:has(.web-phim-clean-mode) .site-footer,
body:has(.web-phim-clean-mode) aside,
body:has(.web-phim-clean-mode) .sidebar,
body:has(.web-phim-clean-mode) .widget-area {
    display: none !important;
}

/* Clean Mode - Full width cho content */
body:has(.web-phim-clean-mode) {
    margin: 0 !important;
    padding: 0 !important;
}

body:has(.web-phim-clean-mode) .site-main,
body:has(.web-phim-clean-mode) .content-area,
body:has(.web-phim-clean-mode) .entry-content {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 20px !important;
}

/* Topbar (logo + search) */
.web-phim-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.web-phim-logo {
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
    cursor: pointer;
    text-decoration: none;
}

.web-phim-logo a {
    color: #ffffff;
    text-decoration: none;
    cursor: pointer;
}

.web-phim-logo:hover,
.web-phim-logo a:hover {
    color: #ff4444;
}

.web-phim-search {
    display: flex;
    align-items: center;
    gap: 5px;
}

.web-phim-search input {
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    outline: none;
    background: #262626;
    color: #e0e0e0;
}

.web-phim-search button {
    background: #ff4444;
    border: none;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.web-phim-search button:hover {
    background: #ff6666;
}

/* Header khi lọc thể loại */
.web-phim-header h3 {
    width: 100%;
    font-size: 18px;
    margin-bottom: 10px;
    color: #ffcc00;
}

/* Categories */
.web-phim-categories {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 15px;
    scrollbar-width: thin;
    scrollbar-color: #555 transparent;
}

.web-phim-categories::-webkit-scrollbar {
    height: 6px;
}
.web-phim-categories::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 3px;
}
.web-phim-categories::-webkit-scrollbar-track {
    background: transparent;
}

.web-phim-categories a {
    display: inline-block;
    background: #333333;
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
    text-decoration: none;
    border: 1px solid #555555;
}

.web-phim-categories a:hover {
    background: #ff4444;
    color: white;
}

.web-phim-categories a.active {
    background: #ff4444;
    color: white;
}

/* Lưới phim */
.web-phim-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    background: transparent;
}

.web-phim-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background: #1a1a1a;
    border-radius: 6px;
}

.web-phim-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.web-phim-card:hover img {
    transform: scale(1.1);
}

.web-phim-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ff4444;
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 18px;
    display: none;
}

.web-phim-card:hover .web-phim-play-btn {
    display: block;
}

/* Title phim */
.web-phim-title {
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
    color: #333333;
    line-height: 1.3;
    height: 32px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 500;
}

/* Chi tiết phim */
.web-phim-detail img {
    max-width: 400px;
    display: block;
    margin-bottom: 20px;
}

.web-phim-detail h1 {
    color: #333333;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
}

.web-phim-desc {
    color: #444444;
    font-size: 15px;
    line-height: 1.6;
    background: #f8f8f8;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #ff4444;
}

.web-phim-actors {
    color: #333333;
    font-size: 14px;
    background: #f0f0f0;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.web-phim-actors b {
    color: #ff4444;
    font-weight: bold;
}

/* Pagination */
.web-phim-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
}

.web-phim-pagination button {
    background: #1a1a1a;
    color: #e0e0e0;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
    min-width: 32px;
}

.web-phim-pagination button:hover {
    background: #ff4444;
    color: #fff;
}

.web-phim-pagination button.active {
    background: #ff4444;
    color: #fff;
    font-weight: bold;
}

.web-phim-pagination button:disabled {
    opacity: 0.5;
    cursor: default;
}
