/*
Theme Name: Newsmag-khophim8k
Theme URI: https://khophim8k.com
Description: KhoPhim8K Dark Cinema Theme - Electric Violet (#6D5BF5), Hot Pink (#D92E63) & Cosmic Navy (#0B0D1A) Edition.
Author: KhoPhim8K Studio
Author URI: https://khophim8k.com
Template: Newsmag
Version: 3.0.0
License: GNU General Public License v2 or later
*/

:root {
	--kp-bg: #0B0D1A;
	--kp-surface: #151935;
	--kp-surface-hover: #1C2143;
	--kp-surface-active: #232952;
	--kp-sidebar: #0F1224;
	--kp-accent: #6D5BF5;
	--kp-accent-hover: #7F6FF7;
	--kp-accent-pink: #D92E63;
	--kp-accent-light: #A99BFF;
	--kp-text: #F1F2FA;
	--kp-text-sub: #A4A9C8;
	--kp-text-light: #D5D8EC;
	--kp-text-muted: #7C82A6;
	--kp-score: #FFC94D;
	--kp-border: rgba(255, 255, 255, 0.06);
	--kp-border-mid: rgba(255, 255, 255, 0.08);
	--kp-border-strong: rgba(255, 255, 255, 0.12);
	--kp-sidebar-w: 236px;
	--kp-max-w: 1400px;
	--kp-radius-sm: 8px;
	--kp-radius: 12px;
	--kp-radius-lg: 16px;
	--kp-radius-xl: 22px;
	--kp-bottom-h: calc(76px + env(safe-area-inset-bottom, 0px));
}

*, *::before, *::after {
	box-sizing: border-box;
	-webkit-tap-highlight-color: transparent;
}

html {
	font-family: 'Lexend', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: var(--kp-bg);
	color: var(--kp-text);
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body {
	margin: 0;
	padding: 0;
	background: var(--kp-bg);
	color: var(--kp-text);
	font-family: 'Lexend', system-ui, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	overflow-x: hidden;
	min-height: 100vh;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

button {
	font-family: inherit;
	border: none;
	outline: none;
	background: none;
	cursor: pointer;
	transition: all 0.18s ease;
}

input, select {
	font-family: inherit;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Hide Parent Theme Unneeded Wrappers */
.td-header-wrap, .td-footer-wrap, #td-outer-wrap > .td-main-content-wrap, .td-sub-footer-container {
	display: none !important;
}

/* ==========================================================================
   1. APP LAYOUT: SIDEBAR + MAIN CONTENT
   ========================================================================== */
.kp-app-layout {
	display: flex;
	min-height: 100vh;
	width: 100%;
}

/* Desktop Sidebar (236px) */
.kp-sidebar {
	position: fixed;
	left: 0;
	top: 0;
	bottom: 0;
	width: var(--kp-sidebar-w);
	z-index: 60;
	background: var(--kp-sidebar);
	border-right: 1px solid var(--kp-border);
	display: flex;
	flex-direction: column;
	padding: 22px 14px;
	overflow-y: auto;
	scrollbar-width: none;
}

.kp-sidebar::-webkit-scrollbar {
	display: none;
}

.kp-sidebar-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 0 10px 22px;
	color: var(--kp-text);
	cursor: pointer;
}

.kp-logo-icon {
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--kp-accent), var(--kp-accent-pink));
	display: grid;
	place-items: center;
	flex-shrink: 0;
	box-shadow: 0 4px 14px rgba(109, 91, 245, 0.4);
}

.kp-logo-text {
	font-weight: 700;
	font-size: 20px;
	line-height: 1;
	letter-spacing: -0.02em;
	color: #fff;
}

.kp-logo-text span {
	color: var(--kp-accent-light);
}

.kp-sidebar-nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.kp-nav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 44px;
	padding: 0 12px;
	border-radius: 12px;
	color: var(--kp-text-sub);
	font-weight: 500;
	font-size: 13.5px;
	cursor: pointer;
}

.kp-nav-item:hover {
	background: var(--kp-surface-hover);
	color: var(--kp-text);
}

.kp-nav-item.is-active {
	background: var(--kp-surface-hover);
	color: #fff;
	font-weight: 600;
}

.kp-nav-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

.kp-nav-label {
	flex: 1;
}

.kp-nav-badge {
	font-size: 11.5px;
	font-weight: 600;
	color: var(--kp-text-muted);
}

.kp-sidebar-divider {
	height: 1px;
	background: var(--kp-border);
	margin: 16px 8px 12px;
}

.kp-sidebar-section-title {
	padding: 6px 12px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--kp-text-muted);
}

.kp-genre-nav-list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.kp-genre-nav-item {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 38px;
	padding: 0 12px;
	border-radius: 10px;
	color: var(--kp-text-sub);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.kp-genre-nav-item:hover {
	background: var(--kp-surface-hover);
	color: var(--kp-text);
}

.kp-genre-nav-item.is-active {
	background: var(--kp-surface-hover);
	color: var(--kp-accent-light);
	font-weight: 600;
}

/* Main Content Wrapper */
.kp-main-wrapper {
	flex: 1;
	min-width: 0;
	margin-left: var(--kp-sidebar-w);
	display: flex;
	flex-direction: column;
	width: calc(100% - var(--kp-sidebar-w));
}

.kp-container {
	max-width: var(--kp-max-w);
	margin: 0 auto;
	padding: 0 clamp(14px, 2.4vw, 32px);
	width: 100%;
}

/* ==========================================================================
   2. TOP SEARCH HEADER
   ========================================================================== */
.kp-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(11, 13, 26, 0.82);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid var(--kp-border);
	width: 100%;
}

.kp-header-inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
}

.kp-header-mobile-brand {
	display: none;
	align-items: center;
	gap: 8px;
	flex: none;
	color: var(--kp-text);
	cursor: pointer;
}

.kp-search-box {
	position: relative;
	flex: 1;
	max-width: 560px;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	padding: 0 16px;
	border-radius: var(--kp-radius);
	background: var(--kp-surface);
	border: 1px solid var(--kp-border-mid);
	color: var(--kp-text-sub);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.kp-search-box:focus-within {
	border-color: var(--kp-accent);
	box-shadow: 0 0 0 2px rgba(109, 91, 245, 0.2);
}

.kp-search-input {
	flex: 1;
	min-width: 0;
	background: transparent;
	border: none;
	outline: none;
	color: var(--kp-text);
	font-size: 14px;
}

.kp-search-input::placeholder {
	color: var(--kp-text-muted);
}

/* Live Search Dropdown */
.kp-search-dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	padding: 8px;
	border-radius: var(--kp-radius-lg);
	background: var(--kp-surface);
	border: 1px solid var(--kp-border-strong);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
	z-index: 100;
	display: none;
}

.kp-search-dropdown.is-open {
	display: block;
}

.kp-search-dropdown-label {
	padding: 8px 10px 6px;
	font-size: 12px;
	font-weight: 500;
	color: var(--kp-text-muted);
}

.kp-search-item {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 8px 10px;
	border-radius: 10px;
	color: var(--kp-text);
	cursor: pointer;
}

.kp-search-item:hover {
	background: var(--kp-surface-hover);
}

.kp-search-thumb {
	width: 44px;
	height: 62px;
	border-radius: 6px;
	object-fit: cover;
	background: #1C2143;
}

.kp-search-meta {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.kp-search-title {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kp-search-sub {
	font-size: 12px;
	color: var(--kp-text-sub);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kp-search-score {
	font-weight: 600;
	font-size: 12px;
	color: var(--kp-score);
}

.kp-header-spacer {
	flex: 1;
}

.kp-header-btn-8k {
	height: 40px;
	padding: 0 16px;
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(109, 91, 245, 0.2), rgba(217, 46, 99, 0.2));
	border: 1px solid rgba(169, 155, 255, 0.3);
	color: var(--kp-text);
	font-size: 13px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
}

.kp-header-btn-8k:hover {
	border-color: var(--kp-accent-light);
	background: linear-gradient(135deg, rgba(109, 91, 245, 0.3), rgba(217, 46, 99, 0.3));
}

/* ==========================================================================
   3. HERO SHOWCASE BANNER WITH PROGRESS BARS
   ========================================================================== */
.kp-hero-section {
	position: relative;
	margin-top: 14px;
}

.kp-hero-wrap {
	position: relative;
	border-radius: clamp(18px, 2vw, 28px);
	overflow: hidden;
	min-height: clamp(460px, 48vw, 600px);
	background-color: #151935;
	background-size: cover;
	background-position: center;
	display: none;
	align-items: stretch;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.kp-hero-wrap.is-active {
	display: flex;
}

.kp-hero-gradient {
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(11, 13, 26, 0.92) 0%, rgba(11, 13, 26, 0.55) 50%, rgba(11, 13, 26, 0.1) 100%),
	            linear-gradient(0deg, rgba(11, 13, 26, 0.9) 0%, rgba(11, 13, 26, 0) 50%);
	z-index: 2;
}

/* Top Progress Bars (5 Segments) */
.kp-hero-bars {
	position: absolute;
	top: clamp(16px, 2vw, 24px);
	left: clamp(18px, 3vw, 44px);
	right: clamp(18px, 3vw, 44px);
	display: flex;
	gap: 6px;
	z-index: 5;
}

.kp-hero-bar-item {
	flex: 1;
	height: 14px;
	padding: 5px 0;
	background: transparent;
	border: none;
	cursor: pointer;
}

.kp-hero-bar-track {
	display: block;
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.22);
	overflow: hidden;
}

.kp-hero-bar-fill {
	display: block;
	height: 100%;
	width: 0%;
	background: #fff;
	border-radius: 2px;
}

.kp-hero-bar-item.is-active .kp-hero-bar-fill {
	background: var(--kp-accent-light);
}

/* Hero Content */
.kp-hero-content {
	position: relative;
	z-index: 3;
	padding: clamp(60px, 8vw, 80px) clamp(18px, 3vw, 44px) clamp(24px, 4vw, 44px);
	max-width: 640px;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 14px;
}

.kp-hero-kicker {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--kp-accent-light);
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.kp-hero-title {
	margin: 0;
	font-weight: 800;
	font-size: clamp(28px, 4.4vw, 48px);
	line-height: 1.1;
	letter-spacing: -0.025em;
	color: #fff;
	text-wrap: balance;
}

.kp-hero-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	font-size: 13.5px;
	color: var(--kp-text-light);
}

.kp-hero-score {
	color: var(--kp-score);
	font-weight: 700;
}

.kp-hero-badge-pill {
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 12px;
	font-weight: 600;
}

.kp-hero-desc {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--kp-text-sub);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.kp-hero-ctas {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 6px;
}

.kp-btn-hero-play {
	height: 48px;
	padding: 0 24px;
	border-radius: 12px;
	background: var(--kp-accent);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(109, 91, 245, 0.45);
}

.kp-btn-hero-play:hover {
	background: var(--kp-accent-hover);
	transform: translateY(-2px);
}

.kp-btn-hero-fav {
	height: 48px;
	padding: 0 18px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid var(--kp-border-strong);
	color: var(--kp-text);
	font-weight: 600;
	font-size: 15px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.kp-btn-hero-fav:hover {
	background: rgba(255, 255, 255, 0.14);
}

.kp-btn-hero-fav.is-saved {
	color: var(--kp-accent-pink);
	border-color: var(--kp-accent-pink);
}

/* 3D Tilted Poster Mockup (Right side on Desktop) */
.kp-hero-tilted-poster {
	position: absolute;
	right: 6%;
	bottom: -20px;
	width: clamp(220px, 22vw, 290px);
	aspect-ratio: 2/3;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.1);
	transform: perspective(900px) rotateY(-18deg) rotateX(4deg);
	transition: transform 0.4s ease;
	z-index: 3;
}

.kp-hero-tilted-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kp-hero-tilted-poster:hover {
	transform: perspective(900px) rotateY(-8deg) rotateX(2deg) translateY(-8px);
}

/* ==========================================================================
   4. KHÁM PHÁ THỂ LOẠI (12 Colored Tiles)
   ========================================================================== */
.kp-section {
	margin-top: 48px;
}

.kp-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 18px;
}

.kp-section-title {
	margin: 0;
	font-weight: 700;
	font-size: clamp(20px, 2.2vw, 24px);
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.kp-section-subtitle {
	font-size: 13px;
	color: var(--kp-text-muted);
}

.kp-genre-tiles-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 14vw, 170px), 1fr));
	gap: 12px;
}

.kp-genre-tile {
	height: 92px;
	padding: 14px;
	border-radius: 14px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	color: #fff;
	cursor: pointer;
	position: relative;
	overflow: hidden;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kp-genre-tile:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.kp-genre-tile-name {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.2;
}

.kp-genre-tile-count {
	font-size: 12px;
	opacity: 0.8;
}

/* ==========================================================================
   5. TOP 10 TUẦN NÀY (Horizontal Swipe with Large Outline Numbers)
   ========================================================================== */
.kp-top10-scroll {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: clamp(140px, 15vw, 180px);
	gap: clamp(12px, 1.6vw, 20px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding: 6px 2px 14px;
}

.kp-top10-scroll::-webkit-scrollbar {
	display: none;
}

.kp-top10-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 8px;
	cursor: pointer;
	scroll-snap-align: start;
}

.kp-top10-card:hover .kp-top10-poster-wrap {
	transform: translateY(-4px);
}

.kp-top10-poster-wrap {
	position: relative;
	aspect-ratio: 2/3;
	border-radius: var(--kp-radius);
	overflow: hidden;
	background: var(--kp-surface);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease;
}

.kp-top10-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kp-top10-rank-num {
	position: absolute;
	left: 4px;
	bottom: -10px;
	font-weight: 900;
	font-size: clamp(52px, 5.5vw, 72px);
	line-height: 1;
	letter-spacing: -0.04em;
	color: transparent;
	-webkit-text-stroke: 2px var(--kp-accent-light);
	text-shadow: 0 4px 14px rgba(0, 0, 0, 0.8);
	pointer-events: none;
	user-select: none;
	z-index: 2;
}

.kp-top10-rank-num.is-top3 {
	-webkit-text-stroke: 2.5px var(--kp-accent-light);
	filter: drop-shadow(0 2px 8px rgba(169, 155, 255, 0.5));
}

.kp-top10-title {
	font-weight: 600;
	font-size: 13.5px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 4px;
}

.kp-top10-meta {
	font-size: 12px;
	color: var(--kp-text-muted);
	display: flex;
	gap: 6px;
}

.kp-top10-meta span.score {
	color: var(--kp-score);
	font-weight: 600;
}

/* ==========================================================================
   6. LỊCH CHIẾU TẬP MỚI (Weekly Schedule)
   ========================================================================== */
.kp-schedule-tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	scrollbar-width: none;
	margin-bottom: 18px;
}

.kp-schedule-tabs::-webkit-scrollbar {
	display: none;
}

.kp-sched-tab {
	flex: none;
	min-width: 60px;
	height: 52px;
	padding: 0 14px;
	border-radius: 12px;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border);
	color: var(--kp-text-light);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	cursor: pointer;
}

.kp-sched-tab:hover {
	border-color: var(--kp-accent);
}

.kp-sched-tab.is-active {
	background: var(--kp-accent);
	color: #fff;
	border-color: var(--kp-accent);
}

.kp-sched-tab-day {
	font-weight: 700;
	font-size: 13.5px;
}

.kp-sched-tab-date {
	font-size: 11px;
	opacity: 0.8;
}

.kp-schedule-scroll {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: clamp(240px, 24vw, 300px);
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-bottom: 8px;
}

.kp-schedule-scroll::-webkit-scrollbar {
	display: none;
}

.kp-sched-card {
	position: relative;
	border-radius: 14px;
	overflow: hidden;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border);
	display: flex;
	flex-direction: column;
	cursor: pointer;
	scroll-snap-align: start;
	transition: transform 0.2s, border-color 0.2s;
}

.kp-sched-card:hover {
	transform: translateY(-3px);
	border-color: var(--kp-border-strong);
}

.kp-sched-thumb-wrap {
	position: relative;
	aspect-ratio: 16/9;
	background: #1C2143;
}

.kp-sched-thumb-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kp-sched-badge {
	position: absolute;
	left: 8px;
	top: 8px;
	padding: 3px 8px;
	border-radius: 6px;
	background: rgba(11, 13, 26, 0.72);
	backdrop-filter: blur(6px);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
}

.kp-sched-badge.is-today {
	background: var(--kp-accent-pink);
}

.kp-sched-info {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.kp-sched-title {
	font-weight: 700;
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kp-sched-ep {
	font-size: 12px;
	color: var(--kp-accent-light);
	font-weight: 500;
}

/* ==========================================================================
   7. KHO PHIM MAIN CATALOG (Grid, Filters, Load More)
   ========================================================================== */
.kp-catalog-filter-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.kp-type-pills {
	display: flex;
	padding: 4px;
	gap: 2px;
	border-radius: 12px;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border);
}

.kp-type-pill {
	height: 36px;
	padding: 0 16px;
	border-radius: 9px;
	color: var(--kp-text-light);
	font-weight: 600;
	font-size: 13px;
	cursor: pointer;
}

.kp-type-pill.is-active {
	background: var(--kp-accent);
	color: #fff;
}

.kp-sort-select {
	height: 40px;
	padding: 0 14px;
	border-radius: 10px;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border-mid);
	color: var(--kp-text);
	font-size: 13px;
	outline: none;
	cursor: pointer;
}

/* Horizontal Genre Chips in Catalog */
.kp-genre-chips-scroll {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	margin-bottom: 22px;
}

.kp-genre-chips-scroll::-webkit-scrollbar {
	display: none;
}

.kp-genre-chip-btn {
	flex: none;
	height: 38px;
	padding: 0 15px;
	border-radius: 999px;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border);
	color: var(--kp-text-light);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
}

.kp-genre-chip-btn:hover {
	border-color: var(--kp-accent);
	color: var(--kp-accent-light);
}

.kp-genre-chip-btn.is-active {
	background: #fff;
	color: #0B0D1A;
	border-color: #fff;
	font-weight: 600;
}

/* 2:3 Movie Cards Grid */
.kp-movie-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: clamp(14px, 1.8vw, 22px) clamp(10px, 1.4vw, 18px);
}

.kp-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	color: var(--kp-text);
	cursor: pointer;
	transition: transform 0.18s ease;
}

.kp-card:hover {
	transform: translateY(-4px);
	color: var(--kp-text);
}

.kp-card-poster-wrap {
	position: relative;
	aspect-ratio: 2/3;
	border-radius: var(--kp-radius);
	overflow: hidden;
	background: var(--kp-surface);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.kp-card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.kp-card:hover .kp-card-img {
	transform: scale(1.05);
}

.kp-card-badges {
	position: absolute;
	top: 8px;
	left: 8px;
	right: 8px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 2;
}

.kp-card-quality {
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(11, 13, 26, 0.72);
	color: #fff;
	font-weight: 500;
	font-size: 11px;
	line-height: 1.5;
}

.kp-card-rating {
	padding: 2px 7px;
	border-radius: 999px;
	background: rgba(11, 13, 26, 0.72);
	color: var(--kp-score);
	font-weight: 600;
	font-size: 11px;
	line-height: 1.5;
}

.kp-card-overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 32px 10px 10px;
	background: linear-gradient(transparent, rgba(11, 13, 26, 0.85));
	display: flex;
	flex-direction: column;
	gap: 3px;
	z-index: 2;
}

.kp-card-orig {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.1;
	text-transform: uppercase;
	color: #fff;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kp-card-status {
	font-size: 11px;
	color: #D5D8EC;
	font-weight: 400;
}

.kp-card-title {
	font-weight: 600;
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kp-card-meta {
	display: flex;
	gap: 6px;
	font-size: 12px;
	color: var(--kp-text-muted);
	white-space: nowrap;
	overflow: hidden;
}

.kp-card-rating {
	color: var(--kp-score);
	font-weight: 600;
}

/* Load More Button */
.kp-load-more {
	display: block;
	margin: 32px auto 0;
	height: 46px;
	padding: 0 32px;
	border-radius: 12px;
	border: 1px solid var(--kp-border-strong);
	background: var(--kp-surface);
	color: var(--kp-text);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
}

.kp-load-more:hover {
	background: var(--kp-surface-hover);
	border-color: var(--kp-accent);
	color: var(--kp-accent-light);
}

/* ==========================================================================
   8. MOVIE DETAIL PAGE (single-movie.php)
   ========================================================================== */
.kp-detail-page {
	padding-top: 10px;
	padding-bottom: 50px;
}

/* 2-Column Detail Layout */
.kp-detail-layout {
	display: flex;
	gap: clamp(20px, 2.6vw, 36px);
	align-items: flex-start;
}

.kp-detail-main {
	flex: 999 1 640px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.kp-detail-sidebar {
	flex: 1 1 300px;
	min-width: 280px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

/* 16:9 Player Viewport with Ambient Glow */
.kp-player-box {
	position: relative;
	aspect-ratio: 16/9;
	border-radius: 20px;
	overflow: hidden;
	background: #05060D;
	box-shadow: 0 30px 80px rgba(109, 91, 245, 0.35);
}

.kp-player-backdrop {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	z-index: 10;
	pointer-events: auto;
	cursor: pointer;
	transition: opacity 0.3s;
}

.kp-player-backdrop-overlay {
	position: absolute;
	inset: 0;
	background: rgba(11, 13, 26, 0.55);
}

.kp-player-topbar {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	padding: 14px 18px;
	background: linear-gradient(rgba(0, 0, 0, 0.8), transparent);
	display: flex;
	justify-content: space-between;
	align-items: center;
	color: #fff;
	font-weight: 600;
	font-size: 13.5px;
	z-index: 12;
	pointer-events: none;
}

.kp-player-play-btn {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: clamp(64px, 9vw, 84px);
	height: clamp(64px, 9vw, 84px);
	border-radius: 50%;
	background: var(--kp-accent);
	color: #fff;
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 10px 40px rgba(109, 91, 245, 0.6);
	z-index: 13;
	pointer-events: auto;
	transition: transform 0.2s, background-color 0.2s;
}

.kp-player-play-btn:hover {
	background: var(--kp-accent-hover);
	transform: translate(-50%, -50%) scale(1.08);
}

.kp-player-iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: none;
	z-index: 1;
}

.kp-player-box.is-playing .kp-player-backdrop {
	display: none !important;
}

.kp-player-box.is-playing .kp-player-iframe {
	z-index: 10;
}

/* Server & Audio Switcher Panel */
.kp-controls-panel {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: center;
	padding: 14px 18px;
	border-radius: var(--kp-radius);
	background: var(--kp-surface);
	border: 1px solid var(--kp-border);
}

.kp-control-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.kp-control-label {
	font-size: 13px;
	color: var(--kp-text-muted);
	margin-right: 4px;
	font-weight: 500;
}

.kp-control-pill {
	height: 36px;
	padding: 0 14px;
	border-radius: 8px;
	background: var(--kp-surface-hover);
	color: var(--kp-text-light);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.kp-control-pill.is-active {
	background: var(--kp-accent);
	color: #fff;
}

/* Detail Interactive Tabs (Tập phim, Thông tin, Diễn viên) */
.kp-detail-tabs-head {
	display: flex;
	gap: 8px;
	border-bottom: 1px solid var(--kp-border);
	padding-bottom: 2px;
}

.kp-detail-tab-btn {
	padding: 10px 18px;
	border-radius: 8px 8px 0 0;
	color: var(--kp-text-sub);
	font-weight: 600;
	font-size: 14px;
	cursor: pointer;
	position: relative;
}

.kp-detail-tab-btn.is-active {
	color: #fff;
}

.kp-detail-tab-btn.is-active::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: var(--kp-accent-light);
	border-radius: 2px;
}

.kp-tab-pane {
	display: none;
	padding-top: 14px;
}

.kp-tab-pane.is-active {
	display: block;
}

/* Episodes Tab Cards Grid */
.kp-episodes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	max-height: 480px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.kp-ep-card {
	position: relative;
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border);
	display: flex;
	flex-direction: column;
	gap: 4px;
	cursor: pointer;
	overflow: hidden;
}

.kp-ep-card:hover {
	border-color: var(--kp-accent);
}

.kp-ep-card.is-active {
	border-color: var(--kp-accent-light);
	background: var(--kp-surface-hover);
}

.kp-ep-name {
	font-weight: 700;
	font-size: 14px;
	color: #fff;
}

.kp-ep-dur {
	font-size: 12px;
	color: var(--kp-text-muted);
}

.kp-ep-watched-bar {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	background: var(--kp-accent-pink);
	width: 0%;
}

.kp-ep-card.is-watched .kp-ep-watched-bar {
	width: 100%;
}

/* Info Tab */
.kp-info-head {
	display: flex;
	flex-wrap: wrap;
	gap: clamp(16px, 2.4vw, 24px);
	align-items: flex-start;
}

.kp-info-poster {
	width: 130px;
	aspect-ratio: 2/3;
	border-radius: var(--kp-radius);
	overflow: hidden;
	flex-shrink: 0;
}

.kp-info-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kp-info-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.kp-info-title {
	margin: 0;
	font-weight: 800;
	font-size: clamp(22px, 3vw, 32px);
	letter-spacing: -0.02em;
}

.kp-info-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.kp-info-desc {
	margin: 6px 0 0;
	font-size: 14.5px;
	line-height: 1.65;
	color: var(--kp-text-light);
}

.kp-info-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.kp-action-btn {
	height: 38px;
	padding: 0 14px;
	border-radius: 9px;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border-strong);
	color: var(--kp-text);
	font-size: 13px;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
}

.kp-action-btn:hover {
	background: var(--kp-surface-hover);
}

.kp-action-btn.is-saved {
	color: var(--kp-accent-pink);
	border-color: var(--kp-accent-pink);
}

.kp-facts-grid {
	margin-top: 14px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 12px;
	padding: 16px;
	border-radius: var(--kp-radius);
	background: var(--kp-surface);
}

.kp-fact-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.kp-fact-label {
	font-size: 12px;
	color: var(--kp-text-muted);
}

.kp-fact-val {
	font-size: 14px;
	font-weight: 600;
	color: var(--kp-text);
}

/* Cast Tab */
.kp-cast-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
}

.kp-cast-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--kp-surface);
}

.kp-cast-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--kp-accent), var(--kp-accent-pink));
	color: #fff;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 16px;
	flex-shrink: 0;
}

.kp-cast-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.kp-cast-name {
	font-weight: 600;
	font-size: 13.5px;
}

.kp-cast-role {
	font-size: 12px;
	color: var(--kp-text-muted);
}

/* Detail Recommendations Aside */
.kp-rec-title {
	margin: 0;
	font-weight: 700;
	font-size: 18px;
	line-height: 1.2;
}

.kp-rec-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.kp-rec-card {
	display: grid;
	grid-template-columns: 60px minmax(0, 1fr);
	gap: 12px;
	padding: 6px;
	border-radius: 10px;
	color: var(--kp-text);
	cursor: pointer;
}

.kp-rec-card:hover {
	background: var(--kp-surface);
}

.kp-rec-poster {
	width: 60px;
	height: 88px;
	border-radius: 8px;
	overflow: hidden;
	background: #1C2143;
}

.kp-rec-poster img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kp-rec-info {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	min-width: 0;
}

.kp-rec-name {
	font-weight: 600;
	font-size: 13.5px;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.kp-rec-meta {
	font-size: 12px;
	color: var(--kp-text-muted);
}

.kp-rec-meta span.score {
	color: var(--kp-score);
	font-weight: 600;
}

/* ==========================================================================
   9. FOOTER & FLOATING MOBILE BOTTOM BAR
   ========================================================================== */
.kp-footer {
	margin-top: clamp(56px, 6vw, 80px);
	padding: 28px clamp(14px, 2.4vw, 32px) 36px;
	border-top: 1px solid var(--kp-border);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 14px 32px;
	font-size: 13px;
	line-height: 1.6;
	color: var(--kp-text-muted);
}

.kp-footer-brand {
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 440px;
}

.kp-footer-logo {
	font-weight: 700;
	font-size: 16px;
	color: #fff;
}

.kp-footer-logo span {
	color: var(--kp-accent-light);
}

.kp-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
}

.kp-footer-link {
	color: var(--kp-text-sub);
}

.kp-footer-link:hover {
	color: var(--kp-accent-light);
}

/* Floating Mobile Bottom Nav Bar */
.kp-mobile-bar {
	display: none;
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	z-index: 70;
	height: 64px;
	padding: 6px;
	border-radius: var(--kp-radius-xl);
	background: rgba(21, 25, 53, 0.94);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
	grid-template-columns: repeat(4, 1fr);
	gap: 4px;
}

.kp-mobile-tab {
	border: 0;
	border-radius: 16px;
	background: transparent;
	color: var(--kp-text-sub);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
}

.kp-mobile-tab.is-active {
	background: var(--kp-surface-hover);
	color: #fff;
	font-weight: 600;
}

.kp-mobile-tab-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
}

/* Toast */
.kp-toast {
	position: fixed;
	bottom: 90px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	opacity: 0;
	background: var(--kp-surface);
	border: 1px solid var(--kp-border-strong);
	color: var(--kp-text);
	padding: 10px 18px;
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
	font-size: 13.5px;
	font-weight: 600;
	z-index: 9999;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.kp-toast.is-show {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

/* ==========================================================================
   10. RESPONSIVE BREAKPOINTS (Desktop, Tablet, Mobile)
   ========================================================================== */

/* Tablet (720px - 1079px) */
@media (min-width: 720px) and (max-width: 1079px) {
	:root {
		--kp-sidebar-w: 80px;
	}
	.kp-sidebar {
		align-items: center;
		padding: 20px 8px;
	}
	.kp-sidebar-logo .kp-logo-text {
		display: none;
	}
	.kp-nav-label, .kp-nav-badge, .kp-sidebar-section-title, .kp-genre-nav-list {
		display: none;
	}
	.kp-nav-item {
		width: 48px;
		height: 48px;
		padding: 0;
		justify-content: center;
	}
	.kp-hero-tilted-poster {
		display: none;
	}
	.kp-detail-layout {
		flex-direction: column;
	}
	.kp-detail-sidebar {
		width: 100%;
	}
}

/* Mobile Devices (< 720px) */
@media (max-width: 719px) {
	:root {
		--kp-sidebar-w: 0px;
	}
	body {
		padding-bottom: var(--kp-bottom-h);
	}
	.kp-sidebar {
		display: none;
	}
	.kp-main-wrapper {
		margin-left: 0;
		width: 100%;
	}
	.kp-header-mobile-brand {
		display: flex;
	}
	.kp-mobile-bar {
		display: grid;
	}
	.kp-hero-tilted-poster {
		display: none;
	}
	.kp-hero-bars {
		left: 14px;
		right: 14px;
	}
	.kp-hero-content {
		padding: 50px 16px 20px;
	}
	.kp-movie-grid {
		grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
		gap: 12px 10px;
	}
	/* Mobile Detail Page: Edge-to-edge bleed for video player right at top */
	.kp-player-box {
		border-radius: 0;
		margin-left: calc(-1 * clamp(14px, 2.4vw, 32px));
		margin-right: calc(-1 * clamp(14px, 2.4vw, 32px));
	}
	.kp-detail-layout {
		flex-direction: column;
	}
	.kp-detail-sidebar {
		width: 100%;
	}
}


/* Mobile Drawer Modal */
.kp-mobile-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	align-items: flex-end;
}

.kp-mobile-drawer.is-open {
	display: flex;
}

.kp-drawer-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.kp-drawer-sheet {
	position: relative;
	width: 100%;
	max-height: 80vh;
	background: #151935;
	border-top-left-radius: 24px;
	border-top-right-radius: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
	overflow-y: auto;
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
	animation: kpSlideUp 0.25s ease-out;
}

@keyframes kpSlideUp {
	from { transform: translateY(100%); }
	to { transform: translateY(0); }
}

.kp-drawer-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 18px;
}

.kp-drawer-title {
	font-weight: 700;
	font-size: 17px;
	color: #F1F2FA;
}

.kp-drawer-close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.08);
	border: none;
	color: #fff;
	font-size: 22px;
	display: grid;
	place-items: center;
	cursor: pointer;
}

.kp-drawer-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}

.kp-drawer-genre-chip {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.06);
	color: #F1F2FA;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: background 0.18s;
}

.kp-drawer-genre-chip:hover {
	background: #6D5BF5;
	color: #fff;
}
