/* ==========================================================================
	ThemeVally Back To Top Widget CSS Core (tv-back-to-top)
	========================================================================== */

/* 1. Viewport Containers */
.tv-back-to-top-container {
	position: fixed;
	bottom: 30px;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* Container Visibility Toggle */
.tv-back-to-top-container.tv-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Inactivity Auto-Fade State */
.tv-back-to-top-container.tv-inactive {
	opacity: 0.25;
}
.tv-back-to-top-container.tv-inactive:hover {
	opacity: 1;
}

/* Responsive Alignment Positions */
.tv-back-to-top-container.tv-align-right {
	right: 30px;
	left: auto;
}
.tv-back-to-top-container.tv-align-left {
	left: 30px;
	right: auto;
}
.tv-back-to-top-container.tv-align-center {
	left: 50%;
	right: auto;
	transform: translateX(-50%);
}

/* Absolute Page Boundary Mode overrides container */
.tv-back-to-top-container.tv-absolute {
	position: absolute;
}

/* 2. Core Button Layout */
.tv-back-to-top-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border: none;
	outline: none;
	cursor: pointer;
	font-family: inherit;
	line-height: 1;
	transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.2s active;
	box-sizing: border-box;
	overflow: visible;
}

.tv-button-content-wrapper {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	z-index: 2;
	pointer-events: none;
}

/* Shape Templates */
.tv-layout-circle,
.tv-layout-glass,
.tv-layout-neumorphic,
.tv-layout-progress_ring {
	border-radius: 50%;
}
.tv-layout-square {
	border-radius: 0px;
}
.tv-layout-rounded {
	border-radius: 8px;
}

/* Layout Style Presets */
.tv-layout-glass {
	background-color: rgba(255, 255, 255, 0.25) !important;
	border: 1px solid rgba(255, 255, 255, 0.3) !important;
	box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1) !important;
	backdrop-filter: blur(10px) !important;
	-webkit-backdrop-filter: blur(10px) !important;
	color: #ffffff !important;
}
.tv-layout-glass .tv-back-to-top-icon svg,
.tv-layout-glass .tv-back-to-top-icon-complete svg {
	fill: #ffffff !important;
}

.tv-layout-neumorphic {
	background-color: #f1f1f1 !important;
	box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), -6px -6px 12px rgba(255, 255, 255, 0.8) !important;
	color: #333333 !important;
}
.tv-layout-neumorphic .tv-back-to-top-icon svg,
.tv-layout-neumorphic .tv-back-to-top-icon-complete svg {
	fill: #333333 !important;
}

.tv-layout-progress_ring {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}
.tv-layout-pill {
	width: auto !important;
	padding: 0 16px;
	border-radius: 30px;
}
.tv-layout-dot {
	width: 16px !important;
	height: 16px !important;
	border-radius: 50%;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.tv-layout-dot .tv-button-content-wrapper {
	display: none;
}

/* 3. Preset Background Options */
.tv-bg-solid {
	background-size: cover;
}

.tv-bg-gradient {
	background-image: linear-gradient(135deg, var(--tv-gradient-start, #016087), var(--tv-gradient-end, #183ad6));
}

.tv-bg-glass {
	background-color: rgba(255, 255, 255, 0.4);
	border: 1px solid rgba(255, 255, 255, 0.4);
	box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.tv-bg-neumorphism {
	--tv-neumorphic-angle: 135deg;
	background-color: #f1f1f1;
	/* Computes light highlights and dark shadows dynamically using CSS trigonometry or directional offsets */
	box-shadow: 6px 6px 12px rgba(163, 177, 198, 0.6), -6px -6px 12px rgba(255, 255, 255, 0.8);
}
.tv-bg-neumorphism:hover {
	box-shadow: inset 3px 3px 6px rgba(163, 177, 198, 0.6), inset -3px -3px 6px rgba(255, 255, 255, 0.8);
}

/* 4. Graphical Elements (Progress indicators) */
.tv-svg-progress-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	box-sizing: border-box;
}

.tv-progress-svg {
	width: 100%;
	height: 100%;
	transform: rotate(-90deg);
}

.tv-progress-ring-track {
	fill: none;
	stroke: rgba(255, 255, 255, 0.2);
}

.tv-progress-ring-fill {
	fill: none;
	stroke-linecap: round;
	stroke: #ffffff;
	transition: stroke-dashoffset 0.1s linear;
}

/* Numeric Text indicator styling */
.tv-progress-percent-text {
	font-size: 11px;
	font-weight: 700;
	margin-top: 2px;
}

.tv-reading-time-text {
	font-size: 9px;
	font-weight: 600;
	margin-top: 3px;
	opacity: 0.9;
}

/* Horizontal top/bottom progress bar tracker */
.tv-progress-bar-track {
	position: fixed;
	left: 0;
	width: 100%;
	height: 4px;
	z-index: 999999;
	background-color: rgba(0, 0, 0, 0.1);
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
}

.tv-progress-bar-track.tv-visible {
	opacity: 1;
	visibility: visible;
}

.tv-progress-bar-top {
	top: 0;
}

.tv-progress-bar-bottom {
	bottom: 0;
}

.tv-progress-bar-fill {
	width: 0%;
	height: 100%;
	transition: width 0.1s linear;
}

/* Inline Linear Progress Bar inside button */
.tv-linear-progress-bar-track {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background-color: rgba(255, 255, 255, 0.2);
	z-index: 3;
	overflow: hidden;
}

.tv-linear-progress-bar-fill {
	height: 100%;
	background-color: #3858e9;
	width: 0%;
}

/* Elementor Editor Preview Overrides for viewport progress bar */
.elementor-editor-active .tv-progress-bar-track {
	opacity: 1 !important;
	visibility: visible !important;
}

/* 5. Icons & Media graphics */
.tv-back-to-top-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.tv-back-to-top-icon-complete {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.tv-back-to-top-button i {
	font-size: 16px;
	color: inherit;
	display: inline-block;
	line-height: 1;
}

.tv-back-to-top-icon svg,
.tv-back-to-top-icon-complete svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	display: inline-block;
	vertical-align: middle;
}

.tv-svg-icon {
	width: 16px;
	height: 16px;
	object-fit: contain;
	display: inline-block;
}

.tv-img-icon {
	width: 16px;
	height: 16px;
	object-fit: contain;
	display: inline-block;
}



/* Swappable icons trigger states */
.tv-back-to-top-button.tv-complete .tv-back-to-top-icon.tv-swappable {
	display: none !important;
}

.tv-back-to-top-button.tv-complete .tv-back-to-top-icon-complete {
	display: inline-flex !important;
}

/* 6. Animations (Entrance & Micro-hover shifts) */

/* Entrance Transitions */
.tv-motion-in-fade {
	transition: opacity 0.4s ease, visibility 0.4s ease !important;
}

.tv-motion-in-slide_up {
	transform: translateY(20px);
}
.tv-motion-in-slide_up.tv-visible {
	transform: translateY(0);
}
/* For Center alignment slide-up */
.tv-align-center.tv-motion-in-slide_up {
	transform: translate(-50%, 20px);
}
.tv-align-center.tv-motion-in-slide_up.tv-visible {
	transform: translate(-50%, 0);
}

.tv-motion-in-scale {
	transform: scale(0.6);
}
.tv-motion-in-scale.tv-visible {
	transform: scale(1);
}
.tv-align-center.tv-motion-in-scale {
	transform: translate(-50%, 0) scale(0.6);
}
.tv-align-center.tv-motion-in-scale.tv-visible {
	transform: translate(-50%, 0) scale(1);
}

.tv-motion-in-rotate {
	transform: scale(0.6) rotate(-180deg);
}
.tv-motion-in-rotate.tv-visible {
	transform: scale(1) rotate(0);
}
.tv-align-center.tv-motion-in-rotate {
	transform: translate(-50%, 0) scale(0.6) rotate(-180deg);
}
.tv-align-center.tv-motion-in-rotate.tv-visible {
	transform: translate(-50%, 0) scale(1) rotate(0);
}

/* Hover Animations */
.tv-motion-hover-scale:hover {
	transform: scale(1.1);
}
.tv-align-center.tv-motion-hover-scale:hover {
	transform: translate(-50%, 0) scale(1.1);
}

.tv-motion-hover-float:hover {
	transform: translateY(-6px);
}
.tv-align-center.tv-motion-hover-float:hover {
	transform: translate(-50%, -6px);
}

.tv-motion-hover-bounce:hover .tv-back-to-top-icon {
	animation: tv-arrow-bounce 1s infinite alternate;
}

@keyframes tv-arrow-bounce {
	0% { transform: translateY(0); }
	100% { transform: translateY(-5px); }
}

.tv-motion-hover-rotate:hover .tv-back-to-top-icon {
	transform: rotate(360deg);
}

/* Active tactile response */
.tv-back-to-top-button:active {
	transform: scale(0.95);
}

/* WCAG Focus Visible Outline styling */
.tv-back-to-top-button:focus-visible {
	outline: 3px solid #3858e9;
	outline-offset: 4px;
	box-shadow: 0 0 0 4px rgba(56, 88, 233, 0.4);
}

/* 7. Elementor Editor Preview Overrides */
.elementor-editor-active .tv-back-to-top-container {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}
