/* PlaySight Support Bot — Chat Widget (multi-instance) */

.psb-inline,
.psb-floating-host,
.psb-window,
.psb-window * {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Floating launcher ---------- */

.psb-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #0066ff;
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999998;
	transition: transform 0.15s ease, background 0.15s ease;
}
.psb-launcher:hover { background: #0052cc; transform: scale(1.05); }
.psb-launcher svg { width: 26px; height: 26px; fill: #fff; }

/* ---------- Window (shared) ---------- */

.psb-window {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid #e5e7eb;
}

/* Floating positioning */
.psb-window.psb-floating {
	position: fixed;
	bottom: 92px;
	right: 24px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 120px);
	z-index: 999999;
	display: none;
}
.psb-window.psb-floating.psb-open { display: flex; }

/* Inline positioning */
.psb-window.psb-inline {
	width: 100%;
	max-width: 720px;
	height: 560px;
	margin: 16px auto;
}

/* ---------- Header ---------- */

.psb-header {
	background: #0066ff;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}
.psb-header-title { font-weight: 600; font-size: 15px; }
.psb-header-status { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.psb-close {
	background: none; border: none; color: #fff; cursor: pointer;
	font-size: 22px; line-height: 1; padding: 0; opacity: 0.85;
}
.psb-close:hover { opacity: 1; }

/* ---------- Messages ---------- */

.psb-messages { flex: 1; overflow-y: auto; padding: 16px; background: #f7f8fa; }
.psb-msg { margin-bottom: 12px; display: flex; }
.psb-msg-bubble {
	max-width: 85%; padding: 10px 14px; border-radius: 16px;
	font-size: 14px; line-height: 1.45; word-wrap: break-word; white-space: pre-wrap;
}
.psb-msg-bot { justify-content: flex-start; }
.psb-msg-bot .psb-msg-bubble {
	background: #fff; color: #1a1a1a; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px;
}
.psb-msg-bubble-image {
	padding: 4px;
}
.psb-msg-image {
	max-width: 100%;
	max-height: 320px;
	display: block;
	border-radius: 8px;
	cursor: zoom-in;
}
.psb-msg-user { justify-content: flex-end; }
.psb-msg-user .psb-msg-bubble {
	background: #0066ff; color: #fff; border-bottom-right-radius: 4px;
}
.psb-msg-system { justify-content: center; }
.psb-msg-system .psb-msg-bubble {
	background: #fff5d6; color: #6b5800; border: 1px solid #f0e1a3;
	font-size: 12px; max-width: 100%; text-align: center;
}
.psb-msg-error .psb-msg-bubble {
	background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5;
}

.psb-typing { display: inline-flex; gap: 3px; align-items: center; padding: 4px 0; }
.psb-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: #9ca3af; animation: psb-blink 1.2s infinite ease-in-out;
}
.psb-typing span:nth-child(2) { animation-delay: 0.2s; }
.psb-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes psb-blink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }

/* ---------- Input row ---------- */

.psb-input-row {
	border-top: 1px solid #e5e7eb;
	padding: 12px;
	display: flex;
	gap: 8px;
	background: #fff;
	flex-shrink: 0;
}
.psb-input {
	flex: 1; border: 1px solid #d1d5db; border-radius: 20px;
	padding: 9px 14px; font-size: 14px; outline: none; resize: none;
	max-height: 80px; font-family: inherit;
}
.psb-input:focus { border-color: #0066ff; }
.psb-send {
	background: #0066ff; border: none; color: #fff;
	width: 38px; height: 38px; border-radius: 50%;
	cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.psb-send:disabled { background: #d1d5db; cursor: not-allowed; }
.psb-send svg { width: 18px; height: 18px; fill: #fff; }

.psb-footer {
	font-size: 11px; color: #6b7280; text-align: center;
	padding: 6px 12px 8px; background: #fff; flex-shrink: 0;
}

/* ---------- Lock screen (access code) ---------- */

.psb-lock {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	text-align: center;
	background: #f7f8fa;
}
.psb-lock-icon {
	width: 48px; height: 48px;
	background: #e0e7ff;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	margin-bottom: 16px;
}
.psb-lock-icon svg { width: 24px; height: 24px; fill: #0066ff; }
.psb-lock-title { font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 6px; }
.psb-lock-text  { font-size: 13px; color: #6b7280; margin-bottom: 20px; max-width: 300px; }
.psb-lock-input {
	width: 100%; max-width: 280px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	padding: 10px 14px;
	font-size: 14px;
	outline: none;
	margin-bottom: 10px;
	font-family: inherit;
	letter-spacing: 0.05em;
}
.psb-lock-input:focus { border-color: #0066ff; }
.psb-lock-button {
	width: 100%; max-width: 280px;
	background: #0066ff; color: #fff; border: none;
	padding: 10px 14px; border-radius: 8px; font-size: 14px;
	cursor: pointer; font-weight: 600;
}
.psb-lock-button:hover { background: #0052cc; }
.psb-lock-button:disabled { background: #d1d5db; cursor: not-allowed; }
.psb-lock-error {
	color: #b91c1c; font-size: 13px; margin-top: 10px; min-height: 18px;
}

/* ---------- Mobile ---------- */

@media (max-width: 480px) {
	.psb-window.psb-floating {
		bottom: 0; right: 0; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0;
	}
	.psb-launcher { bottom: 16px; right: 16px; }
	.psb-window.psb-inline { height: 480px; }
}
