/*
Theme Name: Flixr
Theme URI: https://flixr.org/
Author: AI Assistant
Description: A highly optimized, premium WordPress theme designed as an EXACT JustWatch clone. Features full data density, clean dark mode UI, and seamless API integrations.
Version: 2.0.0
Text Domain: flixr
*/

/* Exact JustWatch Clone CSS */
:root {
	--jw-bg: #060d17;
	--jw-panel: #111826;
	--jw-border: #2d3748;
	--jw-text: #e2e8f0;
	--jw-muted: #94a3b8;
	--jw-yellow: #fbc500;
	--jw-blue: #4d93ff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
	background-color: var(--jw-bg);
	color: var(--jw-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	line-height: 1.5;
}
a { color: var(--jw-text); text-decoration: none; }
button { font-family: inherit; }

/* Header Fake */
.jw-header {
	background: var(--jw-bg);
	border-bottom: 1px solid var(--jw-border);
	height: 60px;
	display: flex;
	align-items: center;
	padding: 0 40px;
	position: sticky;
	top: 0;
	z-index: 1000;
}
.jw-logo { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.jw-logo span { color: var(--jw-yellow); }

/* Main Layout */
.jw-container {
	max-width: 1080px;
	margin: 40px auto;
	padding: 0 20px;
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 40px;
}

/* Left Sidebar (Poster & Actions) */
.jw-poster-container {
	position: relative;
	margin-bottom: 20px;
}
.jw-poster {
	width: 100%;
	border-radius: 8px;
	border: 1px solid rgba(255,255,255,0.1);
	display: block;
	box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Action Bar */
.jw-actions {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1px;
	background: var(--jw-border);
	border-radius: 8px;
	border: 1px solid var(--jw-border);
	overflow: hidden;
	margin-top: 10px;
}
.jw-action {
	background: var(--jw-panel);
	color: var(--jw-muted);
	padding: 12px 0;
	text-align: center;
	cursor: pointer;
	font-size: 11px;
	text-transform: uppercase;
	font-weight: 600;
	transition: background 0.2s, color 0.2s;
}
.jw-action:hover {
	background: #1e293b;
	color: #fff;
}
.jw-action svg { width: 20px; height: 20px; fill: currentColor; margin-bottom: 4px; display: block; margin: 0 auto; }

.sign-in-box {
	background: var(--jw-panel);
	border: 1px solid var(--jw-border);
	border-radius: 8px;
	padding: 16px;
	text-align: center;
	margin-top: 20px;
}
.sign-in-box p { font-size: 14px; color: var(--jw-muted); margin-bottom: 12px;}
.sign-in-btn {
	background: var(--jw-yellow); color: #000;
	border: none; border-radius: 4px; padding: 8px 16px; font-size: 14px; font-weight: 700; cursor: pointer; display: block; width: 100%;
}

/* Right Content */
.jw-main {
	display: flex;
	flex-direction: column;
}

/* Title Block */
.jw-title-block { margin-bottom: 20px; }
.jw-title-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;}
.jw-title { font-size: 36px; font-weight: 700; margin: 0; line-height: 1.2; }
.jw-year { font-size: 36px; font-weight: 300; color: var(--jw-muted); }
.jw-meta { font-size: 15px; color: var(--jw-text); margin-top: 6px; }
.jw-meta span.muted { color: var(--jw-muted); margin: 0 4px; }
.jw-meta-badge { border: 1px solid var(--jw-muted); padding: 1px 6px; border-radius: 3px; font-size: 12px; }

/* Ratings Row */
.jw-ratings { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.jwt-rating { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--jw-text); }
.jwt-icon { width: 18px; height: 18px; background: var(--jw-yellow); color:#000; border-radius: 3px; display:inline-flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; }
.jwt-icon.tmdb { background: transparent; color: #01b4e4; border: 1px solid #01b4e4; }

/* Providers Section */
.jw-watch-box { margin-bottom: 40px; }
.w-header { font-size: 20px; font-weight: 600; margin-bottom: 15px; border-bottom: 1px solid var(--jw-border); padding-bottom: 10px;}

.jw-tabs { display: flex; gap: 20px; margin-bottom: 15px; border-bottom: 1px solid var(--jw-border); }
.w-tab { padding: 8px 0; font-size: 15px; font-weight: 600; color: var(--jw-muted); cursor: pointer; position: relative; }
.w-tab.active { color: #fff; }
.w-tab.active::after { content:''; position:absolute; bottom:-1px; left:0; width:100%; height:2px; background:var(--jw-yellow); }

.jw-filters { display: flex; gap: 8px; margin-bottom: 20px; }
.w-filter { padding: 4px 12px; border-radius: 20px; background: transparent; border: 1px solid var(--jw-border); font-size: 13px; color: var(--jw-text); cursor: pointer; transition: 0.2s;}
.w-filter:hover { border-color: var(--jw-muted); }
.w-filter.active { background: #334155; border-color: #334155; color: #fff; }

.best-price { background: rgba(251, 197, 0, 0.1); border: 1px solid rgba(251, 197, 0, 0.3); border-radius: 8px; padding: 12px; display: flex; align-items: center; gap: 15px; margin-bottom: 24px; cursor: pointer;}
.bp-icon { width: 44px; height: 44px; border-radius: 8px; display: block;}
.bp-text { display: flex; flex-direction: column;}
.bp-text span:first-child { font-size: 12px; color: var(--jw-muted); font-weight: 500;}
.bp-text strong { font-size: 18px; color: var(--jw-text); font-weight: 700; margin-top: 2px;}

.p-row { display: flex; padding: 12px 0; border-bottom: 1px solid var(--jw-border); }
.p-label { width: 80px; font-size: 12px; font-weight: 600; color: var(--jw-muted); text-transform: uppercase; align-self: center;}
.p-list { display: flex; gap: 12px; flex-wrap: wrap; flex: 1;}
.p-item { text-align: center; width: 44px; cursor: pointer; text-decoration: none; color: inherit; }
.p-item img { width: 44px; height: 44px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); display: block; margin-bottom: 4px; transition: transform 0.2s; }
.p-item:hover img { transform: scale(1.05); }
.p-item span { font-size: 11px; color: var(--jw-text); font-weight: 500;}

.w-disclaimer { font-size: 12px; color: var(--jw-muted); margin-top: 15px; display: flex; justify-content: space-between; align-items: center; }
.w-disclaimer a { color: var(--jw-blue); }

/* Details Grid (Synopsis, Crew, Cast) */
.details-grid {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 40px;
	margin-top: 20px;
}

.jw-h3 { font-size: 20px; font-weight: 600; margin-bottom: 15px; border-bottom: 1px solid var(--jw-border); padding-bottom: 6px;}

.synopsis { font-size: 15px; line-height: 1.6; color: var(--jw-muted); margin-bottom: 30px;}

.info-block { display: flex; flex-direction: column; gap: 15px; }
.info-item { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: 14px; font-weight: 600; color: var(--jw-text); }
.info-value { font-size: 14px; color: var(--jw-blue); cursor: pointer;}
.info-value.plain { color: var(--jw-muted); cursor: default; }

/* Cast horizontal list */
.cast-list { display: flex; overflow-x: auto; gap: 15px; padding-bottom: 15px; scrollbar-width: thin; scrollbar-color: var(--jw-border) var(--jw-bg); }
.cast-list::-webkit-scrollbar { height: 6px; }
.cast-list::-webkit-scrollbar-track { background: var(--jw-bg); }
.cast-list::-webkit-scrollbar-thumb { background: var(--jw-border); border-radius: 3px; }
.cast-item { width: 100px; text-align: center; flex-shrink: 0;}
.cast-img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; margin-bottom: 8px; border: 1px solid rgba(255,255,255,0.1);}
.cast-name { font-size: 13px; font-weight: 600; color: var(--jw-blue); display: block; line-height: 1.2; margin-bottom: 2px; cursor:pointer;}
.cast-char { font-size: 12px; color: var(--jw-muted); display: block; line-height: 1.2;}

/* Trailer Block */
.jw-trailer { margin-top: 40px; }
.trailer-box { width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 8px; position: relative; border: 1px solid rgba(255,255,255,0.1);}
.trailer-box img { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; border-radius: 8px;}
.t-play { position: absolute; top:50%; left:50%; transform:translate(-50%, -50%); width:64px; height:64px; background:rgba(0,0,0,0.6); border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; cursor:pointer; }
.t-play svg { width: 32px; height: 32px; fill: currentColor; }

/* --- خصائص التبويبات الديناميكية (Tabs) --- */
.tab-content {
    display: none;
    animation: fadeInTab 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInTab {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
	.jw-container { grid-template-columns: 1fr; gap: 20px;}
	.jw-poster { width: 160px; float: left; margin-right: 20px; }
	.jw-actions { clear: both; }
	.details-grid { grid-template-columns: 1fr; gap: 20px; }
}