/* ── Support Chat Widget ──────────────────────────────────────────────────── */

.rt-support-chat {
	position: fixed;
	bottom: 0;
	right: 28px;
	z-index: 9990;
	width: 360px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

/* ── FAB (shown when panel is closed) ───────────────────────────────────── */
.rt-support-chat__fab {
	width: 52px;
	height: 52px;
	border-radius: var(--radius-full);
	background: var(--color-primary);
	color: var(--text-inverted);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
	margin-bottom: var(--sp-4);
	transition: transform var(--transition-base), box-shadow var(--transition-base);
	flex-shrink: 0;
}

.rt-support-chat__fab:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

/* Hide FAB when panel is open */
.rt-support-chat.is-open .rt-support-chat__fab {
	display: none;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
.rt-support-chat__panel {
	width: 100%;
	background: var(--bg-card);
	border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	display: none; /* collapsed by default */
	flex-direction: column;
}

.rt-support-chat.is-open .rt-support-chat__panel {
	display: flex;
}

/* ── Header / toggle ─────────────────────────────────────────────────────── */
.rt-support-chat__header {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px;
	background: var(--color-primary);
	color: var(--text-inverted);
	border: none;
	cursor: pointer;
	text-align: left;
}

.rt-support-chat__title {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: var(--text-base);
	font-weight: var(--weight-semibold);
	letter-spacing: 0.01em;
}

.rt-support-chat__chevron {
	flex-shrink: 0;
	transition: transform var(--transition-base);
}

/* Chevron points down when open (body is visible) */
.rt-support-chat.is-open .rt-support-chat__chevron {
	transform: rotate(180deg);
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.rt-support-chat__body {
	display: flex;
	flex-direction: column;
	flex: 1;
}

/* ── Messages area ───────────────────────────────────────────────────────── */
.rt-support-chat__messages {
	flex: 1;
	max-height: 380px;
	min-height: 120px;
	overflow-y: auto;
	padding: var(--sp-4);
	display: flex;
	flex-direction: column;
	gap: 10px;
	scroll-behavior: smooth;
	background: var(--bg-subtle);
}

/* Empty state */
.rt-support-chat__empty {
	background: var(--bg-card);
	border-radius: var(--radius-lg);
	padding: 18px var(--sp-5);
	font-size: var(--text-base);
	color: var(--text-secondary);
	line-height: 1.55;
	text-align: center;
	margin: auto;
}

/* ── Compose area — reuse .rt-chat styles ────────────────────────────────── */
/* (rt-chat__compose, rt-chat__input-row, rt-chat__textarea,
    rt-chat__send-btn, rt-chat__attach-btn are already defined in chat.css) */

.rt-support-chat .rt-chat__compose {
	background: var(--bg-card);
	border-top: 1px solid var(--border-color);
}

/* ── Unread badge on FAB ─────────────────────────────────────────────────── */
.rt-support-chat__fab-badge {
	position: absolute;
	top: -3px;
	right: -3px;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	background: var(--color-red);
	color: var(--text-inverted);
	font-size: var(--text-2xs);
	font-weight: var(--weight-bold);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 var(--sp-1);
	pointer-events: none;
}

.rt-support-chat__fab {
	position: relative; /* so badge is positioned inside */
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.rt-support-chat {
		right: 0;
		width: 100%;
		bottom: 0;
	}
	.rt-support-chat__panel {
		border-radius: var(--radius-xl) var(--radius-xl) 0 0;
	}
	.rt-support-chat__fab {
		right: var(--sp-4);
		bottom: var(--sp-4);
		position: fixed;
	}
	.rt-support-chat.is-open .rt-support-chat__fab {
		display: none;
	}
}
