:root {
	--ytc-red: #ff0000;
	--ytc-red-bg: #fff1f1;
	--ytc-gray-900: #111827;
	--ytc-gray-600: #4b5563;
	--ytc-gray-400: #9ca3af;
	--ytc-gray-200: #e5e7eb;
	--ytc-gray-100: #f3f4f6;
	--ytc-bg: #f9fafb;
	--ytc-green-bg: #d1fae5;
	--ytc-green-fg: #065f46;
	--ytc-blue-bg: #dbeafe;
	--ytc-blue-fg: #1e40af;
	--ytc-radius-card: 14px;
	--ytc-radius-btn: 8px;
	--ytc-radius-pill: 999px;
}

.ytc-public-catalog,
.ytc-admin-wrap {
	font-family: 'Inter', sans-serif;
	color: var(--ytc-gray-900);
}

/* Break the catalog out of the theme's centered content column so it can use the full viewport width. */
.ytc-public-catalog {
	box-sizing: border-box;
	width: 100vw;
	max-width: 100vw;
	position: relative;
	left: 50%;
	right: 50%;
	margin-left: -50vw;
	margin-right: -50vw;
	padding-left: clamp(16px, 4vw, 48px);
	padding-right: clamp(16px, 4vw, 48px);
}

/* ===== Catalog header ===== */
.ytc-catalog-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 4px;
}

.ytc-catalog-header__title {
	font-size: 24px;
	font-weight: 800;
	color: var(--ytc-gray-900);
	margin: 0 0 4px;
}

.ytc-updated-badge {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin: 0 0 20px;
	padding: 6px 14px;
	background: var(--ytc-green-bg);
	border-radius: var(--ytc-radius-pill);
	font-size: 13px;
	line-height: 1.4;
	color: var(--ytc-green-fg);
}

.ytc-updated-badge__label {
	font-weight: 700;
}

.ytc-updated-badge__label::before {
	content: "\21BB";
	margin-right: 6px;
}

.ytc-updated-badge__note {
	color: var(--ytc-gray-600);
}

.ytc-catalog-header__subtitle {
	font-size: 13px;
	font-weight: 400;
	color: var(--ytc-gray-400);
	margin: 0;
}

.ytc-cta-btn {
	display: inline-block;
	flex-shrink: 0;
	background: var(--ytc-red);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 10px 18px;
	border-radius: var(--ytc-radius-pill) !important;
	text-decoration: none;
	white-space: nowrap;
}

.ytc-cta-btn:hover {
	opacity: 0.9;
	color: #fff;
}

/* ===== Grid ===== */
.ytc-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 16px;
}

@media (min-width: 640px) {
	.ytc-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.ytc-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1200px) {
	.ytc-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.ytc-empty {
	grid-column: 1 / -1;
	color: var(--ytc-gray-400);
	font-style: italic;
}

/* ===== Channel card ===== */
.ytc-card {
	background: #fff;
	border: 1px solid var(--ytc-gray-200);
	border-radius: var(--ytc-radius-card) !important;
	padding: 16px;
	box-shadow: 0 2px 8px rgba(16, 24, 40, 0.08) !important;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.ytc-card-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
}

.ytc-identity-group {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.ytc-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50% !important;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--ytc-gray-200);
}

.ytc-identity {
	min-width: 0;
	flex: 1;
}

.ytc-title {
	font-weight: 700;
	font-size: 14px;
	color: var(--ytc-gray-900);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ytc-handle {
	font-size: 12px;
	font-weight: 400;
	color: var(--ytc-gray-400);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ytc-description {
	font-size: 13px;
	font-weight: 400;
	color: var(--ytc-gray-600);
	line-height: 1.4;
	margin: 0;
	overflow-wrap: break-word;
	word-break: break-word;
}

/* Badges */
.ytc-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: var(--ytc-radius-pill) !important;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
}

.ytc-badge-new {
	background: var(--ytc-blue-bg);
	color: var(--ytc-blue-fg);
}

.ytc-badge-active {
	background: var(--ytc-green-bg);
	color: var(--ytc-green-fg);
}

.ytc-badge-inactive {
	background: var(--ytc-gray-100);
	color: var(--ytc-gray-600);
}

/* Stats row: KPI tiles with a colored accent bar per stat type */
.ytc-stats-row {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.ytc-stat-block {
	flex: 1;
	min-width: 78px;
	background: #fff !important;
	border: 1px solid var(--ytc-gray-200) !important;
	border-top: 3px solid var(--accent) !important;
	border-radius: 8px !important;
	padding: 8px 10px 9px;
}

.ytc-stat-block--subs {
	--accent: #2563eb;
}

.ytc-stat-block--videos {
	--accent: #7c3aed;
}

.ytc-stat-block--shorts {
	--accent: #ea580c;
}

.ytc-stat-value {
	font-size: 16px;
	font-weight: 800;
	color: var(--ytc-gray-900);
	line-height: 1.1;
}

.ytc-stat-label {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ytc-gray-400);
	margin-top: 2px;
}

.ytc-link-btn {
	background: none;
	border: none;
	padding: 0;
	color: #2563eb;
	text-decoration: underline;
	font-size: 13px;
	cursor: pointer;
}

/* Divider */
.ytc-divider {
	border: none;
	border-top: 1px solid var(--ytc-gray-200);
	margin: 0;
}

/* Actions row */
.ytc-actions-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.ytc-action-watch {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	cursor: pointer;
}

.ytc-action-watch-icon {
	width: 32px;
	height: 32px;
	background: var(--ytc-red-bg);
	border-radius: var(--ytc-radius-btn) !important;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ytc-action-watch-icon svg {
	width: 14px;
	height: 14px;
	fill: var(--ytc-red);
}

.ytc-action-watch-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--ytc-red);
}

.ytc-favorite-btn {
	width: 32px;
	height: 32px;
	padding: 0 !important;
	background: #fff !important;
	border-radius: var(--ytc-radius-btn) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	border: 1px solid var(--ytc-gray-200) !important;
}

.ytc-favorite-btn svg {
	width: 16px;
	height: 16px;
	stroke: var(--ytc-red);
	fill: none;
	stroke-width: 2;
}

.ytc-favorite-btn.is-favorited svg {
	stroke: var(--ytc-red);
	fill: var(--ytc-red);
}

/* Admin-only controls (not part of the public design) */
.ytc-admin-controls {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-top: 12px;
	border-top: 1px dashed var(--ytc-gray-200);
}

.ytc-admin-controls input,
.ytc-admin-controls textarea {
	width: 100%;
	font-family: inherit;
	font-size: 13px;
	padding: 6px 8px;
	border: 1px solid var(--ytc-gray-200);
	border-radius: 4px !important;
	resize: vertical;
}

.ytc-admin-controls-buttons {
	display: flex;
	gap: 4px;
}

.ytc-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 8px;
	border-radius: 6px !important;
	border: 1px solid var(--ytc-gray-200);
	background: #fff;
	color: var(--ytc-gray-600);
	cursor: pointer;
	text-decoration: none;
	font-size: 13px;
	line-height: 1;
}

.ytc-icon-btn:hover {
	background: var(--ytc-bg);
}

.ytc-icon-btn.is-loading {
	opacity: 0.5;
	pointer-events: none;
}

.ytc-icon-btn.is-active {
	background: var(--ytc-red);
	border-color: var(--ytc-red);
	color: #fff;
}

.ytc-sort-controls {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}

.ytc-sort-controls-public {
	margin-bottom: 4px;
}

/* ===== Latest videos section ===== */
.ytc-videos-section {
	margin-top: 24px;
}

.ytc-section-header__title {
	font-size: 16px;
	font-weight: 800;
	color: var(--ytc-gray-900);
	margin: 0 0 4px;
}

.ytc-section-header__subtitle {
	font-size: 13px;
	font-weight: 400;
	color: var(--ytc-gray-400);
	margin: 0;
}

.ytc-video-group-title {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ytc-gray-400);
	margin: 16px 0 0;
}

.ytc-video-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 12px;
}

@media (min-width: 640px) {
	.ytc-video-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.ytc-video-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1200px) {
	.ytc-video-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.ytc-video-grid--sponsored {
	margin-top: 12px;
}

@media (min-width: 640px) {
	.ytc-video-grid--sponsored {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

.ytc-video-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.ytc-video-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 358 / 220;
	border-radius: var(--ytc-radius-card) !important;
	overflow: hidden;
	background: var(--ytc-gray-200);
}

.ytc-video-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ytc-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	background: rgba(0, 0, 0, 0.5);
	border-radius: 50% !important;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ytc-video-play svg {
	width: 16px;
	height: 16px;
	fill: #fff;
	margin-left: 2px;
}

.ytc-video-duration {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px !important;
}

.ytc-video-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--ytc-gray-900);
	margin: 0;
	overflow-wrap: break-word;
	word-break: break-word;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

.ytc-video-meta {
	font-size: 12px;
	font-weight: 400;
	color: var(--ytc-gray-400);
	margin: 0;
}

/* ===== Pagination ===== */
.ytc-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}

.ytc-pagination__btn {
	padding: 8px 14px !important;
	border-radius: var(--ytc-radius-pill) !important;
	font-size: 13px;
	font-weight: 400;
	background: #fff !important;
	color: var(--ytc-gray-600) !important;
	border: 1px solid var(--ytc-gray-200) !important;
	cursor: pointer;
}

.ytc-pagination__btn.is-active {
	background: var(--ytc-red) !important;
	color: #fff !important;
	border-color: var(--ytc-red) !important;
	font-weight: 700;
}

.ytc-pagination__btn:hover:not(.is-active):not(:disabled) {
	background: var(--ytc-gray-100) !important;
}

.ytc-pagination__btn:disabled {
	opacity: 0.4;
	cursor: default;
}

/* ===== Video lightbox (single shared player, correct 16:9 ratio) ===== */
.ytc-video-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
}

.ytc-video-modal.is-open {
	display: flex;
}

.ytc-video-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.ytc-video-modal__dialog {
	position: relative;
	width: min(960px, 100%);
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: var(--ytc-radius-card) !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5) !important;
	overflow: hidden;
}

.ytc-video-modal__frame {
	position: absolute;
	inset: 0;
}

.ytc-video-modal__frame iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.ytc-video-modal__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	width: 32px;
	height: 32px;
	padding: 0 !important;
	border: none !important;
	background: rgba(0, 0, 0, 0.6) !important;
	color: #fff !important;
	font-size: 20px;
	line-height: 1;
	border-radius: var(--ytc-radius-btn) !important;
	cursor: pointer;
}

.ytc-video-modal__close:hover {
	background: rgba(0, 0, 0, 0.8) !important;
}

body.ytc-modal-open {
	overflow: hidden;
}
