/* ApiShop Drama Search — scoped to .asds / .asds-overlay so the theme is left alone.
 * Colors come from Drama Search → Colors & Style, printed as overrides of the variables below. */
.asds {
	--asds-accent: #e11d48;
	--asds-text: inherit;
	--asds-muted: rgba(127, 127, 127, .95);
	--asds-line: rgba(127, 127, 127, .35);
	--asds-card: rgba(127, 127, 127, .12);
	max-width: 960px;
	margin: 0 auto 1.5em;
	box-sizing: border-box;
	font-size: 16px;
}
.asds *, .asds *::before, .asds *::after { box-sizing: border-box; }
.asds .asds-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Bar */
.asds .asds-form { position: relative; display: flex; margin: 0; padding: 0; }
.asds .asds-input {
	flex: 1 1 auto; width: 100%; min-width: 0; height: 48px; margin: 0;
	padding: 0 54px 0 18px; border: 1px solid var(--asds-bar-border, var(--asds-line)); border-radius: var(--asds-radius, 999px);
	background: var(--asds-bar-bg, transparent); color: var(--asds-bar-text, inherit); font: inherit; font-size: 16px; line-height: 48px;
	box-shadow: none; outline: none; -webkit-appearance: none; appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.asds .asds-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.asds .asds-input:focus { border-color: var(--asds-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--asds-accent) 22%, transparent); }
.asds .asds-go {
	position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; min-width: 0; margin: 0; padding: 0;
	display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: var(--asds-go-radius, 50%); background: var(--asds-accent); color: var(--asds-on-accent, #fff); cursor: pointer; line-height: 1; box-shadow: none;
}
.asds .asds-go:hover, .asds .asds-go:focus { background: var(--asds-accent); color: var(--asds-on-accent, #fff); filter: brightness(1.08); }
.asds.asds-busy .asds-go svg { animation: asds-pulse .9s ease-in-out infinite; }

/* Status line */
.asds .asds-status { min-height: 0; margin: 10px 4px 0; font-size: 14px; line-height: 1.45; color: var(--asds-muted); }
.asds .asds-status:empty { display: none; }
.asds .asds-status.asds-note { color: inherit; }

/* Results */
.asds .asds-grid {
	display: grid; gap: 14px 12px; margin-top: 14px;
	grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}
@media (min-width: 600px) { .asds .asds-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 16px; } }
.asds .asds-card { display: block; min-width: 0; color: inherit; text-decoration: none; border: 0; box-shadow: none; }
.asds .asds-card:hover .asds-poster img, .asds .asds-card:focus .asds-poster img { transform: scale(1.04); }
.asds .asds-card:focus-visible { outline: 2px solid var(--asds-accent); outline-offset: 3px; border-radius: 10px; }
.asds .asds-poster {
	position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden;
	border-radius: 10px; background: var(--asds-card);
}
@supports not (aspect-ratio: 2 / 3) { .asds .asds-poster { height: 0; padding-top: 150%; } }
.asds .asds-poster img { position: absolute; inset: 0; top: 0; left: 0; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; transition: transform .25s; }
.asds-noimg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(127,127,127,.18), rgba(127,127,127,.05)); }
.asds .asds-title {
	display: -webkit-box; margin-top: 7px; overflow: hidden;
	font-size: 14px; font-weight: 600; line-height: 1.3;
	-webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.asds .asds-eps { display: block; margin-top: 3px; font-size: 12px; line-height: 1.3; color: var(--asds-muted); }
.asds .asds-head { margin: 22px 4px 0; font-size: 14px; font-weight: 700; }

.asds .asds-more, .asds-overlay .asds-more {
	display: inline-block; margin: 16px 0 0; padding: 10px 18px; min-height: 0;
	border: 1px solid var(--asds-accent); border-radius: 999px; background: transparent;
	color: var(--asds-accent); font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer; box-shadow: none; text-transform: none;
}
.asds .asds-more:hover, .asds-overlay .asds-more:hover { background: var(--asds-accent); color: var(--asds-on-accent, #fff); }

/* "Can't find your drama? Load more" tile — sits at the end of the results, poster-sized. */
.asds .asds-load {
	/* A <button> centres its content vertically: stack it from the top instead, and don't let the
	   grid stretch the tile to the row height, so it lines up with the posters next to it. */
	display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
	align-self: start; justify-self: stretch; vertical-align: top; height: auto;
	width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0;
	border: 0; border-radius: 0; background: none; color: inherit; font: inherit; line-height: inherit;
	text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer; box-shadow: none;
	-webkit-appearance: none; appearance: none;
}
.asds .asds-load:hover, .asds .asds-load:focus { background: none; color: inherit; }
.asds .asds-load:focus-visible { outline: 2px solid var(--asds-accent); outline-offset: 3px; border-radius: 10px; }
.asds .asds-load[disabled] { cursor: progress; }
.asds .asds-load-box {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	padding: 10px; text-align: center;
	border: 1.5px dashed var(--asds-accent);
	border: 1.5px dashed color-mix(in srgb, var(--asds-accent) 60%, transparent);
	background: var(--asds-card);
	background: color-mix(in srgb, var(--asds-accent) 7%, var(--asds-card));
	transition: border-color .15s, background .15s;
}
.asds .asds-load:hover .asds-load-box, .asds .asds-load:focus-visible .asds-load-box {
	border-style: solid; border-color: var(--asds-accent);
	background: color-mix(in srgb, var(--asds-accent) 14%, var(--asds-card));
}
.asds .asds-load-icon { position: relative; display: block; width: 48px; height: 48px; margin-bottom: 4px; color: var(--asds-accent); transition: transform .2s; }
.asds .asds-load-icon svg { display: block; width: 100%; height: 100%; }
.asds .asds-load:hover .asds-load-icon { transform: scale(1.08); }
.asds .asds-load-q { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.asds .asds-load-go { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--asds-accent); }
.asds .asds-load.asds-loading .asds-load-icon svg { opacity: 0; }
.asds .asds-load.asds-loading .asds-load-icon::after {
	content: ""; position: absolute; inset: 4px; top: 4px; left: 4px; right: 4px; bottom: 4px;
	border: 3px solid rgba(127, 127, 127, .3); border-top-color: var(--asds-accent); border-radius: 50%;
	animation: asds-spin .8s linear infinite;
}

/* Loading screen while a drama is being added */
html.asds-lock, html.asds-lock body { overflow: hidden; }
.asds-overlay {
	--asds-accent: #e11d48;
	position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0; z-index: 999999;
	display: flex; align-items: center; justify-content: center; padding: 20px;
	background: var(--asds-ov-bg, rgba(0, 0, 0, .86)); color: var(--asds-ov-text, #fff); font-size: 16px;
	animation: asds-fade .2s ease-out;
}
.asds-overlay * { box-sizing: border-box; }
.asds-overlay .asds-sheet { position: relative; width: 100%; max-width: 320px; text-align: center; outline: none; }
.asds-overlay .asds-x {
	position: absolute; top: -8px; right: -4px; width: 36px; height: 36px; margin: 0; padding: 0; min-width: 0;
	border: 0; border-radius: 50%; background: rgba(var(--asds-ov-ink, 255, 255, 255), .12); color: inherit; font-size: 22px; line-height: 36px; cursor: pointer; box-shadow: none;
}
.asds-overlay .asds-ov-poster {
	position: relative; width: 132px; margin: 0 auto; aspect-ratio: 2 / 3; overflow: hidden;
	border-radius: 12px; background: rgba(var(--asds-ov-ink, 255, 255, 255), .08); box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
}
@supports not (aspect-ratio: 2 / 3) { .asds-overlay .asds-ov-poster { height: 198px; } }
.asds-overlay .asds-ov-poster img { position: absolute; inset: 0; top: 0; left: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.asds-overlay .asds-ov-title { margin: 16px 0 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
.asds-overlay .asds-ring { position: relative; width: 64px; height: 64px; margin: 18px auto 0; }
.asds-overlay .asds-ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.asds-overlay .asds-ring circle { fill: none; stroke-width: 5; }
.asds-overlay .asds-ring-bg { stroke: rgba(var(--asds-ov-ink, 255, 255, 255), .15); }
.asds-overlay .asds-ring-fg { stroke: var(--asds-accent); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.asds-overlay .asds-ring.asds-spin svg { animation: asds-rot 1s linear infinite; }
.asds-overlay .asds-ring.asds-spin .asds-ring-fg { stroke-dashoffset: 120 !important; }
.asds-overlay .asds-ring-num { position: absolute; inset: 0; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; }
.asds-overlay .asds-ov-msg { margin-top: 12px; font-size: 14px; line-height: 1.45; color: rgba(var(--asds-ov-ink, 255, 255, 255), .8); }
.asds-overlay .asds-bar { height: 4px; margin: 14px auto 0; max-width: 220px; overflow: hidden; border-radius: 4px; background: rgba(var(--asds-ov-ink, 255, 255, 255), .15); }
.asds-overlay .asds-bar span { display: block; width: 0; height: 100%; background: var(--asds-accent); transition: width .1s linear; }
.asds-overlay.asds-failed .asds-bar { display: none; }

@keyframes asds-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes asds-rot { from { transform: rotate(-90deg); } to { transform: rotate(270deg); } }
@keyframes asds-spin { to { transform: rotate(360deg); } }
@keyframes asds-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
	.asds *, .asds-overlay * { animation: none !important; transition: none !important; }
}
