/* =====================================================
   REPPED — AI Chatbot Assistant
   Self-contained widget styles. Everything is namespaced
   under `.repbot-*` so it never collides with site styles.
   Brand tokens (--primary, --bg-*, --text-*) come from
   /style.css; fallbacks keep the widget usable anywhere.
   ===================================================== */

.repbot,
.repbot * {
	box-sizing: border-box;
}

.repbot {
	--repbot-accent: var(--primary, #4cb2ba);
	--repbot-accent-dark: var(--primary-dark, #389aa1);
	--repbot-surface: var(--bg-surface, #1c1c1c);
	--repbot-panel: var(--bg-primary, #141414);
	--repbot-tile: var(--bg-tile, #1a1a1a);
	--repbot-text: var(--text-primary, #d4d4d4);
	--repbot-text-dim: var(--text-secondary, #8a8a8a);
	--repbot-text-muted: var(--text-muted, #5a5a5a);
	--repbot-border: rgba(212, 212, 212, 0.08);
	--repbot-radius: 16px;

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99;
	font-family: 'Reakt', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	color: var(--repbot-text);
}

/* ---------------------------------------------------
   Toggle button (FAB)
   --------------------------------------------------- */
.repbot-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-left: auto;
	padding: 0;
	border: 1px solid var(--repbot-border);
	border-radius: 50%;
	cursor: pointer;
	color: var(--repbot-text);
	background: rgba(20, 20, 20, 0.72);
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.repbot-toggle:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.repbot-toggle:focus-visible {
	outline: 2px solid var(--repbot-accent);
	outline-offset: 3px;
}
.repbot-toggle svg {
	width: 26px;
	height: 26px;
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.repbot-toggle .repbot-ic-close {
	position: absolute;
	opacity: 0;
	transform: scale(0.6) rotate(-45deg);
}
.repbot.is-open .repbot-toggle .repbot-ic-chat {
	opacity: 0;
	transform: scale(0.6) rotate(45deg);
}
.repbot.is-open .repbot-toggle .repbot-ic-close {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

/* Unread / attention dot */
.repbot-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--repbot-accent);
	border: 2px solid var(--repbot-panel);
	display: none;
}
.repbot.has-badge:not(.is-open) .repbot-badge {
	display: block;
}

/* ---------------------------------------------------
   Panel
   --------------------------------------------------- */
.repbot-panel {
	position: absolute;
	right: 0;
	bottom: 76px;
	width: 374px;
	max-width: calc(100vw - 32px);
	height: 600px;
	max-height: calc(100vh - 120px);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--repbot-panel);
	border: 1px solid var(--repbot-border);
	border-radius: var(--repbot-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(12px) scale(0.96);
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.repbot.is-open .repbot-panel {
	opacity: 1;
	/* transform: translateY(0) scale(1);  */
	pointer-events: auto;
}

/* Header */
.repbot-header {
    position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 18px;
	background: linear-gradient(135deg, var(--repbot-accent) 0%, var(--repbot-accent-dark) 100%);
	color: #fff;
}
.repbot-header__avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
}
.repbot-header__avatar svg {
	width: 20px;
	height: 20px;
}
.repbot-header__meta {
	flex: 1;
	min-width: 0;
}
.repbot-header__title {
	margin: 0;
	font-size: 0.98rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.2;
}
.repbot-header__status {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
	font-size: 0.72rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.85);
}
.repbot-header__status::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #8ef0b8;
	box-shadow: 0 0 0 3px rgba(142, 240, 184, 0.25);
}
.repbot-header__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	color: #fff;
	background: rgba(255, 255, 255, 0.12);
	transition: background 0.18s ease;
}
.repbot-header__close:hover {
	background: rgba(255, 255, 255, 0.24);
}
.repbot-header__close svg {
	width: 16px;
	height: 16px;
}

/* Message list */
.repbot-messages {
	flex: 1;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px 16px 8px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	scrollbar-width: thin;
	scrollbar-color: rgba(212, 212, 212, 0.18) transparent;
}
.repbot-messages::-webkit-scrollbar {
	width: 8px;
}
.repbot-messages::-webkit-scrollbar-thumb {
	background: rgba(212, 212, 212, 0.16);
	border-radius: 8px;
}

.repbot-msg {
	display: flex;
	max-width: 88%;
}
.repbot-msg__bubble {
	padding: 10px 14px;
	font-size: 0.88rem;
	line-height: 1.5;
	border-radius: 14px;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.repbot-msg.bot {
	align-self: flex-start;
}
.repbot-msg.bot .repbot-msg__bubble {
	background: var(--repbot-tile);
	border: 1px solid var(--repbot-border);
	color: var(--repbot-text);
	border-top-left-radius: 4px;
}
.repbot-msg.user {
	align-self: flex-end;
}
.repbot-msg.user .repbot-msg__bubble {
	background: linear-gradient(135deg, var(--repbot-accent) 0%, var(--repbot-accent-dark) 100%);
	color: #fff;
	border-top-right-radius: 4px;
}
.repbot-msg__bubble a {
	color: inherit;
	text-decoration: underline;
}

/* Typing indicator */
.repbot-typing {
	display: inline-flex;
	gap: 4px;
	align-items: center;
	padding: 4px 2px;
}
.repbot-typing span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--repbot-text-dim);
	animation: repbot-bounce 1.2s infinite ease-in-out;
}
.repbot-typing span:nth-child(2) {
	animation-delay: 0.15s;
}
.repbot-typing span:nth-child(3) {
	animation-delay: 0.3s;
}
@keyframes repbot-bounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.4;
	}
	30% {
		transform: translateY(-5px);
		opacity: 1;
	}
}

/* Quick-reply chips */
.repbot-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 4px 16px 0;
}
.repbot-chip {
	padding: 8px 13px;
	font-size: 0.78rem;
	font-weight: 500;
	font-family: inherit;
	color: var(--repbot-text);
	background: var(--repbot-tile);
	border: 1px solid var(--repbot-border);
	border-radius: 999px;
	cursor: pointer;
	transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.repbot-chip:hover {
	border-color: rgba(var(--primary-rgb, 76, 178, 186), 0.6);
	color: #fff;
}
.repbot-chip.is-primary {
	color: var(--repbot-accent);
	border-color: rgba(var(--primary-rgb, 76, 178, 186), 0.45);
}
.repbot-chip.is-primary:hover {
	background: rgba(var(--primary-rgb, 76, 178, 186), 0.12);
}

/* Inline booking forms / confirmation cards (live inside a bot bubble) */
.repbot-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 4px;
}
.repbot-step {
	margin: 0;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--repbot-text-dim);
}
.repbot-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
}
.repbot-field label {
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--repbot-text-dim);
}
.repbot-field input,
.repbot-field select,
.repbot-field textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 0.86rem;
	font-family: inherit;
	color: var(--repbot-text);
	background: var(--repbot-panel);
	border: 1px solid var(--repbot-border);
	border-radius: 9px;
	outline: none;
	transition: border-color 0.18s ease;
}
.repbot-field input:focus,
.repbot-field select:focus,
.repbot-field textarea:focus {
	border-color: var(--repbot-accent);
}
.repbot-field input::placeholder,
.repbot-field textarea::placeholder {
	color: var(--repbot-text-muted);
}
.repbot-field .repbot-error {
	font-size: 0.72rem;
	color: #e0734f;
}

.repbot-btn,
.repbot-btn-alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 14px;
	font-size: 0.84rem;
	font-weight: 600;
	font-family: inherit;
	border: 1px solid transparent;
	border-radius: 9px;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}
.repbot-btn {
	color: #fff;
	background: linear-gradient(135deg, var(--repbot-accent) 0%, var(--repbot-accent-dark) 100%);
}
.repbot-btn:hover {
	opacity: 0.92;
}
.repbot-btn:disabled {
	opacity: 0.55;
	cursor: default;
}
.repbot-btn-alt {
	color: var(--repbot-text);
	background: transparent;
	border-color: var(--repbot-border);
}
.repbot-btn-alt:hover {
	border-color: var(--repbot-text-dim);
}

/* Confirmation summary */
.repbot-summary {
	list-style: none;
	margin: 8px 0 12px;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.repbot-summary li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 0.84rem;
}
.repbot-summary li span {
	color: var(--repbot-text-dim);
}
.repbot-summary li strong {
	color: var(--repbot-text);
	text-align: right;
}
.repbot-actions {
	display: flex;
	gap: 8px;
}
.repbot-actions .repbot-btn {
	flex: 1;
}

/* Footer / composer */
.repbot-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--repbot-border);
	background: var(--repbot-panel);
}
.repbot-composer textarea {
	flex: 1;
	max-height: 110px;
	min-height: 22px;
	padding: 9px 12px;
	font-size: 0.88rem;
	font-family: inherit;
	line-height: 1.4;
	color: var(--repbot-text);
	background: var(--repbot-tile);
	border: 1px solid var(--repbot-border);
	border-radius: 12px;
	resize: none;
	outline: none;
	transition: border-color 0.18s ease;

    overflow: hidden;
}
.repbot-composer textarea:focus {
	border-color: var(--repbot-accent);
}
.repbot-composer textarea::placeholder {
	color: var(--repbot-text-muted);
}
.repbot-send {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border: none;
	border-radius: 12px;
	cursor: pointer;
	color: #fff;
	background: linear-gradient(135deg, var(--repbot-accent) 0%, var(--repbot-accent-dark) 100%);
	transition: opacity 0.18s ease;
}
.repbot-send:hover {
	opacity: 0.9;
}
.repbot-send:disabled {
	opacity: 0.45;
	cursor: default;
}
.repbot-send svg {
	width: 18px;
	height: 18px;
}

.repbot-disclaimer {
	padding: 0 16px 10px;
	font-size: 0.68rem;
	color: var(--repbot-text-muted);
	text-align: center;
}
.repbot-disclaimer a {
	color: var(--repbot-text-dim);
}

/* Composer disabled state (chat ended after a booking) */
.repbot.is-ended .repbot-composer {
	opacity: 0.5;
	pointer-events: none;
}

/* ---------------------------------------------------
   Responsive
   --------------------------------------------------- */
@media (max-width: 480px) {
	.repbot {
		right: 16px;
		bottom: 16px;
	}
	.repbot-panel {
		right: 0;
		bottom: 72px;
		width: calc(100vw - 32px);
		height: calc(100vh - 110px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.repbot-toggle,
	.repbot-panel,
	.repbot-typing span {
		transition: none;
		animation: none;
	}
}

/* ---------------------------------------------------
   Centered mode — opened via page CTA (not FAB)
   --------------------------------------------------- */
.repbot--centered .repbot-panel,
.repbot--centered.is-open .repbot-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	right: auto;
	bottom: auto;
	transform: translate(-50%, -50%);
	transform-origin: center center;
}
