/* =========================================================================
   Ana Yurt Online — styles for com_spmoviedb override markup
   (classes introduced by the template's view overrides; design-token based)
   ========================================================================= */

/* Posters as <img> */
.card-poster .poster-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-overlay-ch { font-size: 11px; color: rgba(255,255,255,0.7); letter-spacing: 0.06em; text-transform: uppercase; }
.card-overlay-meta { font-size: 13px; color: #fff; line-height: 1.35; font-weight: 500; }
.card-sub-ch { color: var(--accent); font-weight: 600; }
.rating .rating-val { color: var(--text-2); font-weight: 600; }
a.card { color: inherit; text-decoration: none; }

/* ---- Catalog filters head --------------------------------------------- */
.filters-head { margin-bottom: var(--s-2); }
.filters-title { font-size: var(--t-2xl); margin-bottom: 4px; }
.filters-sub { color: var(--text-3); font-size: var(--t-sm); margin: 0; }
.filter-item-label { display: flex; align-items: center; gap: 10px; }
.filter-dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.catalog-tools { display: flex; gap: var(--s-2); align-items: center; }
.catalog-head .count {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 26px; height: 22px; padding: 0 8px;
	border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent);
	font-size: 12px; font-weight: 700;
}
.sort select { background: transparent; border: 0; color: var(--text-1); font-weight: 600; outline: none; cursor: pointer; }
.sort select option { background: var(--bg-2); color: var(--text-1); }

/* ---- Empty state ------------------------------------------------------- */
.empty-state {
	padding: var(--s-16) var(--s-8); text-align: center;
	border: 1px dashed var(--border-strong); border-radius: var(--r-xl);
	display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
}
.empty-state h3 { margin: var(--s-4) 0 0; }
.empty-state p { color: var(--text-3); margin-bottom: var(--s-4); }
.ay-pagination { display: flex; justify-content: center; margin-top: var(--s-12); }

/* ---- Channel hero extras ---------------------------------------------- */
.channel-kicker { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.channel-hero .btn-ghost { margin-bottom: var(--s-5); }

/* ---- Title detail ------------------------------------------------------ */
.back-link { margin-bottom: var(--s-5); }
.detail-hero-body .lang-accent { color: var(--accent); }
.detail-hero-body .hits { color: var(--text-3); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }

.detail-two-col { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--s-12); padding: var(--s-8) 0; }
@media (max-width: 880px) { .detail-two-col { grid-template-columns: 1fr; gap: var(--s-8); } }
.block-title { display: flex; align-items: center; gap: 10px; margin: var(--s-10) 0 var(--s-5); font-size: var(--t-xl); }
.detail-main > .block-title:first-child { margin-top: 0; }
.prose { color: var(--text-2); line-height: 1.7; font-size: var(--t-md); }
.prose p { margin-bottom: var(--s-4); }

.cast-name { font-weight: 600; font-size: var(--t-sm); color: var(--text-1); }
.cast-role { font-size: 12px; color: var(--text-3); }

.info-card, .support-card { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); }
.info-card { background: var(--bg-1); }
.info-card h4 { margin-bottom: var(--s-4); }
.info-dl { display: grid; grid-template-columns: auto 1fr; gap: 10px var(--s-4); margin: 0 0 var(--s-4); font-size: var(--t-sm); }
.info-dl dt { color: var(--text-3); }
.info-dl dd { margin: 0; }
.info-dl dd.ch { font-weight: 600; color: var(--accent); }
.support-card { margin-top: var(--s-5); background: linear-gradient(135deg, var(--accent-soft), transparent); }
.support-kicker { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
.support-card p { font-size: var(--t-sm); color: var(--text-2); line-height: 1.5; margin: 0 0 var(--s-4); }
.btn-block { width: 100%; }
.player-play.is-disabled { background: var(--bg-3); color: var(--text-4); box-shadow: none; cursor: default; }

/* ---- Movie videos grid (all clips/episodes of a title) ---------------- */
.ay-videos {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--s-5);
}
.ay-video { display: flex; flex-direction: column; gap: var(--s-3); }
.ay-video-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--r-lg);
	overflow: hidden;
	background: var(--bg-2) center/cover no-repeat;
	border: 1px solid var(--border);
	transition: border-color var(--d-fast);
}
.ay-video:hover .ay-video-thumb { border-color: var(--accent); }
.ay-video-num {
	position: absolute; top: 8px; left: 8px;
	min-width: 22px; height: 22px; padding: 0 6px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: var(--r-full);
	background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
	color: var(--text-1); font-size: 11px; font-weight: 700;
}
.ay-video-play {
	position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	color: #fff;
}
.ay-video-play > * {
	width: 56px; height: 56px; border-radius: var(--r-full);
	background: rgba(0,0,0,0.45); backdrop-filter: blur(4px);
	display: inline-flex; align-items: center; justify-content: center;
	transition: all var(--d-fast);
}
.ay-video:hover .ay-video-play > * { background: var(--accent); color: var(--brand-deeper); transform: scale(1.06); }
.ay-video-title {
	font-family: var(--font-display);
	font-size: var(--t-base); font-weight: 600;
	color: var(--text-1); line-height: 1.3;
}
.ay-video:hover .ay-video-title { color: var(--accent); }

/* ---- Reviews ----------------------------------------------------------- */
.reviews { padding: var(--s-10) 0; border-top: 1px solid var(--border); }
.reviews-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: var(--s-6); }
.reviews-avg { color: var(--text-3); font-size: var(--t-sm); }
.reviews-avg strong { color: var(--accent); }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-4); margin-top: var(--s-5); }
.login-to-review {
	display: inline-flex; align-items: center; gap: 8px;
	padding: var(--s-4) var(--s-5); border-radius: var(--r-lg);
	border: 1px solid var(--border-strong); background: var(--bg-1);
	color: var(--text-2); font-size: var(--t-sm);
}
.login-to-review:hover { color: var(--text-1); border-color: var(--accent); }
.review-form-wrap { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); margin-bottom: var(--s-6); }
.review-form-wrap textarea, .review-form-wrap input[type="text"] {
	width: 100%; background: var(--bg-2); border: 1px solid var(--border);
	border-radius: var(--r-md); padding: var(--s-3); color: var(--text-1); font-family: inherit;
}

/* ---- Search page ------------------------------------------------------- */
.page-search { padding: var(--s-12) 0; }
.search-hero { display: flex; gap: var(--s-3); margin-bottom: var(--s-5); }
.search-field { flex: 1; display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-5); background: var(--bg-1); border: 1px solid var(--border-strong); border-radius: var(--r-full); color: var(--text-3); }
.search-field input { flex: 1; background: transparent; border: 0; outline: none; height: 52px; color: var(--text-1); font-size: var(--t-md); }
.search-summary { color: var(--text-3); margin-bottom: var(--s-6); }
.search-summary strong { color: var(--text-1); }

/* ---- Button styles win over Bootstrap/system CSS on component pages ---- */
.ay-site .btn-primary {
	background: var(--accent); color: var(--brand-deeper);
	border: 0; text-shadow: none;
}
.ay-site .btn-primary:hover { background: var(--accent-hot); color: var(--brand-deeper); }
.ay-site .btn-secondary {
	background: rgba(255,255,255,0.08); color: var(--text-1);
	border: 1px solid var(--border-strong);
}
[data-theme="light"] .ay-site .btn-secondary { background: rgba(11,20,48,0.06); }

/* Component CSS (.spmoviedb .btn) forces display:inline-block + tall
   line-height, which breaks icon/label vertical centring. Restore flex. */
.spmoviedb .btn,
.ay-site .btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s-2);
	line-height: 1;
	vertical-align: middle;
	white-space: nowrap;
}
.spmoviedb .btn > svg,
.ay-site .btn > svg { flex: 0 0 auto; }
.spmoviedb .btn > span,
.ay-site .btn > span { display: inline-flex; align-items: center; gap: var(--s-2); line-height: 1; }

/* ---- Search results page paddings ------------------------------------- */
.page-search { padding: var(--s-12) var(--s-8) var(--s-16); }
@media (max-width: 720px) { .page-search { padding: var(--s-8) var(--s-5) var(--s-12); } }
.page-search .grid { margin-top: var(--s-2); }

/* ---- Header live search ------------------------------------------------ */
.ay-search { position: relative; }
.search-trigger { cursor: text; }
.search-trigger .ay-search-input {
	flex: 1; min-width: 0;
	background: transparent; border: 0; outline: none;
	color: var(--text-1); font-size: var(--t-sm);
}
.search-trigger .ay-search-input::placeholder { color: var(--text-3); }

.ay-search-results {
	position: absolute; top: calc(100% + 10px); right: 0;
	width: min(420px, 92vw);
	max-height: 70vh; overflow-y: auto;
	background: var(--bg-1);
	border: 1px solid var(--border-strong);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-lg);
	z-index: 60;
	padding: var(--s-2);
}
.ay-search-results ul { list-style: none; margin: 0; padding: 0; }
.ay-search-results li { margin: 0; }
.ay-search-results li a {
	display: flex; align-items: center; gap: var(--s-3);
	padding: 8px 10px; border-radius: var(--r-md);
	color: var(--text-1); transition: background var(--d-fast);
}
.ay-search-results li a:hover { background: rgba(255,255,255,0.06); }
[data-theme="light"] .ay-search-results li a:hover { background: rgba(0,0,0,0.05); }
.ay-search-results .spmoviedb-search-movie-img {
	width: 38px !important; height: 52px; object-fit: cover;
	border-radius: var(--r-sm); flex-shrink: 0; background: var(--bg-3);
}
.ay-search-results .spmoviedb-icon-search { width: 38px; text-align: center; color: var(--text-4); }
.ay-search-results .spmoviedb-search-movie-genres {
	flex: 1; min-width: 0; font-size: var(--t-sm); font-weight: 500;
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ay-search-results .sp-moviedb-rating-wrapper {
	display: flex; align-items: center; gap: 4px;
	font-size: 11px; color: var(--text-3); flex-shrink: 0;
}
.ay-search-results .sp-moviedb-rating { color: var(--accent); }
.ay-search-results .spmoviedb-empty {
	padding: var(--s-5); text-align: center; color: var(--text-3); font-size: var(--t-sm);
}

/* ---- Hero action buttons: equal height -------------------------------- */
.hero-actions .btn { height: 52px; }

/* ---- Video popup overlay (component) ---------------------------------- */
.video-container { display: none; }
.video-container.active, .video-container[style*="block"] {
	display: flex; align-items: center; justify-content: center;
	position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.9);
}
.video-container .video-close { position: absolute; top: 24px; right: 24px; color: #fff; cursor: pointer; z-index: 2; }
.video-container iframe { width: min(92vw, 1100px); aspect-ratio: 16/9; height: auto; border: 0; border-radius: var(--r-lg); }

/* Prevent any horizontal overflow + let long words wrap everywhere */
html, body, .app { overflow-x: hidden; max-width: 100%; }
.hero-title, .detail-hero .hero-title, .card-title, .block-title, h1, h2, h3, h4 { overflow-wrap: anywhere; }

/* ---- Mobile polish ----------------------------------------------------- */
@media (max-width: 720px) {
	.hero { height: auto; min-height: 0; max-height: none; padding-bottom: var(--s-8); }
	.hero-content { padding-bottom: var(--s-6); max-width: 100%; }
	.hero-title,
	.detail-hero .hero-title { font-size: clamp(24px, 6.5vw, 34px) !important; overflow-wrap: anywhere; word-break: break-word; }
	.hero-desc { font-size: var(--t-base); }
	.hero-actions { gap: var(--s-2); }
	.hero-actions .btn { flex: 1 1 auto; }

	.detail-hero { padding-top: calc(var(--header-h) + var(--s-6)); }
	.detail-poster { max-width: 200px; margin: 0 auto; }

	.grid { grid-template-columns: repeat(2, 1fr); gap: var(--s-5) var(--s-3); }
	.card-title { font-size: var(--t-sm); }

	.player { margin: var(--s-6) 0; }
	.reviews-grid { grid-template-columns: 1fr; }
	.block-title { font-size: var(--t-lg); margin: var(--s-8) 0 var(--s-4); }

	.channel-hero-inner { flex-wrap: wrap; gap: var(--s-4); }
	.channel-mark { width: 64px; height: 64px; font-size: 22px; }

	.footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8) var(--s-5); }
	.footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
	.grid { gap: var(--s-4) var(--s-2); }
	.footer-grid { grid-template-columns: 1fr; }
}
