/**
 * Videos Carousel Gutenberg Block Styles
 * Star Industries
 */

/* ==========================================================================
   1. Section Container & Themes
   ========================================================================== */
.star-videos-carousel {
	width: 100%;
	position: relative;
	box-sizing: border-box;
	margin-top: 2rem;
	margin-bottom: 2.5rem;
}

.star-videos-carousel * {
	box-sizing: border-box;
}

/* Light text theme (for dark backgrounds) */
.star-videos-carousel--theme-light .star-videos-carousel__desc {
	color: #cbd5e1 !important;
}

.star-videos-carousel--theme-light .star-videos-carousel__slide-title {
	color: #ffffff !important;
}

/* ==========================================================================
   2. Header Area (Heading, Description, and Circular Arrow Buttons)
   ========================================================================== */
.star-videos-carousel__header {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1.5rem;
	margin-bottom: 2rem;
	width: 100%;
}

.star-videos-carousel__intro {
	flex: 1 1 320px;
	max-width: 720px;
}

.star-videos-carousel__title,
.editor-styles-wrapper .star-videos-carousel__title {
	margin: 0 0 0.5rem 0 !important;
	padding: 0 !important;
	font-size: clamp(1.75rem, 2.5vw, 2.25rem) !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	color: var(--star-heading-color, #0099ba) !important;
}

.star-videos-carousel__desc,
.editor-styles-wrapper .star-videos-carousel__desc {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 1rem !important;
	line-height: 1.55 !important;
	color: #475569 !important;
}

/* Navigation Arrow Controls */
.star-videos-carousel__nav {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.star-videos-carousel__nav-btn {
	width: 37px !important;
	height: 37px !important;
	min-width: 37px !important;
	min-height: 37px !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	background: transparent !important;
	cursor: pointer;
	position: relative;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	border-radius: 50% !important;
	transition: transform 0.15s ease, opacity 0.15s ease;
	outline: none;
	user-select: none;
}

/* Neutralize any theme Swiper pseudo-elements so our inline SVGs render cleanly */
.star-videos-carousel__nav-btn::before,
.star-videos-carousel__nav-btn::after {
	content: none !important;
	display: none !important;
}

.star-videos-carousel__nav-btn svg {
	width: 37px;
	height: 37px;
	display: block;
	pointer-events: none;
	transform-origin: center;
}

/* Flip the left navigation arrow horizontally */
.star-videos-carousel__nav-btn--prev svg {
	transform: scaleX(-1);
}

.star-videos-carousel__nav-btn:hover:not(:disabled) {
	transform: scale(1.08);
}

.star-videos-carousel__nav-btn:disabled,
.star-videos-carousel__nav-btn.swiper-button-disabled {
	opacity: 0.35 !important;
	cursor: default !important;
	pointer-events: none !important;
}

/* ==========================================================================
   3. Carousel / Swiper Track (3 at a time with mouse drag behavior)
   ========================================================================== */
.star-videos-carousel__swiper {
	width: 100%;
	position: relative;
	overflow: hidden;
	cursor: grab;
	cursor: -webkit-grab;
}

.star-videos-carousel__swiper:active,
.star-videos-carousel__swiper.swiper-grabbing {
	cursor: grabbing;
	cursor: -webkit-grabbing;
}

.star-videos-carousel__swiper .swiper-wrapper {
	display: flex;
	transition-property: transform;
	box-sizing: content-box;
}

.star-videos-carousel__slide,
.star-videos-carousel__swiper .swiper-slide {
	flex-shrink: 0;
	height: auto;
	position: relative;
	display: flex;
	flex-direction: column;
	user-select: none;
}

/* ==========================================================================
   4. Video Thumbnail & Play Button Overlay
   ========================================================================== */
.star-videos-carousel__thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: 250px;
	background-color: #0f172a;
	overflow: hidden;
	display: block;
	text-decoration: none !important;
}

.star-videos-carousel__img {
	width: 100% !important;
	height: 100% !important;
	aspect-ratio: 16 / 9;
	object-fit: cover !important;
	display: block !important;
	transition: transform 0.35s ease, filter 0.35s ease;
}

.star-videos-carousel__thumb-wrap:hover .star-videos-carousel__img {
	transform: scale(1.03);
}

/* Play Button Icon Overlay */
.star-videos-carousel__play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 37px;
	height: 37px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.85;
	transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
	pointer-events: none;
	z-index: 2;
}

.star-videos-carousel__play-icon svg {
	width: 37px;
	height: 37px;
	display: block;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.star-videos-carousel__thumb-wrap:hover .star-videos-carousel__play-icon {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.15);
}

/* Placeholder for videos without thumbnail or URL */
.star-videos-carousel__thumb-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
	color: #94a3b8;
	font-size: 0.85rem;
	gap: 0.5rem;
	padding: 1rem;
	text-align: center;
}

/* ==========================================================================
   5. Video Slide Title
   ========================================================================== */
.star-videos-carousel__slide-title,
.editor-styles-wrapper .star-videos-carousel__slide-title {
	margin: 1.25rem 0 0 0 !important;
	padding: 0 !important;
	font-size: 1.125rem !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	color: #1e293b;
	text-align: left;
}

/* ==========================================================================
   6. Gutenberg Editor Interactive Layout & Controls
   ========================================================================== */
.editor-styles-wrapper .star-videos-carousel {
	border: 1px dashed #cbd5e1;
	padding: 1.5rem;
	background-color: #fafbfc;
	border-radius: 8px;
}

.editor-styles-wrapper .star-videos-carousel--theme-light {
	background-color: #0b1f33;
}

.star-videos-carousel__editor-track {
	display: flex;
	gap: 30px;
	overflow-x: auto;
	scroll-behavior: smooth;
	padding-bottom: 1.25rem;
	cursor: grab;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
}

.star-videos-carousel__editor-track:active {
	cursor: grabbing;
}

.star-videos-carousel__editor-track::-webkit-scrollbar {
	height: 6px;
}

.star-videos-carousel__editor-track::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 4px;
}

.star-videos-carousel__editor-card {
	flex: 0 0 calc((100% - 60px) / 3);
	min-width: 280px;
	max-width: 440px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	position: relative;
}

.editor-styles-wrapper .star-videos-carousel--theme-light .star-videos-carousel__editor-card {
	background: #132a42;
	border-color: #1e3a5a;
}

/* Card Header Toolbar (Reorder, Delete) */
.star-videos-carousel__card-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.5rem 0.65rem;
	background: #f1f5f9;
	border-bottom: 1px solid #e2e8f0;
}

.editor-styles-wrapper .star-videos-carousel--theme-light .star-videos-carousel__card-toolbar {
	background: #0f2237;
	border-color: #1e3a5a;
	color: #94a3b8;
}

.star-videos-carousel__card-index {
	font-size: 0.75rem;
	font-weight: 700;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.star-videos-carousel__card-actions {
	display: flex;
	gap: 0.25rem;
}

/* Card Body */
.star-videos-carousel__card-body {
	padding: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

/* Card Thumbnail Box */
.star-videos-carousel__card-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
}

.star-videos-carousel__card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.star-videos-carousel__card-thumb-badge {
	position: absolute;
	top: 6px;
	left: 6px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
	z-index: 2;
}

/* Thumbnail Action Buttons inside card */
.star-videos-carousel__thumb-btn-row {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.25rem;
}

/* Add Video Card Button */
.star-videos-carousel__add-card {
	flex: 0 0 240px;
	min-width: 200px;
	border: 2px dashed #94a3b8;
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	padding: 1.5rem;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.5);
	color: #0099ba;
	font-weight: 600;
	font-size: 0.95rem;
	transition: all 0.15s ease;
}

.star-videos-carousel__add-card:hover {
	border-color: #0099ba;
	background: #f0f9ff;
	color: #007c99;
}

/* ==========================================================================
   7. Responsive Behavior
   ========================================================================== */
@media (max-width: 1024px) {
	.star-videos-carousel__editor-card {
		flex: 0 0 calc((100% - 30px) / 2);
	}
}

@media (max-width: 768px) {
	.star-videos-carousel__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}

	.star-videos-carousel__nav {
		align-self: flex-end;
	}

	.star-videos-carousel__thumb-wrap {
		height: 220px;
	}

	.star-videos-carousel__editor-card {
		flex: 0 0 85%;
	}
}

@media (max-width: 480px) {
	.star-videos-carousel__thumb-wrap {
		height: 190px;
	}

	.star-videos-carousel__slide-title {
		font-size: 1rem !important;
		margin-top: 0.85rem !important;
	}
}
