/*
 * Movie Dashboard: public "Lịch chiếu phim" page ([md_lich_chieu]).
 * Mobile first: base rules are the phone layout, then 768px (tablet) and
 * 1024px (desktop). Everything is scoped to .mdl so theme styles stay intact.
 */
.mdl {
	--mdl-row: 84px;
	min-width: 0;
	max-width: 100%;
	--mdl-accent: #c58560;
	--mdl-accent-soft: #da966e;
	--mdl-accent-text: #f0b28c;
	--mdl-purple: #522e75;
	--mdl-surface: #101720;
	--mdl-surface-2: #1d2633;
	--mdl-chip: #141d29;
	--mdl-line: #1f2a38;
	--mdl-line-2: #2f3d50;
	--mdl-text: #e6e6e6;
	--mdl-muted: #a7b0ba;
	display: flex;
	flex-direction: column;
	gap: 18px;
	margin: 8px 0 24px;
	color: var(--mdl-text);
	font-size: 14px;
	line-height: 1.4;
	text-align: left;
}

.mdl *,
.mdl *::before,
.mdl *::after {
	box-sizing: border-box;
}

.mdl p {
	margin: 0;
}

.mdl .mdl-sub,
.mdl .mdl-note {
	color: var(--mdl-muted);
	font-size: 12px;
}

/* Day tabs: one swipeable row on phones. */
.mdl .mdl-days {
	display: flex;
	gap: 8px;
	max-width: 100%;
	margin: 0;
	padding: 0 0 4px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.mdl .mdl-days::-webkit-scrollbar {
	display: none;
}

.mdl .mdl-day {
	flex: 0 0 auto;
	min-width: 76px;
	min-height: 48px;
	margin: 0;
	padding: 6px 10px;
	border: 1px solid #2a3646;
	border-radius: 8px;
	background: var(--mdl-surface);
	color: var(--mdl-text);
	font: inherit;
	text-align: center;
	cursor: pointer;
	scroll-snap-align: start;
}

.mdl .mdl-day b,
.mdl .mdl-day small {
	display: block;
}

.mdl .mdl-day b {
	font-size: 13px;
}

.mdl .mdl-day small {
	margin-top: 2px;
	font-size: 11px;
}

.mdl .mdl-day.is-on {
	border-color: var(--mdl-accent);
	background: var(--mdl-accent);
	color: #1a0f08;
}

.mdl .mdl-day:focus-visible,
.mdl .mdl-list:focus-visible,
.mdl .mdl-arrow:focus-visible,
.mdl a:focus-visible {
	outline: 2px solid var(--mdl-accent-text);
	outline-offset: 2px;
}

/* Sections. */
.mdl .mdl-sec {
	overflow: hidden;
	border: 1px solid var(--mdl-line);
	border-radius: 10px;
	background: var(--mdl-surface);
}

.mdl .mdl-sec-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 12px 14px;
	border-bottom: 1px solid var(--mdl-line);
}

.mdl .mdl-h2 {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--mdl-accent-soft);
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
}

.mdl .mdl-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
}

.mdl .mdl-badges[hidden],
.mdl .mdl-panel[hidden] {
	display: none;
}

.mdl .mdl-b {
	padding: 2px 9px;
	border: 1px solid var(--mdl-line-2);
	border-radius: 999px;
	color: #c9d1da;
	font-size: 11px;
	white-space: nowrap;
}

.mdl .mdl-b.is-day {
	border-color: var(--mdl-accent);
	background: #2a1d17;
	color: var(--mdl-accent-text);
	font-weight: 700;
}

.mdl .mdl-b.is-count {
	border-color: var(--mdl-purple);
	background: var(--mdl-purple);
	color: #fff;
	font-weight: 700;
}

/* At most --mdl-rows titles, then the list scrolls. */
.mdl .mdl-list {
	max-height: calc(var(--mdl-row) * var(--mdl-rows, 5));
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--mdl-accent) var(--mdl-surface);
}

.mdl .mdl-row {
	display: flex;
	align-items: center;
	gap: 12px;
	height: var(--mdl-row);
	padding: 10px 14px;
	border-bottom: 1px solid #18212d;
}

.mdl .mdl-poster {
	flex: 0 0 44px;
	width: 44px;
	height: 62px;
	border-radius: 5px;
	background: var(--mdl-surface-2);
	object-fit: cover;
}

.mdl .mdl-info {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
}

.mdl .mdl-title {
	align-self: flex-start;
	max-width: 100%;
	overflow: hidden;
	padding: 3px 9px;
	border: 1px solid var(--mdl-line-2);
	border-radius: 6px;
	background: var(--mdl-surface-2);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mdl .mdl-title:hover {
	border-color: var(--mdl-accent);
	color: var(--mdl-accent-text);
}

.mdl .mdl-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	max-height: 20px;
	overflow: hidden;
}

.mdl .mdl-tag {
	padding: 1px 8px;
	border: 1px solid var(--mdl-line-2);
	border-radius: 999px;
	background: var(--mdl-chip);
	color: #c9d1da;
	font-size: 11px;
	white-space: nowrap;
}

.mdl .mdl-ep {
	flex: 0 0 auto;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--mdl-purple);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}

.mdl .mdl-watch {
	display: none;
}

.mdl .mdl-empty {
	padding: 18px 14px;
	color: var(--mdl-muted);
	font-size: 13px;
}

/* Upcoming: a strip you drag (mouse) or swipe (touch). */
.mdl .mdl-arrows {
	display: none;
	gap: 8px;
}

.mdl .mdl-arrow {
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid #2a3646;
	border-radius: 999px;
	background: var(--mdl-surface);
	color: var(--mdl-text);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.mdl .mdl-strip {
	display: flex;
	gap: 12px;
	padding: 14px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	/* Snapping keeps the strip padding, so the first card never sits on the edge. */
	scroll-padding-inline: 14px;
	scrollbar-width: none;
	cursor: grab;
	-webkit-overflow-scrolling: touch;
}

.mdl .mdl-strip::-webkit-scrollbar {
	display: none;
}

.mdl .mdl-strip.is-drag {
	scroll-snap-type: none;
	cursor: grabbing;
}

/* Phone: two cards and a peek of the third, so the strip reads as swipeable. */
.mdl .mdl-card {
	display: flex;
	flex: 0 0 calc((100% - 24px) / 2.35);
	flex-direction: column;
	gap: 8px;
	overflow: hidden;
	/* Inner padding: the poster sits in the card like a framed photo. */
	padding: 8px 8px 10px;
	border: 1px solid var(--mdl-line);
	border-radius: 10px;
	background: var(--mdl-surface-2);
	color: var(--mdl-text);
	text-decoration: none;
	scroll-snap-align: start;
	user-select: none;
	-webkit-user-drag: none;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.mdl .mdl-card:hover {
	border-color: var(--mdl-accent);
	color: var(--mdl-text);
	text-decoration: none;
}

.mdl .mdl-card:focus-visible {
	outline: 2px solid var(--mdl-accent-text);
	outline-offset: 2px;
}

/* On TMDB, not on the site yet: no link, so no hover cue. */
.mdl .mdl-card.is-tmdb:hover {
	border-color: var(--mdl-line);
	transform: none;
}

.mdl .mdl-card-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 18 / 25;
	border-radius: 6px;
	background: var(--mdl-surface);
	object-fit: cover;
	pointer-events: none;
}

.mdl .mdl-card-title {
	display: -webkit-box;
	min-height: 2.8em;
	overflow: hidden;
	padding: 0 2px;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

/* Premiere date as a badge, like the badges in the other sections. */
.mdl .mdl-date {
	align-self: flex-start;
	max-width: calc(100% - 4px);
	margin: auto 2px 0;
	padding: 3px 8px;
	border: 1px solid rgba(218, 150, 110, 0.35);
	border-radius: 6px;
	background: rgba(197, 133, 96, 0.14);
	color: var(--mdl-accent-text);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.35;
}

.mdl .mdl-date.is-none {
	border-color: var(--mdl-line-2);
	background: var(--mdl-chip);
	color: var(--mdl-muted);
	font-weight: 600;
}

@media (hover: hover) {
	.mdl .mdl-card:hover {
		transform: translateY(-3px);
	}

	.mdl .mdl-arrow:hover {
		border-color: var(--mdl-accent);
		color: var(--mdl-accent-text);
	}
}

/* Tablet. */
@media (min-width: 768px) {
	.mdl {
		--mdl-row: 94px;
		gap: 22px;
	}

	.mdl .mdl-day {
		min-width: 92px;
	}

	.mdl .mdl-h2 {
		font-size: 16px;
	}

	.mdl .mdl-b {
		font-size: 12px;
	}

	.mdl .mdl-row {
		gap: 14px;
		padding: 12px 18px;
	}

	.mdl .mdl-poster {
		flex-basis: 50px;
		width: 50px;
		height: 70px;
	}

	.mdl .mdl-title {
		font-size: 15px;
	}

	.mdl .mdl-tag {
		font-size: 12px;
	}

	.mdl .mdl-watch {
		display: inline-flex;
		flex: 0 0 auto;
		align-items: center;
		min-height: 36px;
		padding: 8px 16px;
		border-radius: 6px;
		background: var(--mdl-accent);
		color: #1a0f08;
		font-weight: 700;
		text-decoration: none;
	}

	.mdl .mdl-watch:hover {
		background: var(--mdl-accent-text);
		color: #1a0f08;
	}

	.mdl .mdl-arrows {
		display: inline-flex;
	}

	.mdl .mdl-strip {
		gap: 16px;
		padding: 18px;
		scroll-padding-inline: 18px;
	}

	/* Tablet: four cards per view. */
	.mdl .mdl-card {
		flex-basis: calc((100% - 48px) / 4);
	}
}

/* Desktop. */
@media (min-width: 1024px) {
	.mdl {
		--mdl-row: 99px;
		gap: 24px;
	}

	/* Seven equal tabs on one row, even in the theme's ~670px content column. */
	.mdl .mdl-days {
		overflow: visible;
	}

	.mdl .mdl-day {
		flex: 1 1 0;
		min-width: 0;
		padding: 6px 4px;
	}

	.mdl .mdl-poster {
		flex-basis: 52px;
		width: 52px;
		height: 74px;
	}

	/* Desktop: five cards per view. */
	.mdl .mdl-card {
		flex-basis: calc((100% - 64px) / 5);
		flex-basis: max(150px, calc((100% - 64px) / 5));
	}
}

@media (prefers-reduced-motion: reduce) {
	.mdl .mdl-card {
		transition: none;
	}

	.mdl .mdl-card:hover {
		transform: none;
	}

	.mdl .mdl-strip,
	.mdl .mdl-days {
		scroll-behavior: auto;
	}
}

/*
 * Page frame (CSS only, theme files untouched): on the page that holds the
 * schedule, the theme's 980px two-column box widens to the 1300px of the
 * header, the schedule column takes the room and the sidebar keeps 300px.
 * The page title and the "Cập nhật" line become one header panel.
 */
@media (min-width: 980px) {
	body:has(.mdl) #content .main-content > .container:has(.mdl) {
		display: flex;
		align-items: flex-start;
		gap: 24px;
		width: 100%;
		max-width: 1300px;
		box-sizing: border-box;
	}

	/* The clearfix boxes would become flex items and add a gap. */
	body:has(.mdl) #content .main-content > .container:has(.mdl) > .clear,
	body:has(.mdl) #content .main-content > .container:has(.mdl)::before,
	body:has(.mdl) #content .main-content > .container:has(.mdl)::after {
		display: none;
	}

	body:has(.mdl) #content .main-content > .container:has(.mdl) > .left-content {
		flex: 1 1 0;
		min-width: 0;
		width: auto;
		float: none;
		margin: 0 0 20px;
	}

	body:has(.mdl) #content .main-content > .container:has(.mdl) > .right-content {
		flex: 0 0 300px;
		width: 300px;
		float: none;
	}
}

/* Same side padding as the header below 1200px. */
@media (min-width: 980px) and (max-width: 1199px) {
	body:has(.mdl) #content .main-content > .container:has(.mdl) {
		padding-left: 16px;
		padding-right: 16px;
	}
}

.group-film:has(> .content > .mdl) > h1 {
	position: relative;
	margin: 0;
	padding: 18px 18px 6px 32px;
	border: 1px solid #1f2a38;
	border-bottom: 0;
	border-radius: 12px 12px 0 0;
	background: #101720;
	color: #ffffff;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.2px;
}

.group-film:has(> .content > .mdl) > h1::before {
	content: "";
	position: absolute;
	top: 20px;
	bottom: 8px;
	left: 18px;
	width: 4px;
	border-radius: 2px;
	background: linear-gradient(180deg, #f0b28c, #c58560 55%, #522e75);
}

.group-film:has(> .content > .mdl) > .content > .mdl {
	margin-top: 0;
}

.group-film:has(> .content > .mdl) > .content > .mdl > .mdl-sub:first-child {
	margin: 0 0 4px;
	padding: 0 18px 16px 32px;
	border: 1px solid var(--mdl-line);
	border-top: 0;
	border-radius: 0 0 12px 12px;
	background: var(--mdl-surface);
	box-shadow: inset 0 -2px 0 rgba(197, 133, 96, 0.35);
	font-size: 13px;
}

@media (min-width: 768px) {
	.group-film:has(> .content > .mdl) > h1 {
		padding: 22px 24px 6px 40px;
		font-size: 30px;
	}

	.group-film:has(> .content > .mdl) > h1::before {
		top: 25px;
		bottom: 9px;
		left: 24px;
	}

	.group-film:has(> .content > .mdl) > .content > .mdl > .mdl-sub:first-child {
		padding: 0 24px 18px 40px;
	}
}
