/**
 * Nasi Chat - Frontend Styles
 */

.chnasi-whatsapp-float {
	position: fixed;
	bottom: 24px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.chnasi-whatsapp-float.chnasi-side-left {
	align-items: flex-start;
}

.chnasi-bubble {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background-color: #25d366;
	color: #ffffff;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	cursor: pointer;
	text-decoration: none;
	overflow: visible;
	border: none;
	line-height: 0;
}

.chnasi-bubble:hover {
	transform: scale(1.08);
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.35);
}

.chnasi-bubble.chnasi-size-small {
	width: 48px;
	height: 48px;
}

.chnasi-bubble.chnasi-size-medium {
	width: 56px;
	height: 56px;
}

.chnasi-bubble.chnasi-size-large {
	width: 68px;
	height: 68px;
}

.chnasi-bubble svg {
	width: 60%;
	height: 60%;
	overflow: visible;
}

.chnasi-bubble svg .chnasi-icon-fill {
	fill: #ffffff;
}

.chnasi-custom-icon {
	width: 60%;
	height: 60%;
	object-fit: contain;
	border-radius: 50%;
}

/* Animations */
.chnasi-anim-pulse {
	animation: chnasi-pulse 2s infinite;
}

@keyframes chnasi-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
	}
	70% {
		box-shadow: 0 0 0 16px rgba(37, 211, 102, 0);
	}
	100% {
		box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
	}
}

.chnasi-anim-bounce {
	animation: chnasi-bounce 1.8s infinite;
}

@keyframes chnasi-bounce {
	0%, 20%, 50%, 80%, 100% {
		transform: translateY(0);
	}
	40% {
		transform: translateY(-10px);
	}
	60% {
		transform: translateY(-5px);
	}
}

.chnasi-anim-shake {
	animation: chnasi-shake 3.5s infinite;
}

@keyframes chnasi-shake {
	0%, 90%, 100% {
		transform: rotate(0);
	}
	92% {
		transform: rotate(-12deg);
	}
	94% {
		transform: rotate(10deg);
	}
	96% {
		transform: rotate(-8deg);
	}
	98% {
		transform: rotate(4deg);
	}
}

.chnasi-anim-fade {
	animation: chnasi-fade 3s ease-in-out infinite;
}

@keyframes chnasi-fade {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.6;
	}
}

/* Tooltip */
.chnasi-tooltip {
	position: relative;
	right: 0;
	max-width: 240px;
	margin-bottom: 12px;
	padding: 12px 32px 12px 16px;
	background: #fff;
	color: #1f2937;
	border-radius: 12px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
	font-size: 14px;
	line-height: 1.4;
	animation: chnasi-tooltip-in 0.35s ease forwards;
	opacity: 0;
	transform: translateY(6px);
}

@keyframes chnasi-tooltip-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.chnasi-tooltip-close {
	position: absolute;
	top: 6px;
	right: 8px;
	background: none;
	border: none;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: #9ca3af;
	padding: 2px;
}

.chnasi-tooltip-close:hover {
	color: #374151;
}

.chnasi-tooltip.chnasi-hidden {
	display: none;
}

/* Multi-agent panel */
.chnasi-agent-panel {
	position: relative;
	right: 0;
	width: 300px;
	max-width: 84vw;
	margin-bottom: 12px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
	overflow: hidden;
	display: none;
	animation: chnasi-tooltip-in 0.25s ease forwards;
}

.chnasi-agent-panel.chnasi-open {
	display: block;
}

.chnasi-agent-panel-header {
	background: linear-gradient(135deg, #075e54, #128c7e);
	color: #fff;
	padding: 14px 16px;
	font-weight: 600;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.chnasi-agent-panel-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	line-height: 1;
}

.chnasi-agent-panel-body {
	max-height: 320px;
	overflow-y: auto;
	padding: 8px;
}

.chnasi-offline-notice {
	margin: 8px;
	padding: 10px 12px;
	background: #fef3c7;
	color: #92400e;
	border-radius: 8px;
	font-size: 13px;
}

.chnasi-agent-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 8px;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	transition: background 0.2s ease;
}

.chnasi-agent-row:hover {
	background: #f0fdf4;
}

.chnasi-agent-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.chnasi-agent-avatar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #25d366;
	color: #fff;
	font-weight: 700;
}

.chnasi-agent-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.chnasi-agent-name {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
}

.chnasi-agent-role {
	font-size: 12px;
	color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
	.chnasi-whatsapp-float {
		bottom: 20px;
	}
	.chnasi-whatsapp-float.chnasi-side-right {
		right: 20px;
	}
	.chnasi-whatsapp-float.chnasi-side-left {
		left: 20px;
	}
}

@media (max-width: 480px) {
	.chnasi-whatsapp-float {
		bottom: 16px;
	}
	.chnasi-whatsapp-float.chnasi-side-right {
		right: 16px;
	}
	.chnasi-whatsapp-float.chnasi-side-left {
		left: 16px;
	}
	.chnasi-bubble.chnasi-size-large {
		width: 56px;
		height: 56px;
	}
}
