/**
 * Image Flip Slider Widget Styles
 *
 * @package Dove Agency
 * @since 1.0.0
 */

/* Main Container */
.dove-flip-slider-widget {
	position: relative;
	width: 100%;
	padding: 20px 0;
	overflow: hidden;
}

/* Swiper Container */
.dove-flip-swiper {
	width: 100%;
	overflow: visible;
}

/* Slide Item */
.dove-flip-slide-item {
	position: relative;
	width: 100%;
}

/* Image Container */
.dove-flip-image-container {
	position: relative;
	width: 100%;
	/*height: 500px;*/
	aspect-ratio: 1/1;
	overflow: hidden;
	border-radius: 0;
	background: #f0f0f0;
	perspective: 1000px;
}

.dove-flip-image-container-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transform-style: preserve-3d;
	transition: transform 0.6s ease;
}

.dove-flip-image-container.show-back .dove-flip-image-container-inner {
	transform: rotateY(180deg);
}

/* Images */
.dove-flip-image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	aspect-ratio: 1/1;;
	object-fit: cover;
	object-position: center;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	/* Ensure images always fill container */
	min-width: 100%;
	min-height: 100%;
}

.dove-flip-front {
	z-index: 2;
	transform: rotateY(0deg);
}

.dove-flip-back {
	transform: rotateY(180deg);
}

/* Back HTML Content */
.dove-flip-back-html-content {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	overflow-y: auto;
	box-sizing: border-box;
}

.dove-flip-back-html-content > *:first-child {
	margin-top: 0;
}

.dove-flip-back-html-content > *:last-child {
	margin-bottom: 0;
}

/* Back Template Content */
.dove-flip-back-template-content {
	width: 100%;
	height: 100%;
	overflow-y: auto;
	box-sizing: border-box;
}

/* Rotate Button */
.dove-flip-rotate-btn {
	position: absolute;
	top: 20px;
	right: 20px;
	width: 50px;
	aspect-ratio: 1/1;
	padding:3px;
	border-radius: 50%;
	background: #ffffff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 100;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	pointer-events: auto;
}

.dove-flip-rotate-btn:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.dove-flip-rotate-btn:active {
	transform: scale(0.95);
}

.dove-flip-rotate-btn svg {
	width: 24px;
	height: 24px;
	color: #000000;
}

/* Text Box */
.dove-flip-text {
	position: absolute;
	/* Position is now controlled dynamically via JavaScript based on anchor settings */
	background: rgba(102, 141, 128, 0.7);
	color: #ffffff;
	padding: 15px 25px;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	backdrop-filter: blur(5px);
	z-index: 5;
	max-width: calc(100% - 60px);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	transform: rotateY(0deg);
	pointer-events: none;
}

/* Navigation Arrows */
.dove-flip-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.3);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 10;
	transition: all 0.3s ease;
}

.dove-flip-nav:hover {
	background: rgba(0, 0, 0, 0.5);
	transform: translateY(-50%) scale(1.1);
}

.dove-flip-prev {
	left: -2px;
}

.dove-flip-next {
	right: -2px;
}

.dove-flip-nav svg {
	width: 44px;
	height: 44px;
}

.dove-flip-nav.swiper-button-disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
	/* .dove-flip-image-container {
		height: 400px;
	} */
	
	.dove-flip-text {
		font-size: 20px;
		padding: 12px 20px;
	}
	
	.dove-flip-rotate-btn {
		width: 45px;
		height: 45px;
		top: 15px;
		right: 15px;
	}
	
	.dove-flip-rotate-btn svg {
		width: 20px;
		height: 20px;
	}
}

/* Mobile Responsive */
@media (max-width: 768px) {
	.dove-flip-slider-widget {
		padding: 15px 0;
	}
	
	/* .dove-flip-image-container {
		height: 350px;
	} */
	
	.dove-flip-back-html-content {
		justify-content: flex-start;
	}
	
	.dove-flip-back-html-content h2 {
		line-height: 1.3em;
	    padding-bottom: 0.4em;
	}
	.dove-flip-text {
		font-size: 18px;
		padding: 10px 18px;
	}
	
	.dove-flip-rotate-btn {
		width: 40px;
		height: 40px;
		top: 12px;
		right: 12px;
	}
	
	.dove-flip-rotate-btn svg {
		width: 18px;
		height: 18px;
	}
	
	.dove-flip-nav {
		width: 40px;
		height: 40px;
	}
	
	.dove-flip-prev {
		left: 10px;
	}
	
	.dove-flip-next {
		right: 10px;
	}
}

/* Small Mobile */
@media (max-width: 480px) {
	/* .dove-flip-image-container {
		height: 300px;
	} */
	
	.dove-flip-text {
		font-size: 16px;
		padding: 8px 15px;
	}
	
	.dove-flip-rotate-btn {
		width: 36px;
		height: 36px;
		top: 10px;
		right: 10px;
	}
	
	.dove-flip-rotate-btn svg {
		width: 16px;
		height: 16px;
	}
	
	.dove-flip-nav {
		width: 36px;
		height: 36px;
	}
	
	.dove-flip-nav svg {
		width: 20px;
		height: 20px;
	}
}

/* Elementor Editor Specific */
.elementor-editor-active .dove-flip-slider-widget {
	overflow: visible;
}

.elementor-editor-active .dove-flip-swiper {
	overflow: visible;
}
