/* ==========================================================================
   Alto WhatsApp Multi Agent - Frontend Stylesheet
   ========================================================================== */

/* Styling Tokens & CSS variables */
:root {
	--alto-wa-shadow: 0 16px 48px rgba(0, 0, 0, .18);
	--alto-wa-border-radius: 12px;
	--alto-wa-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--alto-wa-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--alto-wa-color-white: #ffffff;
	--alto-wa-color-dark: #2c3e50;
	--alto-wa-color-text-muted: #7f8c8d;
	--alto-wa-color-online: #2ecc71;
	--alto-wa-color-offline: #e74c3c;
	--alto-wa-color-bg-card: #f8f9fa;
	--alto-wa-color-bg-card-hover: #f1f3f5;
	--alto-wa-zindex: 2147483647;
}

/* Main Container */
.alto-wa-root {
	position: fixed;
	bottom: 24px;
	font-family: var(--alto-wa-font-family);
	z-index: var(--alto-wa-zindex);
	display: block;
	box-sizing: border-box;
}

.alto-wa-root *,
.alto-wa-root *::before,
.alto-wa-root *::after {
	box-sizing: border-box;
}

/* Position Layout Options */
.alto-wa-root.alto-wa-pos-right {
	right: 24px;
}

.alto-wa-root.alto-wa-pos-left {
	left: 24px;
}

/* Floating WhatsApp Launcher Button */
.alto-wa-button {
	background-color: var(--alto-wa-primary);
	color: var(--alto-wa-color-white);
	border: none;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: var(--alto-wa-transition);
	position: relative;
	outline: none;
	padding: 0;
}

@keyframes altoWaPulse {

	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, .55);
	}

	70% {
		box-shadow: 0 0 0 12px rgba(37, 211, 102, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}

}

.alto-wa-button {

	animation: altoWaPulse 2.2s infinite;

}

.alto-wa-button:hover {
	transform: translateY(-3px) scale(1.05);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}

.alto-wa-button:focus-visible {
	box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.4);
}

.alto-wa-btn-icon {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.alto-wa-btn-icon svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

/* Popup Modal Window */
.alto-wa-popup {
	position: absolute;
	bottom: 80px;
	width: 340px;
	background-color: var(--alto-wa-color-white);
	border-radius: var(--alto-wa-border-radius);
	box-shadow: var(--alto-wa-shadow);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
	visibility: visible;
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* Float Alignment for Popup Panel */
.alto-wa-pos-right .alto-wa-popup {
	right: 0;
	transform-origin: bottom right;
}

.alto-wa-pos-left .alto-wa-popup {
	left: 0;
	transform-origin: bottom left;
}

/* Popup Hidden State Animation Trigger */
.alto-wa-popup.alto-wa-hidden {
	visibility: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	pointer-events: none;
}

/* Popup Header Styling */
.alto-wa-popup-header {
	background-color: var(--alto-wa-primary);
	color: var(--alto-wa-color-white);
	padding: 22px 20px;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	position: relative;
}

.alto-wa-header-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.alto-wa-header-info h3 {
	margin: 0 0 6px 0 !important;
	font-size: 18px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	color: var(--alto-wa-color-white) !important;
	letter-spacing: 0.5px;
}

/* Active Status Badge */
.alto-wa-status-badge {
	display: inline-flex;
	align-items: center;
	font-size: 13px;
	font-weight: 500;
	padding: 2px 8px;
	background-color: rgba(255, 255, 255, 0.15);
	border-radius: 20px;
	line-height: 1;
	transition: background-color 0.3s ease;
}

.alto-wa-status-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 6px;
	display: inline-block;
	background-color: #bdc3c7;
	transition: background-color 0.3s ease;
}

/* Badge Online/Offline Color Toggles */
.alto-wa-status-badge.alto-wa-online .alto-wa-status-dot {
	background-color: var(--alto-wa-color-online);
	box-shadow: 0 0 8px var(--alto-wa-color-online);
}

.alto-wa-status-badge.alto-wa-offline .alto-wa-status-dot {
	background-color: var(--alto-wa-color-offline);
}

/* Close Button (X) */
.alto-wa-close {
	background: transparent;
	border: none;
	color: var(--alto-wa-color-white);
	font-size: 28px;
	font-weight: 300;
	cursor: pointer;
	padding: 0;
	line-height: 0.5;
	transition: opacity 0.2s;
	opacity: 0.8;
	outline: none;
}

.alto-wa-close:hover {
	opacity: 1;
}

/* Popup Main Body Wrapper */
.alto-wa-popup-body {
	padding: 20px;
	background-color: var(--alto-wa-color-white);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Contact Agent Card Styling */
.alto-wa-agent-card {
	display: flex;
	align-items: center;
	padding: 14px 16px;
	background-color: var(--alto-wa-color-bg-card);
	border-radius: 8px;
	text-decoration: none !important;
	color: var(--alto-wa-color-dark) !important;
	transition: var(--alto-wa-transition);
	border: 1px solid #eef0f2;
}

.alto-wa-agent-card:hover {
	background-color: var(--alto-wa-color-bg-card-hover);
	transform: translateY(-2px);
	border-color: #e2e5e9;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.alto-wa-agent-card:focus-visible {
	outline: 2px solid var(--alto-wa-primary);
	outline-offset: 2px;
}

.alto-wa-agent-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: #25d366;
	color: var(--alto-wa-color-white);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 14px;
	flex-shrink: 0;
}

.alto-wa-agent-avatar svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.alto-wa-agent-details {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.alto-wa-agent-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--alto-wa-color-dark);
	margin-bottom: 2px;
	line-height: 1.2;
}

.alto-wa-agent-desc {
	font-size: 12px;
	color: var(--alto-wa-color-text-muted);
	line-height: 1.3;
}

.alto-wa-agent-arrow {
	font-size: 16px;
	color: var(--alto-wa-color-text-muted);
	transition: transform 0.2s ease;
	line-height: 1;
}

.alto-wa-agent-card:hover .alto-wa-agent-arrow {
	transform: translateX(4px);
	color: var(--alto-wa-primary);
}

/* Footer & Business Hours Metadata */
.alto-wa-popup-footer {
	padding: 12px 20px;
	background-color: #fafbfc;
	border-top: 1px solid #f1f3f5;
	text-align: center;
}

.alto-wa-business-hours {
	font-size: 11px;
	color: var(--alto-wa-color-text-muted);
	font-weight: 500;
	letter-spacing: 0.3px;
	display: block;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* Responsive breakpoints for Tablet & Mobile Viewports */
@media (max-width: 480px) {
	.alto-wa-root {
		bottom: 16px;
	}

	.alto-wa-root.alto-wa-pos-right {
		right: 16px;
	}

	.alto-wa-root.alto-wa-pos-left {
		left: 16px;
	}

	.alto-wa-popup {
		bottom: 74px;
		width: calc(100vw - 32px);
		max-width: 340px;
	}
}