/**
 * Vivaia Content Slider Styles
 *
 * @package Vivaia_Content_Slider
 * @version 1.0.0
 */

/* === Base Wrapper === */
.vivaia-content-slider-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
	box-sizing: border-box;
}

.vivaia-content-slider-wrapper * {
	box-sizing: border-box;
}

/* === Slider Container === */
.vivaia-content-slider {
	position: relative;
	width: 100%;
}

/* === Slide Item === */
.vivaia-content-slider__item {
	position: relative;
	width: 100%;
	overflow: hidden;
	cursor: pointer;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* === Link Wrapper === */
.vivaia-content-slider__link {
	display: block;
	position: relative;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

/* === Image Container === */
.vivaia-content-slider__image {
	position: relative;
	width: 100%;
	height: 0;
	/* padding-bottom set dynamically via inline style based on image aspect ratio */
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	overflow: hidden;
}

.vivaia-content-slider__image img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0; /* Hide the actual img, use background-image instead for better control */
}

/* === Content Overlay === */
.vivaia-content-slider__content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px;
	z-index: 2;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

/* === Title === */
.vivaia-content-slider__title {
	margin: 0 0 10px 0;
	padding: 0;
	color: #ffffff;
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
	word-wrap: break-word;
}

/* === Description === */
.vivaia-content-slider__description {
	margin: 0;
	padding: 0;
	color: #ffffff;
	font-size: 16px;
	line-height: 1.5;
	text-align: center;
	word-wrap: break-word;
}

/* === Navigation === */
.vivaia-content-slider__navigation {
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	z-index: 10;
	pointer-events: none;
	display: flex;
	justify-content: space-between;
	padding: 0 20px;
}

.vivaia-content-slider__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background-color: rgba(0, 0, 0, 0.3);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	transition: background-color 0.3s ease, opacity 0.3s ease;
	outline: none;
	padding: 0;
}

.vivaia-content-slider__nav:hover {
	background-color: rgba(0, 0, 0, 0.5);
}

.vivaia-content-slider__nav:focus {
	outline: 2px solid rgba(255, 255, 255, 0.5);
	outline-offset: 2px;
}

.vivaia-content-slider__nav.owl-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.vivaia-content-slider__nav svg {
	width: 18px;
	height: 18px;
	display: block;
}

.vivaia-content-slider__nav svg path {
	fill: #ffffff;
	transition: fill 0.3s ease;
}

/* === Owl Carousel Overrides === */
.vivaia-content-slider.owl-carousel .owl-stage-outer {
	overflow: visible;
}

.vivaia-content-slider.owl-carousel .owl-stage {
	display: flex;
	align-items: stretch;
}

.vivaia-content-slider.owl-carousel .owl-item {
	display: flex;
	align-items: stretch;
}

/* Disable default Owl nav since we use custom navigation */
.vivaia-content-slider.owl-carousel .owl-nav {
	display: none;
}

.vivaia-content-slider.owl-carousel .owl-dots {
	display: none;
}

/* === Dragging State === */
.vivaia-content-slider.owl-carousel.owl-drag .owl-item {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.vivaia-content-slider.owl-carousel .owl-item.active {
	visibility: visible;
}

/* === Tablet Styles === */
@media (max-width: 991px) {
	.vivaia-content-slider__title {
		font-size: 24px;
	}

	.vivaia-content-slider__description {
		font-size: 16px;
	}

	.vivaia-content-slider__navigation {
		display: none; /* Hide arrows on tablet */
	}
}

/* === Mobile Styles === */
@media (max-width: 767px) {
	.vivaia-content-slider__title {
		font-size: 20px;
		margin-bottom: 8px;
	}

	.vivaia-content-slider__description {
		font-size: 13px;
	}

	.vivaia-content-slider__content {
		padding: 15px;
	}

	.vivaia-content-slider__navigation {
		display: none; /* Hide arrows on mobile */
	}
}

/* === Touch Device Optimizations === */
@media (hover: none) and (pointer: coarse) {
	.vivaia-content-slider__item {
		-webkit-tap-highlight-color: transparent;
		touch-action: pan-y;
	}
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
	.vivaia-content-slider *,
	.vivaia-content-slider__nav {
		transition: none !important;
		animation: none !important;
	}
}

/* === Elementor Editor Specific === */
.elementor-editor-active .vivaia-content-slider__item {
	cursor: default;
}

.elementor-editor-active .vivaia-content-slider.owl-carousel {
	touch-action: auto;
}

/* === Loading State === */
.vivaia-content-slider-wrapper.is-loading {
	min-height: 300px;
	opacity: 0.6;
}

/* === RTL Support === */
[dir="rtl"] .vivaia-content-slider__navigation {
	direction: ltr;
}
