/* ==========================================================================
   IISAUH THEME2026 — Modern Floating WhatsApp Widget
   (Desktop Web WhatsApp & Mobile Tactile Slide-Right-to-Open Effect)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Master Widget Container & Floating Trigger (Desktop & Mobile)
   -------------------------------------------------------------------------- */
.iisauh-wa-widget {
	position: relative;
	font-family: var(--font-primary, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	-webkit-tap-highlight-color: transparent;
}

.iisauh-wa-float {
	position: fixed;
	right: 28px;
	bottom: 28px;
	z-index: 99999;
	display: flex;
	align-items: center;
	isolation: isolate;
}

/* --------------------------------------------------------------------------
   2. Desktop Hover Tooltip
   -------------------------------------------------------------------------- */
.iisauh-wa-tooltip {
	position: absolute;
	right: calc(100% + 14px);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border-radius: 999px;
	background: rgba(15, 42, 74, 0.94);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.15);
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: -0.01em;
	white-space: nowrap;
	box-shadow: 
		0 10px 25px -4px rgba(15, 42, 74, 0.25),
		0 4px 10px -2px rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateX(10px) scale(0.96);
	transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease;
	pointer-events: none;
}

.iisauh-wa-tooltip::after {
	content: '';
	position: absolute;
	left: 100%;
	top: 50%;
	transform: translateY(-50%);
	border-width: 6px 0 6px 6px;
	border-style: solid;
	border-color: transparent transparent transparent rgba(15, 42, 74, 0.94);
}

.iisauh-wa-tooltip__status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #25D366;
	box-shadow: 0 0 8px #25D366;
	animation: waDotBlink 2s ease-in-out infinite;
}

.iisauh-wa-float:hover .iisauh-wa-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(0) scale(1);
}

/* --------------------------------------------------------------------------
   3. Floating Action Button
   -------------------------------------------------------------------------- */
.iisauh-wa-btn {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	text-decoration: none;
	box-shadow: 
		0 10px 28px -4px rgba(37, 211, 102, 0.52),
		0 6px 14px -2px rgba(15, 42, 74, 0.15);
	cursor: pointer;
	outline: none;
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
	z-index: 2;
}

.iisauh-wa-btn:hover {
	transform: scale(1.08) translateY(-2px);
	box-shadow: 
		0 16px 36px -4px rgba(37, 211, 102, 0.65),
		0 8px 18px -2px rgba(15, 42, 74, 0.2);
}

.iisauh-wa-btn:active {
	transform: scale(0.96);
}

.iisauh-wa-btn__icon {
	width: 32px;
	height: 32px;
	position: relative;
	z-index: 2;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.iisauh-wa-btn:hover .iisauh-wa-btn__icon {
	transform: rotate(-6deg) scale(1.05);
}

/* Ambient Pulsing Radar Rings */
.iisauh-wa-btn__pulse,
.iisauh-wa-btn__pulse-inner {
	position: absolute;
	inset: -3px;
	border-radius: 50%;
	pointer-events: none;
	z-index: 1;
}

.iisauh-wa-btn__pulse {
	border: 2px solid rgba(37, 211, 102, 0.65);
	animation: waPulseRing 2.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

.iisauh-wa-btn__pulse-inner {
	border: 1.5px solid rgba(18, 140, 126, 0.5);
	animation: waPulseRing 2.8s cubic-bezier(0.25, 1, 0.5, 1) 1.2s infinite;
}

/* Online Status Badge Dot */
.iisauh-wa-btn__online-badge {
	position: absolute;
	top: 1px;
	right: 1px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #22c55e;
	border: 2.5px solid #ffffff;
	box-shadow: 0 0 6px rgba(34, 197, 94, 0.8);
	z-index: 3;
}

/* --------------------------------------------------------------------------
   4. Mobile Slide-Right Drawer & Tactile Track (Active on <= 768px)
   -------------------------------------------------------------------------- */
.iisauh-wa-mobile-overlay {
	position: fixed;
	inset: 0;
	background: rgba(7, 23, 43, 0.48);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	z-index: 999998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
	pointer-events: none;
}

.iisauh-wa-mobile-overlay.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.iisauh-wa-mobile-drawer {
	position: fixed;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 410px;
	z-index: 999999;
	background: #ffffff;
	border-top-left-radius: 26px;
	border-bottom-left-radius: 26px;
	box-shadow: -12px 0 45px rgba(15, 42, 74, 0.22);
	transform: translateX(105%);
	transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	border: 1px solid rgba(226, 232, 240, 0.8);
}

.iisauh-wa-mobile-drawer.is-open {
	transform: translateX(0);
}

/* Drawer Header */
.iisauh-wa-drawer__header {
	padding: 18px 20px;
	background: linear-gradient(135deg, #0f2a4a 0%, #153a63 100%);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.iisauh-wa-drawer__agent {
	display: flex;
	align-items: center;
	gap: 12px;
}

.iisauh-wa-drawer__avatar {
	position: relative;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(37, 211, 102, 0.16);
	border: 1.5px solid rgba(37, 211, 102, 0.4);
	color: #25D366;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.iisauh-wa-drawer__status-dot {
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: #25D366;
	border: 2px solid #0f2a4a;
	box-shadow: 0 0 6px #25D366;
}

.iisauh-wa-drawer__name {
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 2px 0;
	line-height: 1.25;
}

.iisauh-wa-drawer__status-label {
	font-size: 11.5px;
	color: rgba(255, 255, 255, 0.75);
	font-weight: 500;
	display: block;
}

.iisauh-wa-drawer__close {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	border: none;
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	outline: none;
}

.iisauh-wa-drawer__close:hover,
.iisauh-wa-drawer__close:active {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.08);
}

/* Drawer Body & Chat Bubble */
.iisauh-wa-drawer__body {
	padding: 20px 20px 16px;
	background: radial-gradient(circle at 100% 0%, rgba(37, 211, 102, 0.04) 0%, transparent 40%), #f8fafc;
}

.iisauh-wa-drawer__bubble {
	background: #ffffff;
	border-radius: 16px 16px 16px 4px;
	padding: 14px 16px;
	box-shadow: 0 4px 16px rgba(15, 42, 74, 0.06);
	border: 1px solid #edf2f7;
	position: relative;
	margin-bottom: 12px;
}

.iisauh-wa-drawer__greeting {
	margin: 0;
	font-size: 13.5px;
	line-height: 1.55;
	color: #1e293b;
	font-weight: 500;
}

.iisauh-wa-drawer__time {
	display: block;
	text-align: right;
	font-size: 10.5px;
	color: #94a3b8;
	font-weight: 600;
	margin-top: 4px;
}

.iisauh-wa-drawer__number-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 12px;
	background: rgba(37, 211, 102, 0.1);
	border: 1px solid rgba(37, 211, 102, 0.25);
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	color: #0f5132;
	letter-spacing: 0.2px;
}

/* --------------------------------------------------------------------------
   5. Tactile "Slide Right to Open" Slider Component
   -------------------------------------------------------------------------- */
.iisauh-wa-drawer__footer {
	padding: 16px 20px 22px;
	background: #ffffff;
	border-top: 1px solid #eef2f6;
}

.iisauh-wa-slider {
	width: 100%;
}

.iisauh-wa-slider__track {
	position: relative;
	height: 56px;
	background: #f1f5f9;
	border-radius: 30px;
	overflow: hidden;
	border: 1.5px solid #e2e8f0;
	display: flex;
	align-items: center;
	user-select: none;
	-webkit-user-select: none;
	box-shadow: inset 0 2px 6px rgba(15, 42, 74, 0.04);
}

/* Progress bar trailing the thumb */
.iisauh-wa-slider__progress {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	background: linear-gradient(90deg, rgba(37, 211, 102, 0.35) 0%, rgba(18, 140, 126, 0.6) 100%);
	pointer-events: none;
	border-radius: 30px;
	transition: width 0.08s linear;
}

/* Shimmering Instructional Label */
.iisauh-wa-slider__label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 12.5px;
	font-weight: 700;
	color: #475569;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	pointer-events: none;
	z-index: 1;
	padding-left: 28px;
	transition: opacity 0.2s ease;
}

.iisauh-wa-slider__chevrons {
	color: #25D366;
	font-size: 15px;
	font-weight: 900;
	letter-spacing: 1px;
	animation: waChevronsGlide 1.8s ease-in-out infinite;
}

/* Draggable / Sliding Handle Thumb */
.iisauh-wa-slider__thumb {
	position: absolute;
	left: 3px;
	top: 3px;
	width: 50px;
	height: 50px;
	border-radius: 50%;
	background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 
		0 4px 14px rgba(37, 211, 102, 0.48),
		0 2px 6px rgba(15, 42, 74, 0.12);
	cursor: grab;
	touch-action: pan-y;
	z-index: 3;
	transition: transform 0.08s linear, box-shadow 0.2s ease, background 0.3s ease;
	outline: none;
}

.iisauh-wa-slider__thumb:active {
	cursor: grabbing;
	box-shadow: 
		0 6px 18px rgba(37, 211, 102, 0.6),
		0 2px 8px rgba(15, 42, 74, 0.2);
}

.iisauh-wa-thumb__icon {
	width: 26px;
	height: 26px;
	pointer-events: none;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.iisauh-wa-thumb__success-icon {
	width: 24px;
	height: 24px;
	display: none;
	pointer-events: none;
}

/* Success State when Slider reaches end */
.iisauh-wa-slider.is-success .iisauh-wa-slider__track {
	background: #25D366;
	border-color: #25D366;
}

.iisauh-wa-slider.is-success .iisauh-wa-slider__label {
	color: #ffffff;
}

.iisauh-wa-slider.is-success .iisauh-wa-thumb__icon {
	display: none;
}

.iisauh-wa-slider.is-success .iisauh-wa-thumb__success-icon {
	display: block;
	animation: waSuccessPop 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Direct 1-Tap Fallback Option */
.iisauh-wa-drawer__fallback {
	margin-top: 14px;
	text-align: center;
}

.iisauh-wa-drawer__direct-link {
	font-size: 12px;
	font-weight: 600;
	color: #0284c7;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.iisauh-wa-drawer__direct-link:hover {
	color: #008f7f;
}

/* --------------------------------------------------------------------------
   6. Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes waPulseRing {
	0% {
		transform: scale(1);
		opacity: 0.8;
	}
	60% {
		opacity: 0.2;
	}
	100% {
		transform: scale(1.65);
		opacity: 0;
	}
}

@keyframes waDotBlink {
	0%, 100% {
		opacity: 1;
		transform: scale(1);
	}
	50% {
		opacity: 0.5;
		transform: scale(0.85);
	}
}

@keyframes waChevronsGlide {
	0%, 100% {
		transform: translateX(0);
		opacity: 0.6;
	}
	50% {
		transform: translateX(4px);
		opacity: 1;
	}
}

@keyframes waSuccessPop {
	0% {
		transform: scale(0.4) rotate(-20deg);
		opacity: 0;
	}
	60% {
		transform: scale(1.2) rotate(4deg);
		opacity: 1;
	}
	100% {
		transform: scale(1) rotate(0deg);
		opacity: 1;
	}
}

/* --------------------------------------------------------------------------
   7. Responsive Behaviors
   -------------------------------------------------------------------------- */
@media (min-width: 769px) {
	/* On desktop, hide mobile drawer & overlay */
	.iisauh-wa-mobile-overlay,
	.iisauh-wa-mobile-drawer {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.iisauh-wa-float {
		right: 18px;
		bottom: 22px;
	}

	.iisauh-wa-btn {
		width: 54px;
		height: 54px;
	}

	.iisauh-wa-btn__icon {
		width: 28px;
		height: 28px;
	}

	.iisauh-wa-tooltip {
		display: none !important;
	}

	/* On mobile, allow the drawer to span nicely on narrow devices */
	.iisauh-wa-mobile-drawer {
		max-width: 100%;
		border-bottom-left-radius: 0;
		border-bottom-right-radius: 0;
		border-top-right-radius: 26px;
	}
}
