/**
 * WA Marketing - Live Chat Widget Styles
 *
 * @package WA_Marketing
 */

/* ========================================
   Widget Container
   ======================================== */
.wm-livechat {
	position: fixed;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.wm-livechat-bottom-right {
	bottom: 24px;
	right: 24px;
}

.wm-livechat-bottom-left {
	bottom: 24px;
	left: 24px;
}

/* ========================================
   Floating Toggle Button
   ======================================== */
.wm-livechat-toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	position: relative;
}

.wm-livechat-toggle:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.wm-livechat-toggle:active {
	transform: scale(0.95);
}

.wm-livechat-toggle img {
	position: relative;
	z-index: 1;
	display: block;
	width: 28px !important;
	height: 28px !important;
	min-width: 28px !important;
	min-height: 28px !important;
	max-width: 28px !important;
	max-height: 28px !important;
	flex-shrink: 0 !important;
	pointer-events: none;
	border: none !important;
	box-shadow: none !important;
	margin: 0 !important;
	padding: 0 !important;
	vertical-align: middle !important;
}

.wm-livechat-icon-close {
	display: none !important;
}

.wm-livechat.wm-livechat-open .wm-livechat-icon-open {
	display: none !important;
}

.wm-livechat.wm-livechat-open .wm-livechat-icon-close {
	display: block !important;
}

/* Pulse animation */
.wm-livechat-toggle::before {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: inherit;
	opacity: 0.4;
	animation: wm-pulse 2s ease-out infinite;
}

.wm-livechat.wm-livechat-open .wm-livechat-toggle::before {
	animation: none;
	opacity: 0;
}

@keyframes wm-pulse {
	0% {
		transform: scale(1);
		opacity: 0.4;
	}
	100% {
		transform: scale(1.5);
		opacity: 0;
	}
}

/* ========================================
   Popup
   ======================================== */
.wm-livechat-popup {
	position: absolute;
	bottom: 76px;
	width: 340px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px) scale(0.95);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
	pointer-events: none;
}

.wm-livechat-bottom-right .wm-livechat-popup {
	right: 0;
}

.wm-livechat-bottom-left .wm-livechat-popup {
	left: 0;
}

.wm-livechat.wm-livechat-open .wm-livechat-popup {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

/* ========================================
   Popup Header
   ======================================== */
.wm-livechat-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	color: #fff;
}

.wm-livechat-popup-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.wm-livechat-close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.8;
	transition: opacity 0.2s ease;
}

.wm-livechat-close:hover {
	opacity: 1;
}

/* ========================================
   Form
   ======================================== */
.wm-livechat-form {
	padding: 20px;
}

.wm-livechat-field {
	margin-bottom: 14px;
}

.wm-livechat-field:last-of-type {
	margin-bottom: 16px;
}

.wm-livechat-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

.wm-required {
	color: #d63638;
}

.wm-livechat-field input,
.wm-livechat-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	color: #333;
	background: #fafafa;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	box-sizing: border-box;
}

.wm-livechat-field input:focus,
.wm-livechat-field textarea:focus {
	outline: none;
	border-color: #25D366;
	box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
	background: #fff;
}

.wm-livechat-field input::placeholder,
.wm-livechat-field textarea::placeholder {
	color: #aaa;
}

.wm-livechat-field textarea {
	resize: vertical;
	min-height: 60px;
}

.wm-livechat-field input.wm-field-error,
.wm-livechat-field textarea.wm-field-error {
	border-color: #d63638;
	box-shadow: 0 0 0 3px rgba(214, 54, 56, 0.1);
}

/* ========================================
   Alert
   ======================================== */
.wm-livechat-alert {
	display: none;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.4;
	margin-bottom: 14px;
}

.wm-livechat-alert.wm-alert-visible {
	display: block;
}

.wm-livechat-alert.wm-alert-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.wm-livechat-alert.wm-alert-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* ========================================
   Submit Button
   ======================================== */
.wm-livechat-submit {
	width: 100%;
	padding: 12px 20px;
	border: none;
	border-radius: 10px;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	transition: opacity 0.2s ease, transform 0.1s ease;
}

.wm-livechat-submit:hover {
	opacity: 0.9;
}

.wm-livechat-submit:active {
	transform: scale(0.98);
}

.wm-livechat-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
	.wm-livechat {
		bottom: 16px;
	}

	.wm-livechat-bottom-right {
		right: 16px;
	}

	.wm-livechat-bottom-left {
		left: 16px;
	}

	.wm-livechat-popup {
		width: calc(100vw - 32px);
		bottom: 72px;
	}

	.wm-livechat-bottom-right .wm-livechat-popup {
		right: -8px;
	}

	.wm-livechat-bottom-left .wm-livechat-popup {
		left: -8px;
	}

	.wm-livechat-toggle {
		width: 54px;
		height: 54px;
	}
}
