/* Tempered Chatbox widget - colors via CSS custom properties set from plugin settings */

.tcb-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

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

/* Launcher: call-to-action label pill + mascot circle, one tappable button */
.tcb-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	border: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	font-family: inherit;
}
.tcb-launcher-label {
	padding: 12px 16px;
	background: #fff;
	color: #1e1e1e;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	white-space: nowrap;
}
.tcb-launcher-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 68px;
	height: 68px;
	flex: 0 0 68px;
	border-radius: 50%;
	background: var(--tcb-primary, #1f6f8b);
	color: #fff;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
	transition: transform 0.15s ease, background 0.15s ease;
}
.tcb-launcher-icon svg { width: 30px; height: 30px; }
.tcb-launcher-mascot {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.tcb-launcher:hover .tcb-launcher-icon { background: var(--tcb-primary-hover, #17566c); transform: scale(1.05); }
.tcb-launcher:hover .tcb-launcher-label { color: var(--tcb-primary, #1f6f8b); }
.tcb-launcher:focus-visible { outline: 3px solid var(--tcb-primary, #1f6f8b); outline-offset: 4px; border-radius: 999px; }
.tcb-launcher.tcb-hidden { display: none; }

@media (min-width: 768px) {
	.tcb-launcher-icon { width: 76px; height: 76px; flex-basis: 76px; }
	.tcb-launcher-icon svg { width: 32px; height: 32px; }
	.tcb-launcher-label { font-size: 15px; padding: 13px 18px; }
}

/* Panel */
.tcb-panel[hidden] { display: none !important; }
.tcb-panel {
	position: absolute;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: 372px;
	height: 580px;
	max-height: calc(100vh - 40px);
	background: #fff;
	border: 1px solid #c0c0c0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.3);
}

/* Header */
.tcb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	background: var(--tcb-header, #1e1e1e);
	color: #fff;
	border-bottom: 3px solid var(--tcb-primary, #1f6f8b);
}
.tcb-title { font-family: inherit; font-weight: 700; font-size: 15px; }
.tcb-subtitle { color: #c0c0c0; font-size: 12px; margin-top: 2px; }
.tcb-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: #c0c0c0;
	cursor: pointer;
}
.tcb-close svg { width: 18px; height: 18px; }
.tcb-close:hover { color: #fff; }
.tcb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Emergency call bar */
.tcb-callbar {
	display: block;
	padding: 8px 16px;
	background: var(--tcb-primary, #1f6f8b);
	color: #fff;
	text-align: center;
	text-decoration: none;
	font-size: 13px;
}
.tcb-callbar:hover { background: var(--tcb-primary-hover, #17566c); color: #fff; }
.tcb-callbar strong { font-family: inherit; }

/* Message log */
.tcb-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	background: #fff;
}
.tcb-msg { display: flex; margin-bottom: 10px; }
.tcb-msg.tcb-user { justify-content: flex-end; }
.tcb-bubble {
	max-width: 82%;
	padding: 10px 13px;
	border-radius: 10px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.tcb-assistant .tcb-bubble { background: #f2f2f2; color: #000; border-bottom-left-radius: 3px; }
.tcb-user .tcb-bubble { background: var(--tcb-primary, #1f6f8b); color: #fff; border-bottom-right-radius: 3px; }
.tcb-bubble a.tcb-tel { color: inherit; font-weight: 700; text-decoration: underline; }

/* Typing indicator */
.tcb-typing { display: flex; gap: 5px; align-items: center; padding: 13px 15px; }
.tcb-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--tcb-primary, #1f6f8b);
	animation: tcb-pulse 1.1s infinite ease-in-out;
}
.tcb-typing span:nth-child(2) { animation-delay: 0.18s; }
.tcb-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tcb-pulse {
	0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
	35% { opacity: 1; transform: translateY(-3px); }
}

/* Footer */
.tcb-footer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid #f2f2f2;
	background: #fff;
	margin: 0;
}
.tcb-input {
	flex: 1;
	resize: none;
	border: 1px solid #c0c0c0;
	border-radius: 6px;
	padding: 9px 11px;
	font: inherit;
	color: #000;
	background: #fff;
	max-height: 110px;
}
.tcb-input:focus { outline: 2px solid var(--tcb-primary, #1f6f8b); outline-offset: -1px; border-color: var(--tcb-primary, #1f6f8b); }
.tcb-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	border: 0;
	border-radius: 6px;
	background: var(--tcb-primary, #1f6f8b);
	color: #fff;
	cursor: pointer;
}
.tcb-send svg { width: 18px; height: 18px; }
.tcb-send:hover:not(:disabled) { background: var(--tcb-primary-hover, #17566c); }
.tcb-send:disabled { background: #c0c0c0; cursor: default; }
.tcb-send:focus-visible { outline: 2px solid var(--tcb-primary, #1f6f8b); outline-offset: 2px; }

/* Mobile */
@media (max-width: 480px) {
	.tcb-root { right: 14px; bottom: 14px; }
	.tcb-panel {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		max-height: none;
		border: 0;
		border-radius: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tcb-launcher-icon { transition: none; }
	.tcb-launcher:hover .tcb-launcher-icon { transform: none; }
	.tcb-typing span { animation: none; opacity: 0.6; }
}

/* Powered by */
.tcb-powered { text-align: center; padding: 5px 0 7px; background: #fff; }
.tcb-powered a { color: #9a9a9a; font-size: 11px; text-decoration: none; }
.tcb-powered a:hover { color: #666; text-decoration: underline; }

/* After-hours info bar variant of the call bar */
.tcb-infobar { background: #efefef; color: #333; cursor: default; }
.tcb-infobar:hover { background: #efefef; color: #333; }
