/**
 * Creotixs Reels – Frontend
 */
.ctr-reels-wrap {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	width: 100%;
	position: relative;
	--ctr-aspect: 9/16;
}

.ctr-reels-nav {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-bottom: 14px;
}

.ctr-nav-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1.5px solid #e5e5e5;
	background: #fff;
	color: #111;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background 0.2s, color 0.2s, border-color 0.2s;
	box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.ctr-nav-btn:hover {
	background: var(--ctr-primary, #000);
	border-color: var(--ctr-primary, #000);
	color: #fff;
}

.ctr-nav-btn.swiper-button-disabled {
	opacity: 0.35;
	pointer-events: none;
}

.ctr-swiper {
	overflow: hidden;
	padding-bottom: 36px;
}

.ctr-slide {
	height: auto;
}

.ctr-reel-card {
	position: relative;
	border-radius: var(--ctr-radius, 16px);
	overflow: hidden;
	background: #111;
	aspect-ratio: var(--ctr-aspect, 9/16);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.ctr-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background: #000;
}

.ctr-reel-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 40%, transparent 70%, rgba(0,0,0,0.15) 100%);
	pointer-events: none;
}

.ctr-reel-controls {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	z-index: 3;
}

.ctr-ctrl-btn {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255,255,255,0.92);
	color: #111;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0,0,0,0.15);
	transition: background 0.2s, color 0.2s;
}

.ctr-ctrl-btn:hover {
	background: #111;
	color: #fff;
}

.ctr-play-pause .ctr-icon-pause { display: none; }
.ctr-play-pause.is-playing .ctr-icon-play { display: none; }
.ctr-play-pause.is-playing .ctr-icon-pause { display: block; }

.ctr-mute-toggle .ctr-icon-unmute { display: none; }
.ctr-mute-toggle.is-unmuted .ctr-icon-mute { display: none; }
.ctr-mute-toggle.is-unmuted .ctr-icon-unmute { display: block; }

.ctr-reel-meta {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px 14px 14px;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
}

.ctr-reel-title {
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: #fff;
	text-shadow: 0 1px 4px rgba(0,0,0,0.4);
	line-height: 1.3;
}

.ctr-reel-link {
	flex-shrink: 0;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #111;
	background: #fff;
	padding: 6px 12px;
	border-radius: 20px;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}

.ctr-reel-link:hover {
	background: var(--ctr-primary, #000);
	color: #fff;
}

.ctr-pagination {
	bottom: 0 !important;
}

.ctr-pagination .swiper-pagination-bullet {
	width: 7px;
	height: 7px;
	background: #ccc;
	opacity: 1;
}

.ctr-pagination .swiper-pagination-bullet-active {
	background: var(--ctr-primary, #000);
	width: 18px;
	border-radius: 4px;
}

.ctr-notice {
	padding: 16px;
	background: #f8f8f8;
	border-radius: 8px;
	color: #666;
	text-align: center;
}

@media (max-width: 768px) {
	.ctr-reels-nav { margin-bottom: 10px; }
	.ctr-nav-btn { width: 32px; height: 32px; }
	.ctr-ctrl-btn { width: 32px; height: 32px; }
	.ctr-reel-title { font-size: 12px; }
}

/* Ensure uploaded video fills card */
.ctr-reel-card {
	isolation: isolate;
}

.ctr-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* YouTube container fills card */
.ctr-youtube {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #000;
	overflow: hidden;
}

.ctr-yt-poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	z-index: 2;
	pointer-events: none;
}

.ctr-yt-player {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	border: 0;
	overflow: hidden;
}

.ctr-youtube iframe {
	position: absolute !important;
	border: 0 !important;
	max-width: none !important;
}

/*
 * Cover-crop YouTube (usually 16:9) inside vertical reel (9:16).
 * Scale so the video fills the card with no black bars.
 * pointer-events:none so native YT hover controls never appear.
 */
/* Landscape YT (16:9) inside portrait card (9:16): width = (16/9)/(9/16)*100% ≈ 316% */
.ctr-hide-yt-ui .ctr-youtube iframe {
	top: 50% !important;
	left: 50% !important;
	width: 316.67% !important;
	height: 100% !important;
	transform: translate(-50%, -50%);
	transform-origin: center center;
	pointer-events: none !important;
}

/* Extra crop for true 9:16 cards – kill letterboxing */
.ctr-hide-yt-ui .ctr-reel-card {
	cursor: pointer;
}

.ctr-hide-yt-ui .ctr-youtube::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 3;
	background: transparent;
	cursor: pointer;
}

/* When hide UI is off, allow normal iframe interaction */
.ctr-reels-wrap:not(.ctr-hide-yt-ui) .ctr-youtube iframe {
	width: 100% !important;
	height: 100% !important;
	top: 0 !important;
	left: 0 !important;
	transform: none;
	pointer-events: auto;
}



/* Full-bleed cover thumbnail – always fills the card */
.ctr-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	z-index: 2;
	display: block;
	background: #111;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.ctr-cover-fallback {
	background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
}

/* When slide is playing, hide cover so video shows */
.ctr-reel-card.is-playing .ctr-cover {
	opacity: 0;
	visibility: hidden;
}

/* Video / YT sit under cover until playing */
.ctr-video,
.ctr-youtube {
	z-index: 1;
}

.ctr-reel-card.is-playing .ctr-video,
.ctr-reel-card.is-playing .ctr-youtube {
	z-index: 3;
}

.ctr-reel-overlay {
	z-index: 4;
}

.ctr-reel-controls,
.ctr-reel-meta {
	z-index: 5;
}


/* All videos playing together – force full card media */
.ctr-all-playing .ctr-cover {
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.ctr-all-playing .ctr-reel-card {
	background: #000;
}

.ctr-all-playing .ctr-video,
.ctr-all-playing .ctr-youtube {
	z-index: 3 !important;
	opacity: 1 !important;
}

.ctr-all-playing .ctr-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Stronger YT cover-fill while all play */
.ctr-all-playing.ctr-hide-yt-ui .ctr-youtube iframe {
	width: 316.67% !important;
	height: 100% !important;
	top: 50% !important;
	left: 50% !important;
	transform: translate(-50%, -50%);
	pointer-events: none !important;
}
