/*
 * ESNY Venue Assistant — widget styles.
 *
 * Scoped under .esny-bot so a theme cannot reach in and a reset cannot
 * reach out. Every colour is a variable on the root element, and the
 * accent is set inline from the plugin settings.
 */

.esny-bot,
.esny-bot * {
	box-sizing: border-box;
}

.esny-bot {
	--esny-accent: #1a1a1a;
	--esny-bg: #ffffff;
	--esny-surface: #f6f6f7;
	--esny-border: #e3e3e6;
	--esny-text: #17181a;
	--esny-muted: #6b6f76;
	--esny-radius: 14px;
	--esny-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);

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

@media (prefers-color-scheme: dark) {
	.esny-bot:not([data-theme="light"]) {
		--esny-bg: #17181a;
		--esny-surface: #212327;
		--esny-border: #33363c;
		--esny-text: #ececee;
		--esny-muted: #9ba0a8;
		--esny-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
	}
}

/* ── launcher ─────────────────────────────────────────────────── */

.esny-bot__launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 13px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--esny-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
	transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.esny-bot__launcher:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
}

.esny-bot__launcher[hidden] {
	display: none;
}

.esny-bot__launcher svg {
	width: 19px;
	height: 19px;
	flex: none;
}

/* ── panel ────────────────────────────────────────────────────── */

.esny-bot__panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	width: 400px;
	max-width: calc(100vw - 32px);
	height: 620px;
	max-height: calc(100vh - 40px);
	background: var(--esny-bg);
	border: 1px solid var(--esny-border);
	border-radius: var(--esny-radius);
	box-shadow: var(--esny-shadow);
	overflow: hidden;
}

.esny-bot__panel[hidden] {
	display: none;
}

.esny-bot-inline .esny-bot__panel {
	position: static;
	width: 100%;
	max-width: 100%;
	height: 600px;
	box-shadow: none;
}

.esny-bot__head {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 15px 16px;
	background: var(--esny-accent);
	color: #fff;
	flex: none;
}

.esny-bot__head h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.25;
	color: #fff;
}

.esny-bot__head p {
	margin: 1px 0 0;
	font-size: 12px;
	opacity: 0.78;
	line-height: 1.3;
}

.esny-bot__headtext {
	flex: 1;
	min-width: 0;
}

.esny-bot__close {
	flex: none;
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}

.esny-bot__close:hover {
	background: rgba(255, 255, 255, 0.26);
}

/* ── progress ─────────────────────────────────────────────────── */

.esny-bot__progress {
	flex: none;
	height: 3px;
	background: var(--esny-border);
}

.esny-bot__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--esny-accent);
	transition: width 0.28s ease;
}

/* ── log ──────────────────────────────────────────────────────── */

.esny-bot__log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--esny-bg);
	scroll-behavior: smooth;
}

.esny-bot__msg {
	max-width: 86%;
	padding: 10px 13px;
	border-radius: 13px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.esny-bot__msg--bot {
	align-self: flex-start;
	background: var(--esny-surface);
	border: 1px solid var(--esny-border);
	border-bottom-left-radius: 4px;
}

.esny-bot__msg--user {
	align-self: flex-end;
	background: var(--esny-accent);
	color: #fff;
	border-bottom-right-radius: 4px;
}

.esny-bot__typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 13px;
	background: var(--esny-surface);
	border: 1px solid var(--esny-border);
	border-radius: 13px;
	border-bottom-left-radius: 4px;
}

.esny-bot__typing i {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--esny-muted);
	animation: esny-bounce 1.2s infinite;
}

.esny-bot__typing i:nth-child(2) { animation-delay: 0.15s; }
.esny-bot__typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes esny-bounce {
	0%, 60%, 100% { opacity: 0.32; transform: translateY(0); }
	30%           { opacity: 1;    transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
	.esny-bot__typing i { animation: none; opacity: 0.6; }
	.esny-bot__launcher,
	.esny-bot__progress span { transition: none; }
	.esny-bot__log { scroll-behavior: auto; }
}

/* ── venue cards ──────────────────────────────────────────────── */

.esny-bot__cards {
	display: flex;
	flex-direction: column;
	gap: 10px;
	align-self: stretch;
}

.esny-bot__card {
	border: 1px solid var(--esny-border);
	border-radius: 12px;
	padding: 13px 14px;
	background: var(--esny-bg);
}

.esny-bot__card h3 {
	margin: 0 0 3px;
	font-size: 15px;
	font-weight: 650;
	line-height: 1.3;
	color: var(--esny-text);
}

.esny-bot__card p {
	margin: 0 0 8px;
	font-size: 13.5px;
	color: var(--esny-text);
}

.esny-bot__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 9px;
}

.esny-bot__pill {
	font-size: 11.5px;
	font-weight: 550;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--esny-surface);
	border: 1px solid var(--esny-border);
	color: var(--esny-muted);
}

.esny-bot__pill--free {
	background: #e7f6ec;
	border-color: #bfe3cc;
	color: #1c6b39;
}

@media (prefers-color-scheme: dark) {
	.esny-bot:not([data-theme="light"]) .esny-bot__pill--free {
		background: #11301e;
		border-color: #1f5936;
		color: #7fd8a1;
	}
}

.esny-bot__cta {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 9px;
	background: var(--esny-accent);
	color: #fff;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
}

.esny-bot__cta:hover,
.esny-bot__cta:focus {
	color: #fff;
	text-decoration: none;
	opacity: 0.9;
}

/* ── input dock ───────────────────────────────────────────────── */

.esny-bot__dock {
	flex: none;
	border-top: 1px solid var(--esny-border);
	padding: 12px;
	background: var(--esny-bg);
}

.esny-bot__prompt {
	display: block;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--esny-muted);
	margin-bottom: 8px;
}

.esny-bot__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 9px;
}

.esny-bot__chip {
	padding: 7px 13px;
	border: 1px solid var(--esny-border);
	border-radius: 999px;
	background: var(--esny-bg);
	color: var(--esny-text);
	font: inherit;
	font-size: 13.5px;
	cursor: pointer;
}

.esny-bot__chip:hover,
.esny-bot__chip:focus-visible {
	border-color: var(--esny-accent);
	background: var(--esny-surface);
}

.esny-bot__row {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.esny-bot__field {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--esny-border);
	border-radius: 10px;
	background: var(--esny-bg);
	color: var(--esny-text);
	font: inherit;
	font-size: 14.5px;
}

.esny-bot__field:focus {
	outline: 2px solid var(--esny-accent);
	outline-offset: 1px;
}

textarea.esny-bot__field {
	resize: vertical;
	min-height: 66px;
}

.esny-bot__send {
	flex: none;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background: var(--esny-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.esny-bot__send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.esny-bot__skip {
	margin-top: 8px;
	border: 0;
	background: none;
	color: var(--esny-muted);
	font: inherit;
	font-size: 12.5px;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}

.esny-bot__error {
	margin-top: 7px;
	font-size: 12.5px;
	color: #b3261e;
}

@media (prefers-color-scheme: dark) {
	.esny-bot:not([data-theme="light"]) .esny-bot__error { color: #ff9a92; }
}

.esny-bot__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.esny-bot__foot {
	margin-top: 9px;
	font-size: 11px;
	color: var(--esny-muted);
	text-align: center;
}

@media (max-width: 480px) {
	.esny-bot__panel {
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-radius: 0;
		border: 0;
	}

	.esny-bot__launcher {
		right: 16px;
		bottom: 16px;
	}
}
