/**
 * Nora Marmara AI Booking Assistant - chatbot styles.
 *
 * Colours come from CSS custom properties written inline by the plugin, so an
 * administrator's palette applies without editing this file.
 *
 * Every rule is scoped under .nora-ai so the widget cannot leak styles into the
 * theme, and the theme's own resets are unlikely to reach in.
 */

.nora-ai {
	--nora-primary: #1f6f78;
	--nora-accent: #c9a227;
	--nora-bubble-user: #1f6f78;
	--nora-bubble-bot: #f2f4f5;
	--nora-surface: #ffffff;
	--nora-text: #1d2327;
	--nora-muted: #667085;
	--nora-border: #e4e7ec;
	--nora-radius: 14px;
	--nora-shadow: 0 12px 40px rgba(16, 24, 40, 0.16);
	--nora-inline-height: 520px;

	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--nora-text);
}

.nora-ai *,
.nora-ai *::before,
.nora-ai *::after {
	box-sizing: inherit;
}

/* -------------------------------------------------------------------------
   Launcher
   ------------------------------------------------------------------------- */

.nora-ai--floating {
	position: fixed;
	bottom: 20px;
	z-index: 99990;
}

.nora-ai--floating.nora-ai--right {
	right: 20px;
}

.nora-ai--floating.nora-ai--left {
	left: 20px;
}

.nora-ai-launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px 12px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--nora-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--nora-shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nora-ai-launcher:hover,
.nora-ai-launcher:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 16px 44px rgba(16, 24, 40, 0.22);
}

.nora-ai-launcher__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
}

.nora-ai-launcher__icon img {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	object-fit: cover;
}

.nora-ai--floating[data-open="true"] .nora-ai-launcher {
	display: none;
}

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

.nora-ai-panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--nora-surface);
	border: 1px solid var(--nora-border);
	border-radius: var(--nora-radius);
}

/*
 * An author rule that sets `display` beats the browser's own [hidden] rule, so
 * the closed panel has to be hidden explicitly. Without this the panel would sit
 * open on every page load.
 */
.nora-ai-panel[hidden] {
	display: none !important;
}

.nora-ai--floating .nora-ai-panel {
	position: fixed;
	bottom: 20px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 620px;
	max-height: calc(100vh - 40px);
	box-shadow: var(--nora-shadow);
}

.nora-ai--floating.nora-ai--right .nora-ai-panel {
	right: 20px;
}

.nora-ai--floating.nora-ai--left .nora-ai-panel {
	left: 20px;
}

.nora-ai--inline .nora-ai-panel {
	width: 100%;
	height: var(--nora-inline-height);
}

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

.nora-ai-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px;
	background: var(--nora-primary);
	color: #fff;
}

.nora-ai-header__identity {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.nora-ai-header__logo {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.2);
}

.nora-ai-header__name {
	margin: 0;
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nora-ai-header__status {
	margin: 0;
	font-size: 12px;
	opacity: 0.85;
}

.nora-ai-header__actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.nora-ai-language {
	appearance: none;
	padding: 4px 8px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font: inherit;
	font-size: 12px;
	cursor: pointer;
}

.nora-ai-language option {
	color: var(--nora-text);
}

.nora-ai-icon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0.85;
}

.nora-ai-icon-button:hover,
.nora-ai-icon-button:focus-visible {
	background: rgba(255, 255, 255, 0.16);
	opacity: 1;
}

/* -------------------------------------------------------------------------
   Conversation
   ------------------------------------------------------------------------- */

.nora-ai-log {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px 14px 4px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: #fbfcfd;
}

.nora-ai-msg {
	display: flex;
	max-width: 88%;
}

.nora-ai-msg--user {
	align-self: flex-end;
}

.nora-ai-msg--bot {
	align-self: flex-start;
}

.nora-ai-bubble {
	padding: 10px 13px;
	border-radius: 16px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.nora-ai-msg--bot .nora-ai-bubble {
	background: var(--nora-bubble-bot);
	color: var(--nora-text);
	border-bottom-left-radius: 5px;
}

.nora-ai-msg--user .nora-ai-bubble {
	background: var(--nora-bubble-user);
	color: #fff;
	border-bottom-right-radius: 5px;
}

/* Mirror the bubble tails when the conversation runs right to left. */
.nora-ai[dir="rtl"] .nora-ai-msg--bot .nora-ai-bubble {
	border-bottom-left-radius: 16px;
	border-bottom-right-radius: 5px;
}

.nora-ai[dir="rtl"] .nora-ai-msg--user .nora-ai-bubble {
	border-bottom-right-radius: 16px;
	border-bottom-left-radius: 5px;
}

/* -------------------------------------------------------------------------
   Unit cards
   ------------------------------------------------------------------------- */

.nora-ai-units {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-self: stretch;
}

.nora-ai-unit {
	display: flex;
	gap: 12px;
	padding: 10px;
	border: 1px solid var(--nora-border);
	border-radius: 12px;
	background: #fff;
}

.nora-ai-unit__media {
	flex: 0 0 68px;
	width: 68px;
	height: 68px;
	border-radius: 9px;
	object-fit: cover;
	background: var(--nora-bubble-bot);
}

.nora-ai-unit__body {
	min-width: 0;
	flex: 1 1 auto;
}

.nora-ai-unit__name {
	margin: 0 0 2px;
	font-weight: 600;
	font-size: 14px;
}

.nora-ai-unit__meta {
	margin: 0 0 6px;
	font-size: 12px;
	color: var(--nora-muted);
}

.nora-ai-unit__price {
	margin: 0 0 8px;
	font-weight: 600;
	color: var(--nora-primary);
}

.nora-ai-unit__note {
	margin: 0 0 8px;
	font-size: 11px;
	color: var(--nora-muted);
}

.nora-ai-cta {
	display: inline-block;
	padding: 7px 14px;
	border-radius: 8px;
	background: var(--nora-accent);
	color: #1d2327;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.nora-ai-cta:hover,
.nora-ai-cta:focus-visible {
	filter: brightness(0.94);
	color: #1d2327;
}

/* -------------------------------------------------------------------------
   In-chat form
   ------------------------------------------------------------------------- */

.nora-ai-form {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid var(--nora-border);
	border-radius: 12px;
	background: #fff;
}

.nora-ai-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.nora-ai-field label {
	font-size: 12px;
	font-weight: 600;
	color: var(--nora-muted);
}

.nora-ai-field input,
.nora-ai-field select,
.nora-ai-field textarea {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--nora-border);
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
	color: var(--nora-text);
	background: #fff;
}

.nora-ai-field textarea {
	min-height: 64px;
	resize: vertical;
}

.nora-ai-form button {
	align-self: flex-start;
	padding: 8px 16px;
	border: 0;
	border-radius: 8px;
	background: var(--nora-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

/* -------------------------------------------------------------------------
   Typing, quick replies, notices
   ------------------------------------------------------------------------- */

.nora-ai-typing {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 6px 18px 10px;
}

.nora-ai-typing__dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--nora-muted);
	opacity: 0.45;
	animation: nora-ai-bounce 1.2s infinite ease-in-out;
}

.nora-ai-typing__dot:nth-child(2) {
	animation-delay: 0.15s;
}

.nora-ai-typing__dot:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes nora-ai-bounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
	30% { transform: translateY(-4px); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
	.nora-ai-typing__dot { animation: none; }
	.nora-ai-launcher { transition: none; }
}

.nora-ai-quick {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 4px 14px 10px;
}

.nora-ai-quick:empty {
	display: none;
}

.nora-ai-chip {
	padding: 6px 12px;
	border: 1px solid var(--nora-primary);
	border-radius: 999px;
	background: transparent;
	color: var(--nora-primary);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}

.nora-ai-chip:hover,
.nora-ai-chip:focus-visible {
	background: var(--nora-primary);
	color: #fff;
}

/*
 * The collapsed state: one quiet button in place of the whole row, so the
 * assistant's reply stays on screen on a phone.
 */
.nora-ai-chip--more {
	border-style: dashed;
	font-size: 12px;
	padding: 4px 10px;
	opacity: 0.85;
}

.nora-ai-chip--more::before {
	content: '+';
	margin-inline-end: 5px;
	font-weight: 700;
}

.nora-ai-notice {
	margin: 0 14px 10px;
	padding: 9px 12px;
	border-radius: 9px;
	background: #fff4e5;
	border: 1px solid #f5d9ae;
	color: #7a4b00;
	font-size: 13px;
}

.nora-ai-notice button {
	margin-inline-start: 8px;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}

/* -------------------------------------------------------------------------
   Composer
   ------------------------------------------------------------------------- */

.nora-ai-composer {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	padding: 10px 12px;
	border-top: 1px solid var(--nora-border);
	background: #fff;
}

.nora-ai-input {
	flex: 1 1 auto;
	max-height: 120px;
	padding: 10px 12px;
	border: 1px solid var(--nora-border);
	border-radius: 12px;
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	color: var(--nora-text);
	background: #fff;
	resize: none;
	overflow-y: auto;
}

.nora-ai-input:focus {
	outline: 2px solid var(--nora-primary);
	outline-offset: -1px;
}

.nora-ai-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--nora-primary);
	color: #fff;
	cursor: pointer;
}

.nora-ai-send[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* The send icon points along the reading direction. */
.nora-ai[dir="rtl"] .nora-ai-send svg {
	transform: scaleX(-1);
}

.nora-ai-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */

.nora-ai-footer {
	display: flex;
	gap: 14px;
	padding: 8px 14px 12px;
	border-top: 1px solid var(--nora-border);
	background: #fff;
}

.nora-ai-footer__link {
	padding: 0;
	border: 0;
	background: none;
	color: var(--nora-muted);
	font: inherit;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}

.nora-ai-footer__link:hover,
.nora-ai-footer__link:focus-visible {
	color: var(--nora-primary);
}

.nora-ai-footer__link--whatsapp {
	margin-inline-start: auto;
}

/* -------------------------------------------------------------------------
   Utility
   ------------------------------------------------------------------------- */

.nora-ai-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------------------
   Small screens
   ------------------------------------------------------------------------- */

@media (max-width: 480px) {
	.nora-ai--floating {
		bottom: 14px;
	}

	.nora-ai--floating.nora-ai--right {
		right: 14px;
	}

	.nora-ai--floating.nora-ai--left {
		left: 14px;
	}

	.nora-ai--floating .nora-ai-panel {
		inset: 0;
		width: 100%;
		max-width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		border: 0;
	}

	.nora-ai-launcher__label {
		display: none;
	}

	.nora-ai-launcher {
		padding: 14px;
	}

	.nora-ai-msg {
		max-width: 92%;
	}
}
