/* Chat Link for WhatsApp — front-end, chat panel and admin styles */

/* ===== Shared button ===== */
.clw-button {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	line-height: 1;
	border: 0;
	cursor: pointer;
}
.clw-button .clw-img {
	display: block;
	height: auto;
	max-width: 100%;
}
.clw-style-icon {
	gap: 10px;
	color: #fff;
}
.clw-icon-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.clw-icon-circle .clw-glyph {
	width: 34px;
	height: 34px;
}
.clw-style-icon:hover .clw-icon-circle {
	transform: scale(1.08);
}
.clw-cta-text {
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: #25d366;
	padding: 8px 14px;
	border-radius: 24px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	white-space: nowrap;
}

/* ===== Floating wrapper ===== */
.clw-float {
	position: fixed;
	bottom: 20px;
	z-index: 99999;
	opacity: 0;
	transition: opacity 0.4s ease;
}
.clw-float.clw-ready {
	opacity: 1;
}
.clw-float.clw-pos-right {
	right: 20px;
}
.clw-float.clw-pos-left {
	left: 20px;
}
.clw-launcher {
	position: relative;
	background: transparent;
	padding: 0;
}
.clw-float.clw-pos-left .clw-style-icon {
	flex-direction: row;
}
.clw-float.clw-pos-right .clw-style-icon {
	flex-direction: row-reverse;
}
.clw-float.clw-float-image .clw-img {
	max-height: 56px;
	width: auto;
}

/* Attention badge + bounce */
.clw-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: #ff3b30;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-shadow: 0 0 0 2px #fff;
}
.clw-float.clw-pos-left .clw-badge {
	right: auto;
	left: -4px;
}
@media (prefers-reduced-motion: no-preference) {
	.clw-float .clw-icon-circle {
		animation: clw-pulse 2.4s ease-out infinite;
	}
	.clw-float:not(.clw-open) .clw-launcher .clw-badge {
		animation: clw-bounce 1.6s ease infinite;
	}
}
@keyframes clw-pulse {
	0% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 0 rgba(37,211,102,0.6); }
	70% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 14px rgba(37,211,102,0); }
	100% { box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 0 0 0 rgba(37,211,102,0); }
}
@keyframes clw-bounce {
	0%, 100% { transform: translateY(0); }
	30% { transform: translateY(-4px); }
	50% { transform: translateY(0); }
}

/* ===== Greeting bubble ===== */
.clw-greeting {
	position: absolute;
	bottom: 74px;
	max-width: 240px;
	background: #fff;
	color: #222;
	font-size: 14px;
	line-height: 1.4;
	padding: 12px 32px 12px 14px;
	border-radius: 12px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s ease;
}
.clw-float.clw-pos-right .clw-greeting { right: 0; }
.clw-float.clw-pos-left .clw-greeting { left: 0; }
.clw-float.clw-greet-show .clw-greeting {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	cursor: pointer;
}
.clw-greeting.clw-greeting-hidden { display: none; }
.clw-greeting-close {
	position: absolute;
	top: 4px;
	right: 6px;
	border: 0;
	background: transparent;
	font-size: 18px;
	line-height: 1;
	color: #888;
	cursor: pointer;
}

/* ===== Chat panel ===== */
.clw-panel {
	position: absolute;
	bottom: 76px;
	width: 300px;
	max-width: calc(100vw - 32px);
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}
.clw-float.clw-pos-right .clw-panel { right: 0; }
.clw-float.clw-pos-left .clw-panel { left: 0; transform-origin: bottom left; }
.clw-float.clw-open .clw-panel {
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}
.clw-panel[hidden] { display: block; } /* shown/hidden via opacity for animation */
.clw-panel-head {
	position: relative;
	background: #075e54;
	color: #fff;
	padding: 16px 40px 14px 16px;
}
.clw-panel-title { font-size: 16px; font-weight: 700; }
.clw-panel-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.clw-status {
	display: inline-block;
	margin-top: 8px;
	font-size: 11px;
	padding: 2px 8px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.18);
}
.clw-status.clw-on::before,
.clw-agent-dot.clw-on { background: #25d366; }
.clw-status.clw-off::before,
.clw-agent-dot.clw-off { background: #bbb; }
.clw-status::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	margin-right: 5px;
	vertical-align: middle;
}
.clw-panel-close {
	position: absolute;
	top: 8px;
	right: 10px;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.85;
}
.clw-agents {
	max-height: 320px;
	overflow-y: auto;
	background: #efeae2;
	padding: 10px;
}
.clw-agent {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	color: #222;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.clw-agent:last-child { margin-bottom: 0; }
.clw-agent:hover { background: #f3f7f5; }
.clw-avatar {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	overflow: hidden;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #25d366;
	color: #fff;
	font-weight: 700;
}
.clw-avatar img { width: 100%; height: 100%; object-fit: cover; }
.clw-avatar-glyph .clw-glyph { width: 24px; height: 24px; }
.clw-agent-info { display: flex; flex-direction: column; }
.clw-agent-name { font-weight: 600; font-size: 14px; }
.clw-agent-role { font-size: 12px; color: #667; }
.clw-agent-dot {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
	.clw-icon-circle { width: 52px; height: 52px; }
	.clw-icon-circle .clw-glyph { width: 30px; height: 30px; }
	.clw-float { bottom: 16px; }
	.clw-float.clw-pos-right { right: 16px; }
	.clw-float.clw-pos-left { left: 16px; }
}

/* ===== Admin ===== */
.clw-admin .clw-preview-row {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	align-items: center;
	margin: 12px 0 20px;
}
.clw-admin .clw-preview-box {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-items: flex-start;
	padding: 16px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}
.clw-admin .clw-preview-label {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #646970;
}
.clw-admin .clw-icon-circle { animation: none; }
.clw-admin .clw-style-icon { color: #075e54; }

.clw-hours td { padding: 2px 8px 2px 0; }
.clw-agents-admin { margin-bottom: 10px; }
.clw-agent-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	padding: 8px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}
.clw-agent-row input[type="text"] { min-width: 130px; }
.clw-agent-avatar-prev img {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	vertical-align: middle;
}
.clw-agent-remove { color: #b32d2e; font-size: 18px; text-decoration: none; }

.clw-stats-cards { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0; }
.clw-stat {
	min-width: 120px;
	padding: 16px 20px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	text-align: center;
}
.clw-stat strong { display: block; font-size: 26px; line-height: 1.1; }
.clw-stat span { font-size: 12px; color: #646970; }
.clw-stats-tables { display: flex; flex-wrap: wrap; gap: 24px; }
.clw-stats-tables > div { flex: 1; min-width: 260px; }

/* Shortcode table + builder */
.clw-sc-table { max-width: 900px; margin-bottom: 8px; }
.clw-sc-table td { vertical-align: middle; }
.clw-sc-field { width: 100%; min-width: 220px; }

.clw-builder {
	max-width: 900px;
	padding: 16px;
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	margin: 8px 0 16px;
}
.clw-builder-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: 14px;
}
.clw-builder-fields label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-weight: 600;
	font-size: 12px;
	color: #1d2327;
}
.clw-builder-fields input,
.clw-builder-fields select { min-width: 150px; font-weight: 400; }
.clw-builder-out { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.clw-builder-out .clw-b-output { flex: 1; }
.clw-builder-preview { display: inline-flex; }
.clw-b-preview-area { display: flex; align-items: center; min-height: 60px; }
.clw-b-preview-area .clw-img { max-height: 56px; width: auto; }
.clw-admin .clw-builder-preview .clw-icon-circle { animation: none; }
.clw-admin .clw-builder-preview .clw-style-icon { color: #fff; gap: 10px; }

/* Channel admin rows */
.clw-channels-admin { margin-bottom: 10px; }
.clw-channel-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 8px;
	padding: 8px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}
.clw-channel-row input[type="text"] { min-width: 160px; }

/* Channels in the front-end panel */
.clw-channels { background: #efeae2; padding: 0 10px 10px; }
.clw-channels-title {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: #667;
	margin: 4px 4px 8px;
}
.clw-channel {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border-radius: 10px;
	padding: 10px 12px;
	margin-bottom: 8px;
	color: #222;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.clw-channel:last-child { margin-bottom: 0; }
.clw-channel:hover { background: #f3f7f5; }
.clw-ch-icon { color: #fff; }
.clw-ch-icon .clw-glyph { width: 22px; height: 22px; }
.clw-ch-whatsapp .clw-ch-icon { background: #25d366; }
.clw-ch-phone .clw-ch-icon { background: #22a7f0; }
.clw-ch-sms .clw-ch-icon { background: #20c05a; }
.clw-ch-email .clw-ch-icon { background: #e0533d; }
.clw-ch-viber .clw-ch-icon { background: #7360f2; }
.clw-ch-telegram .clw-ch-icon { background: #29a9eb; }
.clw-ch-messenger .clw-ch-icon { background: #0084ff; }
.clw-ch-custom .clw-ch-icon { background: #4a4a4a; }
