/* PrimeWeb Chatbot — matches theme tokens: ink #0A0A0A, surface #1A1A1A, lime #D9F45F */

#pw-chat-root {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
}

/* ---------- FAB ---------- */

.pw-chat-fab {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: #d9f45f;
	color: #0a0a0a;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(217, 244, 95, .5);
	transition: transform .2s ease, box-shadow .2s ease;
	animation: pwChatPulse 2.6s infinite;
}
.pw-chat-fab:hover { transform: scale(1.06); }
.pw-chat-fab.is-open { animation: none; transform: rotate(90deg); }
.pw-chat-fab__dot {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #22c55e;
	border: 2px solid #0a0a0a;
}
@keyframes pwChatPulse {
	0%   { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(217,244,95,.45); }
	70%  { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 14px rgba(217,244,95,0); }
	100% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(217,244,95,0); }
}

/* ---------- Teaser ---------- */

.pw-chat-teaser {
	position: absolute;
	right: 74px;
	bottom: 14px;
	max-width: 240px;
	padding: 10px 14px;
	border: 1px solid rgba(217, 244, 95, .35);
	border-radius: 14px 14px 4px 14px;
	background: #1a1a1a;
	color: #f5f5f5;
	font-size: 13px;
	line-height: 1.45;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
	animation: pwChatFadeUp .4s ease;
}
@keyframes pwChatFadeUp {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Panel ---------- */

.pw-chat-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: min(380px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 130px));
	display: flex;
	flex-direction: column;
	background: #141414;
	border: 1px solid rgba(255, 255, 255, .08);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
	animation: pwChatFadeUp .25s ease;
}

.pw-chat-head {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 14px;
	background: linear-gradient(135deg, #1a1a1a 0%, #101010 100%);
	border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.pw-chat-avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #d9f45f;
	color: #0a0a0a;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.pw-chat-head__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pw-chat-head__meta strong { color: #fff; font-size: 14px; font-weight: 700; }
.pw-chat-status { color: #9ca3af; font-size: 11.5px; display: flex; align-items: center; gap: 6px; }
.pw-chat-status i {
	width: 7px; height: 7px; border-radius: 50%;
	background: #22c55e; display: inline-block;
	box-shadow: 0 0 6px rgba(34, 197, 94, .8);
}
.pw-chat-iconbtn {
	background: transparent;
	border: none;
	color: #9ca3af;
	font-size: 16px;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.pw-chat-iconbtn:hover { background: rgba(255, 255, 255, .08); color: #fff; }

/* ---------- Log ---------- */

.pw-chat-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
}
.pw-chat-log::-webkit-scrollbar { width: 6px; }
.pw-chat-log::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }

.pw-msg { display: flex; }
.pw-msg--user { justify-content: flex-end; }
.pw-msg__bubble {
	max-width: 84%;
	padding: 10px 13px;
	border-radius: 14px;
	font-size: 13.5px;
	line-height: 1.55;
	word-wrap: break-word;
}
.pw-msg--bot .pw-msg__bubble {
	background: #1f1f1f;
	color: #e5e5e5;
	border-bottom-left-radius: 4px;
	border: 1px solid rgba(255, 255, 255, .06);
}
.pw-msg--user .pw-msg__bubble {
	background: #d9f45f;
	color: #0a0a0a;
	font-weight: 600;
	border-bottom-right-radius: 4px;
}
.pw-msg__bubble strong { color: #d9f45f; font-weight: 700; }
.pw-msg--user .pw-msg__bubble strong { color: #0a0a0a; }
.pw-msg__bubble a {
	color: #d9f45f;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.pw-msg__bubble ul { margin: 6px 0 4px; padding-left: 18px; }
.pw-msg__bubble li { margin: 3px 0; }

/* typing dots */
.pw-msg--typing .pw-msg__bubble { display: flex; gap: 5px; align-items: center; padding: 12px 15px; }
.pw-msg--typing i {
	width: 7px; height: 7px; border-radius: 50%;
	background: #6b7280;
	animation: pwChatBounce 1.2s infinite;
}
.pw-msg--typing i:nth-child(2) { animation-delay: .18s; }
.pw-msg--typing i:nth-child(3) { animation-delay: .36s; }
@keyframes pwChatBounce {
	0%, 60%, 100% { transform: translateY(0); opacity: .5; }
	30%           { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Chips ---------- */

.pw-chat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	padding: 0 14px 10px;
}
.pw-chat-chip {
	padding: 7px 12px;
	border-radius: 999px;
	border: 1px solid rgba(217, 244, 95, .45);
	background: rgba(217, 244, 95, .08);
	color: #d9f45f;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, transform .15s;
	font-family: inherit;
}
.pw-chat-chip:hover { background: #d9f45f; color: #0a0a0a; transform: translateY(-1px); }

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

.pw-chat-form {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid rgba(255, 255, 255, .07);
	background: #141414;
}
.pw-chat-form input {
	flex: 1;
	padding: 11px 14px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .12);
	background: #1f1f1f;
	color: #fff;
	font-size: 13.5px;
	font-family: inherit;
	outline: none;
	transition: border-color .15s;
}
.pw-chat-form input:focus { border-color: rgba(217, 244, 95, .6); }
.pw-chat-form input::placeholder { color: #6b7280; }
.pw-chat-send {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: #d9f45f;
	color: #0a0a0a;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s;
	flex-shrink: 0;
}
.pw-chat-send:hover { transform: scale(1.08); }

.pw-chat-foot {
	text-align: center;
	padding: 7px 10px 9px;
	font-size: 10.5px;
	color: #6b7280;
	background: #141414;
	border-top: 1px solid rgba(255, 255, 255, .04);
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
	#pw-chat-root { right: 12px; bottom: 12px; }
	.pw-chat-panel {
		width: calc(100vw - 24px);
		height: calc(100vh - 110px);
		bottom: 72px;
		border-radius: 16px;
	}
	.pw-chat-teaser { right: 0; bottom: 76px; max-width: 200px; }
}

@media (prefers-reduced-motion: reduce) {
	.pw-chat-fab { animation: none; }
	.pw-chat-panel, .pw-chat-teaser { animation: none; }
}

/* ---------- v1.1: contact buttons, resume, mobile sheet ---------- */

.pw-msg--links { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.pw-chat-linkbtn {
	display: inline-flex; align-items: center; padding: 9px 14px; border-radius: 999px;
	background: #d9f45f; color: #0a0a0a; font-size: 13px; font-weight: 700; text-decoration: none;
	transition: transform .15s ease, box-shadow .15s ease;
}
.pw-chat-linkbtn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(217, 244, 95, .25); }
.pw-chat-linkbtn:focus-visible, .pw-chat-chip:focus-visible, .pw-chat-fab:focus-visible, .pw-chat-iconbtn:focus-visible { outline: 2px solid #d9f45f; outline-offset: 2px; }
.pw-msg__bubble a { color: #d9f45f; text-underline-offset: 2px; }

@media (max-width: 480px) {
	/* Full-height sheet that respects the notch and the on-screen keyboard. */
	.pw-chat-panel { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; padding-bottom: env(safe-area-inset-bottom, 0); }
	.pw-chat-log { overscroll-behavior: contain; }
	.pw-chat-form input { font-size: 16px; } /* prevents iOS zoom-on-focus */
}
