/* ==========================================================================
   FILMYCAB — Premium download buttons + Web Series episode section
   (fch-single.css)  ·  loaded after fch-site.css on single posts only

   1. Download buttons: 3–4 colour gradient, glowing border, shimmer,
      hover/press animation, readable typography. Used by the episode cards
      now and available to every download section through the same classes.
   2. Web Series episode section: one card per episode, qualities grouped
      inside, expandable, comfortable on phones and on desktop.
   ========================================================================== */

body.fch-site,
body.single {
	--mip-btn-grad: linear-gradient(115deg, #7c3aed 0%, #a855f7 28%, #e879f9 58%, #38bdf8 100%);
	--mip-btn-grad-hover: linear-gradient(115deg, #8b5cf6 0%, #c084fc 30%, #f0abfc 62%, #7dd3fc 100%);
	--mip-btn-line: rgba(232, 121, 249, 0.55);
	--mip-btn-glow: rgba(168, 85, 247, 0.45);
	--mip-ep-line: rgba(167, 139, 250, 0.22);
	--mip-ep-card: linear-gradient(180deg, #17151f 0%, #100f18 100%);
}

/* ---------- 1. The button ------------------------------------------------- */
a.mip-dlbtn,
.mip-dlbtn {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 42px;
	padding: 0 22px;
	border: 1px solid var(--mip-btn-line);
	border-radius: 12px;
	background: var(--mip-btn-grad) !important;
	background-size: 180% 100%;
	background-position: 0% 50%;
	color: #fff !important;
	font-family: inherit;
	font-size: 13.5px;
	font-weight: 700;
	letter-spacing: 0.045em;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.16) inset,
		0 0 14px var(--mip-btn-glow),
		0 6px 18px -6px rgba(12, 8, 24, 0.85);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.22s ease, background-position 0.45s ease, border-color 0.2s ease;
	animation: mip-btn-glow 3.6s ease-in-out infinite;
}

/* Light sweep: a narrow band that travels across the button every few
   seconds, plus a faster one on hover. */
.mip-dlbtn::after {
	content: "";
	position: absolute;
	inset: -1px;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.42) 47%, rgba(255, 255, 255, 0.12) 55%, transparent 68%);
	background-size: 240% 100%;
	background-position: 140% 0;
	animation: mip-btn-shimmer 5.2s ease-in-out infinite;
	opacity: 0.85;
}

.mip-dlbtn .mip-dlbtn__label {
	position: relative;
	z-index: 2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

.mip-dlbtn:hover,
.mip-dlbtn:focus-visible {
	background-image: var(--mip-btn-grad-hover) !important;
	background-position: 100% 50%;
	border-color: rgba(255, 255, 255, 0.55);
	color: #fff !important;
	transform: translateY(-2px);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.28) inset,
		0 0 26px var(--mip-btn-glow),
		0 12px 26px -10px rgba(10, 6, 22, 0.9);
	animation-play-state: paused;
}

.mip-dlbtn:hover::after,
.mip-dlbtn:focus-visible::after {
	animation-duration: 1.15s;
	opacity: 1;
}

.mip-dlbtn:active {
	transform: translateY(1px) scale(0.985);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.22) inset,
		0 0 12px var(--mip-btn-glow);
}

.mip-dlbtn:focus-visible {
	outline: 2px solid #f0abfc;
	outline-offset: 3px;
}

/* Small variant used inside an episode card: slightly smaller than the
   download buttons of the movie section, as requested. */
.mip-dlbtn--sm {
	min-height: 36px;
	padding: 0 16px;
	border-radius: 10px;
	font-size: 12.5px;
	letter-spacing: 0.035em;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.14) inset,
		0 0 10px var(--mip-btn-glow),
		0 4px 12px -5px rgba(12, 8, 24, 0.8);
}

/* The big "all episodes" button: the same skin, one step larger. */
.mip-episodes__all-btn {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 26px;
	border-radius: 12px;
	border: 1px solid var(--mip-btn-line);
	background: var(--mip-btn-grad) !important;
	background-size: 180% 100%;
	color: #fff !important;
	font-size: 14.5px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none !important;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.16) inset,
		0 0 16px var(--mip-btn-glow),
		0 8px 20px -8px rgba(12, 8, 24, 0.85);
	transition: transform 0.18s ease, box-shadow 0.22s ease, background-position 0.45s ease;
	animation: mip-btn-glow 3.6s ease-in-out infinite;
}
.mip-episodes__all-btn::after {
	content: "";
	position: absolute;
	inset: -1px;
	pointer-events: none;
	background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.4) 47%, transparent 68%);
	background-size: 240% 100%;
	background-position: 140% 0;
	animation: mip-btn-shimmer 5.2s ease-in-out infinite;
}
.mip-episodes__all-btn:hover,
.mip-episodes__all-btn:focus-visible {
	transform: translateY(-2px);
	border-color: rgba(255, 255, 255, 0.55);
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.28) inset,
		0 0 26px var(--mip-btn-glow),
		0 12px 26px -10px rgba(10, 6, 22, 0.9);
}
.mip-episodes__all-btn:active { transform: translateY(1px) scale(0.99); }

@keyframes mip-btn-shimmer {
	0%   { background-position: 140% 0; }
	55%  { background-position: -40% 0; }
	100% { background-position: -40% 0; }
}
@keyframes mip-btn-glow {
	0%, 100% { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset, 0 0 12px var(--mip-btn-glow), 0 6px 18px -6px rgba(12, 8, 24, 0.85); }
	50%      { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset, 0 0 22px var(--mip-btn-glow), 0 6px 18px -6px rgba(12, 8, 24, 0.85); }
}

/* ---------- 2. The episode section --------------------------------------- */
.mip-episodes {
	margin: 4px 0 8px;
}

.mip-episodes__all {
	display: flex;
	justify-content: center;
	margin: 6px 0 18px;
}

.mip-episodes__all-btn { max-width: 100%; }
.mip-episodes__all-btn > span:last-child {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mip-episodes__all-ico { font-size: 16px; line-height: 1; }

.mip-episodes__list {
	display: grid;
	gap: 14px;
}

/* One episode = one card. */
.mip-ep {
	position: relative;
	border: 1px solid var(--mip-ep-line);
	border-radius: 14px;
	background: var(--mip-ep-card);
	box-shadow: 0 10px 26px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
	overflow: hidden;
}

.mip-ep[open] {
	border-color: rgba(196, 181, 253, 0.42);
	box-shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.95), 0 0 22px -8px rgba(139, 92, 246, 0.4);
}

/* Header: the whole row is the toggle. */
.mip-ep__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	cursor: pointer;
	list-style: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background 0.2s ease;
}
.mip-ep__head::-webkit-details-marker { display: none; }
.mip-ep__head:hover { background: rgba(167, 139, 250, 0.06); }

.mip-ep__badge {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 62px;
	height: 34px;
	padding: 0 12px;
	border-radius: 9px;
	background: linear-gradient(135deg, rgba(124, 58, 237, 0.9), rgba(232, 121, 249, 0.85));
	border: 1px solid rgba(255, 255, 255, 0.22);
	color: #fff;
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	box-shadow: 0 4px 14px -6px rgba(139, 92, 246, 0.8);
}

.mip-ep__titles {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.mip-ep__title {
	color: #ffffff;
	font-size: 16px;
	font-weight: 800;
	letter-spacing: 0.01em;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mip-ep__meta {
	color: #a9a4c4;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.02em;
}

.mip-ep__chev {
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	border-right: 2px solid #c4b5fd;
	border-bottom: 2px solid #c4b5fd;
	transform: rotate(45deg) translate(-2px, -2px);
	transition: transform 0.25s ease;
}
.mip-ep[open] .mip-ep__chev {
	transform: rotate(225deg) translate(-2px, -2px);
}

/* Body: one row per quality, its label, its size and its button(s). */
.mip-ep__body {
	padding: 2px 16px 16px;
	border-top: 1px solid rgba(167, 139, 250, 0.12);
}

.mip-ep__row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	padding: 12px 0;
	border-bottom: 1px dashed rgba(167, 139, 250, 0.12);
}
.mip-ep__row:last-child { border-bottom: 0; padding-bottom: 2px; }

.mip-ep__qinfo {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-width: 0;
	width: 100%;
}

.mip-q {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 62px;
	height: 26px;
	padding: 0 10px;
	border-radius: 7px;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: 0.03em;
	color: #fff;
	border: 1px solid transparent;
	white-space: nowrap;
}

/* Quality colour coding: 4K violet, 1080p blue, 720p green, 480p amber. */
.mip-q-4k     { background: rgba(147, 51, 234, 0.22); border-color: rgba(192, 132, 252, 0.55); color: #e9d5ff; }
.mip-q-1080   { background: rgba(37, 99, 235, 0.2);  border-color: rgba(96, 165, 250, 0.55); color: #dbeafe; }
.mip-q-720    { background: rgba(22, 101, 52, 0.24); border-color: rgba(74, 222, 128, 0.45); color: #dcfce7; }
.mip-q-480    { background: rgba(180, 83, 9, 0.24);  border-color: rgba(251, 191, 36, 0.45); color: #fef3c7; }
.mip-q-other  { background: rgba(71, 85, 105, 0.3);  border-color: rgba(148, 163, 184, 0.45); color: #e2e8f0; }

.mip-ep__size {
	color: #b7b2d2;
	font-size: 12.5px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

/* One column only: every download button gets its own full-width row,
   never two side by side. */
.mip-ep__links {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}
.mip-ep__links .mip-dlbtn {
	flex: 1 1 100%;
	width: 100%;
}

/* ---------- Mobile ------------------------------------------------------- */
@media (max-width: 640px) {
	.mip-episodes__list { gap: 11px; }
	.mip-ep__head { padding: 12px 13px; gap: 10px; }
	.mip-ep__badge { min-width: 54px; height: 30px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
	.mip-ep__title { font-size: 14.5px; }
	.mip-ep__meta { font-size: 11.5px; }
	.mip-ep__body { padding: 0 13px 12px; }
	.mip-ep__row { gap: 8px; padding: 11px 0; }
	.mip-dlbtn--sm { min-height: 38px; font-size: 12px; }
	.mip-episodes__all-btn { width: 100%; min-height: 44px; font-size: 13px; padding: 0 14px; }
	.mip-episodes__all-btn > span:last-child { white-space: normal; }
}

@media (max-width: 359px) {
	.mip-ep__badge { min-width: 48px; font-size: 11px; padding: 0 7px; }
	.mip-ep__links .mip-dlbtn { flex: 1 1 100%; }
}

/* ---------- Motion preferences / no-animation fallbacks ------------------ */
@media (prefers-reduced-motion: reduce) {
	.mip-dlbtn,
	.mip-episodes__all-btn { animation: none !important; transition: none !important; }
	.mip-dlbtn::after,
	.mip-episodes__all-btn::after { animation: none !important; opacity: 0 !important; }
}
