/**
 * Sticky Call & WhatsApp Actions Styles
 *
 * @package Garage_At_Home_Booking
 */

:root {
	--gha-wa-color: #25D366;
	--gha-wa-color-dark: #128C7E;
	--gha-call-color: #007AFF;
	--gha-call-color-dark: #0051D5;
	--gha-sticky-z: 99999;
	--gha-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1);
	--gha-shadow-hover: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(37, 211, 102, 0.3);
	--gha-bg-dark: #1a1a1a;
	--gha-bg-darker: #0f0f0f;
	--gha-border-dark: rgba(255, 255, 255, 0.1);
}

.gha-sticky-actions-container {
	position: fixed !important;
	z-index: var(--gha-sticky-z, 99999) !important;
	display: flex !important;
	flex-direction: column;
	gap: 12px;
	pointer-events: none;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Hide sticky buttons in customizer */
.wp-customizer .gha-sticky-actions-container,
.customize-previewing .gha-sticky-actions-container {
	display: none !important;
	visibility: hidden !important;
}

.gha-sticky-actions-container.gha-sticky-bottom-right {
	bottom: 16px;
	right: 16px;
}

.gha-sticky-actions-container.gha-sticky-bottom-left {
	bottom: 16px;
	left: 16px;
}

.gha-sticky-call,
.gha-sticky-whatsapp {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex !important;
	align-items: center;
	justify-content: center;
	box-shadow: var(--gha-shadow, 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1));
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	pointer-events: auto;
	text-decoration: none;
	position: relative;
	cursor: pointer;
	border: 2px solid var(--gha-border-dark, rgba(255, 255, 255, 0.1));
	overflow: hidden;
	backdrop-filter: blur(10px);
	visibility: visible !important;
	opacity: 1 !important;
}

.gha-sticky-call {
	background: linear-gradient(135deg, 
		var(--gha-bg-dark, #1a1a1a) 0%, 
		var(--gha-bg-darker, #0f0f0f) 50%,
		var(--gha-bg-dark, #1a1a1a) 100%);
	color: var(--gha-call-color, #007AFF);
}

.gha-sticky-call::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, 
		rgba(0, 122, 255, 0.15) 0%, 
		rgba(0, 122, 255, 0.05) 40%,
		transparent 70%);
	border-radius: 50%;
	pointer-events: none;
	transition: transform 0.6s ease;
}

.gha-sticky-call::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, 
		rgba(0, 122, 255, 0.1) 0%, 
		transparent 50%,
		rgba(0, 122, 255, 0.05) 100%);
	border-radius: 50%;
	pointer-events: none;
}

.gha-sticky-whatsapp {
	background: linear-gradient(135deg, 
		var(--gha-bg-dark, #1a1a1a) 0%, 
		var(--gha-bg-darker, #0f0f0f) 50%,
		var(--gha-bg-dark, #1a1a1a) 100%);
	color: var(--gha-wa-color, #25D366);
}

.gha-sticky-whatsapp::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, 
		rgba(37, 211, 102, 0.15) 0%, 
		rgba(37, 211, 102, 0.05) 40%,
		transparent 70%);
	border-radius: 50%;
	pointer-events: none;
	transition: transform 0.6s ease;
}

.gha-sticky-whatsapp::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(135deg, 
		rgba(37, 211, 102, 0.1) 0%, 
		transparent 50%,
		rgba(37, 211, 102, 0.05) 100%);
	border-radius: 50%;
	pointer-events: none;
}

.gha-sticky-call svg,
.gha-sticky-whatsapp svg {
	width: 30px;
	height: 30px;
	position: relative;
	z-index: 2;
	filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
	transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* Hover and focus states */
.gha-sticky-call:hover,
.gha-sticky-call:focus,
.gha-sticky-whatsapp:hover,
.gha-sticky-whatsapp:focus {
	transform: scale(1.12) translateY(-4px);
	box-shadow: var(--gha-shadow-hover, 
		0 16px 40px rgba(0, 0, 0, 0.5), 
		0 0 20px currentColor,
		0 0 40px currentColor,
		inset 0 0 20px rgba(255, 255, 255, 0.05));
	border-color: currentColor;
	background: linear-gradient(135deg, 
		var(--gha-bg-darker, #0f0f0f) 0%, 
		var(--gha-bg-dark, #1a1a1a) 50%,
		var(--gha-bg-darker, #0f0f0f) 100%);
}

.gha-sticky-call:hover::before,
.gha-sticky-call:focus::before {
	transform: translate(25%, 25%);
}

.gha-sticky-whatsapp:hover::before,
.gha-sticky-whatsapp:focus::before {
	transform: translate(25%, 25%);
}

.gha-sticky-call:hover svg,
.gha-sticky-call:focus svg,
.gha-sticky-whatsapp:hover svg,
.gha-sticky-whatsapp:focus svg {
	transform: scale(1.15);
	filter: drop-shadow(0 0 12px currentColor) drop-shadow(0 0 24px currentColor) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.gha-sticky-call:active,
.gha-sticky-whatsapp:active {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 
		0 0 15px currentColor,
		inset 0 0 15px rgba(255, 255, 255, 0.1);
}

.gha-sticky-call:active svg,
.gha-sticky-whatsapp:active svg {
	transform: scale(1.05);
}

/* Tooltip - dark theme */
.gha-sticky-tooltip {
	position: absolute;
	bottom: 100%;
	left: 50%;
	transform: translateX(-50%);
	margin-bottom: 12px;
	padding: 10px 16px;
	background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
	color: #fff;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	display: none;
	pointer-events: none;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), 
		0 0 0 1px rgba(255, 255, 255, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.1);
	animation: tooltipFadeIn 0.3s ease;
	z-index: 100000;
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
}

.gha-sticky-tooltip::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #0f0f0f;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes tooltipFadeIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(4px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.gha-sticky-call,
	.gha-sticky-whatsapp {
		transition: none;
		animation: none;
	}

	.gha-sticky-call svg,
	.gha-sticky-whatsapp svg {
		animation: none;
	}

	.gha-sticky-call:hover,
	.gha-sticky-call:focus,
	.gha-sticky-whatsapp:hover,
	.gha-sticky-whatsapp:focus {
		transform: none;
	}
}

/* Pulse animation for attention - dark theme glow */
@keyframes pulse {
	0%, 100% {
		box-shadow: var(--gha-shadow, 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1));
	}
	50% {
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 
			0 0 20px rgba(37, 211, 102, 0.4),
			0 0 40px rgba(37, 211, 102, 0.2),
			0 0 0 1px rgba(37, 211, 102, 0.3);
	}
}

@keyframes pulseCall {
	0%, 100% {
		box-shadow: var(--gha-shadow, 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1));
	}
	50% {
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 
			0 0 20px rgba(0, 122, 255, 0.4),
			0 0 40px rgba(0, 122, 255, 0.2),
			0 0 0 1px rgba(0, 122, 255, 0.3);
	}
}

@keyframes iconGlow {
	0%, 100% {
		filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
	}
	50% {
		filter: drop-shadow(0 0 16px currentColor) drop-shadow(0 0 24px currentColor) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
	}
}

.gha-sticky-whatsapp {
	animation: pulse 4s ease-in-out infinite;
}

.gha-sticky-whatsapp svg {
	animation: iconGlow 4s ease-in-out infinite;
}

.gha-sticky-call {
	animation: pulseCall 4s ease-in-out infinite 2s;
}

.gha-sticky-call svg {
	animation: iconGlow 4s ease-in-out infinite 2s;
}

.gha-sticky-call:hover,
.gha-sticky-whatsapp:hover {
	animation: none;
}

.gha-sticky-call:hover svg,
.gha-sticky-whatsapp:hover svg {
	animation: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
	.gha-sticky-actions-container {
		bottom: 20px;
	}

	.gha-sticky-actions-container.gha-sticky-bottom-right {
		right: 20px;
	}

	.gha-sticky-actions-container.gha-sticky-bottom-left {
		left: 20px;
	}

	.gha-sticky-call,
	.gha-sticky-whatsapp {
		width: 68px;
		height: 68px;
	}

	.gha-sticky-call svg,
	.gha-sticky-whatsapp svg {
		width: 34px;
		height: 34px;
	}
}

/* Desktop adjustments */
@media (min-width: 769px) {
	.gha-sticky-actions-container {
		bottom: 30px;
	}

	.gha-sticky-actions-container.gha-sticky-bottom-right {
		right: 30px;
	}

	.gha-sticky-actions-container.gha-sticky-bottom-left {
		left: 30px;
	}
}

/* Hide on specific pages */
body.gha-sticky-hide .gha-sticky-actions-container {
	display: none !important;
}

/* Noscript fallback */
.gha-sticky-actions-noscript {
	position: fixed;
	bottom: 16px;
	right: 16px;
	z-index: var(--gha-sticky-z, 99999);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.gha-sticky-actions-noscript .gha-sticky-call,
.gha-sticky-actions-noscript .gha-sticky-whatsapp {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--gha-shadow, 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 0, 0, 0.1));
	text-decoration: none;
	border: 2px solid var(--gha-border-dark, rgba(255, 255, 255, 0.1));
	backdrop-filter: blur(10px);
}

.gha-sticky-actions-noscript .gha-sticky-call {
	background: linear-gradient(135deg, 
		var(--gha-bg-dark, #1a1a1a) 0%, 
		var(--gha-bg-darker, #0f0f0f) 50%,
		var(--gha-bg-dark, #1a1a1a) 100%);
	color: var(--gha-call-color, #007AFF);
}

.gha-sticky-actions-noscript .gha-sticky-whatsapp {
	background: linear-gradient(135deg, 
		var(--gha-bg-dark, #1a1a1a) 0%, 
		var(--gha-bg-darker, #0f0f0f) 50%,
		var(--gha-bg-dark, #1a1a1a) 100%);
	color: var(--gha-wa-color, #25D366);
}

.gha-sticky-actions-noscript .gha-sticky-call svg,
.gha-sticky-actions-noscript .gha-sticky-whatsapp svg {
	width: 30px;
	height: 30px;
	filter: drop-shadow(0 0 8px currentColor) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Shortcode container */
.gha-sticky-actions-shortcode {
	display: flex;
	gap: 12px;
	justify-content: center;
	margin: 20px 0;
}

.gha-sticky-actions-shortcode .gha-sticky-call,
.gha-sticky-actions-shortcode .gha-sticky-whatsapp {
	position: relative;
}

