/*
WSB Videos
- Shared styles for library + player
- NOTE: Keep selectors scoped to wsb-* to avoid theme collisions.
*/

/* ===== Layout ===== */
.wsb-videos-wrap {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
	background: #fff;
	padding: 100px 0 100px;
	justify-content: center;
}

.wsb-videos-left {
	flex: 2;
	min-width: 320px;
	max-width: 960px;
}

.wsb-videos-right {
	flex: 1;
	min-width: 280px;
	max-width: 420px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
}

.wsb-videos-title {
	margin-top: 0;
}

.wsb-videos-search-form {
	margin: 0;
}

.wsb-videos-search {
	width: 100%;
	padding: 10px;
	border: 1px solid #ccc;
	border-radius: 8px;
}

.wsb-videos-search-row {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.wsb-videos-search-row .wsb-videos-search {
	flex: 1 1 220px;
	min-width: 0;
}

.wsb-videos-search-clear {
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	text-decoration: none;
	white-space: nowrap;
}

.wsb-videos-search-clear:hover {
	background: #f6f6f6;
}

.wsb-videos-search-submit {
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	white-space: nowrap;
	appearance: none;
	-webkit-appearance: none;
}

.wsb-videos-search-submit:hover {
	background: #f6f6f6;
}

@media (max-width: 520px) {
	.wsb-videos-search-row .wsb-videos-search {
		flex-basis: 100%;
	}
}

.wsb-videos-search-note {
	margin: 0;
	/* opacity: 0.85; */
    font-size: 0.95em;
    font-weight: bold;
    text-transform: uppercase;
    color: #00a654;
}


/* ===== Player ===== */
.wsb-video-el {
	width: 100%;
	max-width: 960px;
	height: auto;
	background: #000;
	border-radius: 12px;
}

.wsb-videos-resume-note {
	opacity: 0.75;
	margin-top: -10px;
	margin-bottom: 10px;
}

.wsb-videos-controls {
	display: flex;
	gap: 10px;
	align-items: center;
	margin: -6px 0 12px 0;
	flex-wrap: wrap;
}

.wsb-videos-controls button {
	padding: 8px 12px;
	border-radius: 10px;
	border: 1px solid #ccc;
	background: #fff;
	cursor: pointer;
}

/* Expandable panels */
.wsb-videos-panel {
	margin: 0;
}

.wsb-videos-panel summary {
	cursor: pointer;
	font-weight: 650;
	padding: 10px 12px;
	border: 1px solid #eee;
	border-radius: 10px;
	background: #fafafa;
	user-select: none;
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.wsb-videos-panel summary::-webkit-details-marker {
	display: none;
}

.wsb-videos-panel summary::marker {
	content: "";
}

.wsb-videos-panel summary::after {
	content: "Tap to expand ▾";
	font-size: 0.9em;
	opacity: 0.8;
	font-weight: 600;
	white-space: nowrap;
}

.wsb-videos-panel[open] summary {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.wsb-videos-panel[open] summary::after {
	content: "Tap to collapse ▴";
}

.wsb-videos-panel summary:active {
	transform: translateY(1px);
}

.wsb-videos-panel-body {
	margin-top: 0;
	border: 1px solid #eee;
	border-top: none;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	background: #fff;
	padding: 12px;
	box-sizing: border-box;
	width: 100%;
}

/* Transcript */
.wsb-videos-transcript-title {
	margin: 16px 0 8px;
}

.wsb-videos-transcript {
	white-space: pre-line;
	background: #fff;
	max-height: 1100px;
	overflow: auto;
}

.wsb-videos-transcript-panel {
	margin-top: 16px;
	margin-bottom: 16px;
}

.wsb-videos-transcript-panel .wsb-videos-panel-body {
	padding: 0;
	overflow: hidden;
}

.wsb-videos-transcript-panel .wsb-videos-transcript {
	border: none;
	padding: 12px;
	margin: 0;
	max-height: min(70vh, 1100px);
}

.wsb-videos-mobile-divider {
	display: none;
	width: 100%;
	margin: 18px 0;
	border: 0;
	border-top: 1px solid #eee;
}

/* ===== Cards (Library + Continue Watching) ===== */
.wsb-videos-item {
	display: block;
	text-decoration: none;
	color: inherit;
}

.wsb-videos-playlist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
}

.wsb-videos-playlist--rail,
.wsb-videos-cw-list {
	grid-template-columns: 1fr;
}

.wsb-videos-library-scroll {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-height: 0;
}

.wsb-videos-library-scroll .wsb-videos-pagination {
	margin: 0;
}

@media (min-width: 960px) {
	.wsb-videos-library-scroll {
		max-height: min(72vh, 980px);
		overflow: auto;
		padding-right: 4px;
		scrollbar-gutter: stable;
	}
}

.wsb-videos-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	border: 1px solid #eee;
	border-radius: 14px;
	padding: 10px;
	background: #fff;
	transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.wsb-videos-item:hover .wsb-videos-card {
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.wsb-videos-card-media {
	position: relative;
	width: 100%;
	aspect-ratio: 16/9;
	background: #111;
	border-radius: 12px;
	overflow: hidden;
}

.wsb-videos-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wsb-videos-hover-preview {
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 0.12s ease;
}

.wsb-videos-item.wsb-story-ready:hover .wsb-videos-hover-preview {
	opacity: 1;
}

.wsb-videos-card-title {
	font-weight: 650;
	line-height: 1.25;
	margin: 0;
}

.wsb-videos-tags {
	font-size: 12px;
	opacity: 0.7;
	margin-top: 2px;
}

/* Truncate tags only inside cards */
.wsb-videos-card .wsb-videos-tags {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wsb-videos-item.is-active .wsb-videos-card {
	outline: 3px solid rgba(0, 0, 0, 0.22);
}

/* ===== Pagination ===== */
.wsb-videos-pagination {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin: 10px 0;
}

.wsb-videos-page {
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
	text-decoration: none;
	display: inline-block;
}

.wsb-videos-page.is-current {
	background: #333;
	color: #fff;
	border-color: #333;
}

.wsb-videos-page.is-disabled {
	opacity: 0.55;
	background: #fafafa;
	border-color: #eee;
}

.wsb-videos-ellipsis {
	opacity: 0.6;
}

.wsb-videos-page-note {
	margin-left: 6px;
	opacity: 0.7;
	font-size: 12px;
}

/* ===== Continue Watching ===== */
.wsb-videos-continue-panel .wsb-videos-panel-body {
	padding: 12px;
}

.wsb-videos-cw-item {
	padding: 0;
}

.wsb-videos-cw-list .wsb-videos-card {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.wsb-videos-cw-badge {
	position: absolute;
	left: 8px;
	bottom: 8px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	max-width: calc(100% - 16px);
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	backdrop-filter: blur(4px);
}

.wsb-videos-cw-note {
	font-size: 12px;
	opacity: 0.82;
	margin: 0;
}

/* ===== Player "Up Next" overlay ===== */
.wsb-video-wrap {
	position: relative;
	width: 100%;
	max-width: 100%;
}

.wsb-next-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 12px;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.wsb-next-overlay.is-show {
	opacity: 1;
	pointer-events: auto;
}

.wsb-next-overlay::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.15) 60%, rgba(0, 0, 0, 0));
}

.wsb-next-card {
	position: relative;
	z-index: 1;
	width: min(560px, calc(100% - 16px));
	border-radius: 14px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	padding: 14px;
	backdrop-filter: blur(6px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.wsb-next-kicker {
	font-size: 12px;
	opacity: 0.85;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.wsb-next-title {
	font-size: 16px;
	font-weight: 700;
	margin-top: 4px;
	line-height: 1.2;
}

.wsb-next-top {
	display: flex;
	gap: 12px;
	align-items: center;
}

.wsb-next-thumb {
	position: relative;
	flex: 0 0 140px;
	width: 140px;
	aspect-ratio: 16/9;
	border-radius: 12px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.12);
}

.wsb-next-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.wsb-next-thumb img.is-show {
	opacity: 1;
}

.wsb-next-duration {
	position: absolute;
	right: 8px;
	bottom: 8px;
	background: rgba(0, 0, 0, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.14);
	padding: 3px 6px;
	border-radius: 8px;
	font-size: 12px;
	line-height: 1;
}

.wsb-next-info {
	flex: 1 1 auto;
	min-width: 0;
}

.wsb-next-meta {
	margin-top: 6px;
	font-size: 12px;
	opacity: 0.85;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (max-width: 480px) {
	.wsb-next-top {
		flex-direction: column;
		align-items: stretch;
	}
	.wsb-next-thumb {
		width: 100%;
		flex: 0 0 auto;
	}
}

.wsb-next-count {
	margin-top: 10px;
	font-size: 14px;
	opacity: 0.9;
}

.wsb-next-actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.wsb-next-btn {
	padding: 8px 12px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.22);
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	cursor: pointer;
}

.wsb-next-btn:hover {
	background: rgba(255, 255, 255, 0.12);
}

.wsb-next-btn.primary {
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	border-color: rgba(255, 255, 255, 0.92);
}

.wsb-next-btn.primary:hover {
	background: rgba(255, 255, 255, 1);
}

.wsb-next-btn.link {
	background: transparent;
	border-color: transparent;
	opacity: 0.9;
	text-decoration: underline;
	padding: 8px 6px;
}

/* ===== Captions UI ===== */
.wsb-cc-wrap {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-top: 8px;
	flex-wrap: wrap;
}

.wsb-cc-btn {
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
	cursor: pointer;
}

.wsb-cc-select {
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
}

/* ===== Link reset ===== */
a.wsb-videos-item,
a.wsb-videos-item:visited,
a.wsb-videos-item:hover,
a.wsb-videos-item:focus,
a.wsb-videos-item:active {
	text-decoration: none !important;
}

a.wsb-videos-item * {
	text-decoration: none !important;
}

/* Keep Continue Watching cards and library cards the same width in the right rail. */
.wsb-videos-right .wsb-videos-playlist--rail,
.wsb-videos-right .wsb-videos-cw-list {
	grid-template-columns: minmax(0, 1fr);
	justify-items: center;
	width: 100%;
}

.wsb-videos-right .wsb-videos-playlist--rail > .wsb-videos-item,
.wsb-videos-right .wsb-videos-cw-list > .wsb-videos-item {
	width: 100%;
	max-width: 394px;
	min-width: 0;
}

.wsb-videos-right .wsb-videos-playlist--rail > .wsb-videos-item .wsb-videos-card,
.wsb-videos-right .wsb-videos-cw-list > .wsb-videos-item .wsb-videos-card {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

@media (max-width: 959px) {
	.wsb-videos-right .wsb-videos-playlist--rail > .wsb-videos-item,
	.wsb-videos-right .wsb-videos-cw-list > .wsb-videos-item {
		max-width: none;
	}
}
