/* ==========================================================================
   EscBay chat widget — floating site-wide launcher + popup panel, and an
   inline variant (always open, no launcher) reused inside the account page.
   ========================================================================== */

.escbay-chat--floating {
	position: fixed;
	inset-block-end: 22px;
	inset-inline-start: 22px;
	z-index: 200;
}

.escbay-chat__launcher {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--escbay-glow-gradient);
	color: #1a0f00;
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease;
}
.escbay-chat__launcher:hover { transform: scale(1.06); }

.escbay-chat--floating .escbay-chat__panel {
	position: absolute;
	inset-block-end: 68px;
	inset-inline-start: 0;
	width: 328px;
	max-width: calc(100vw - 44px);
	max-height: 460px;
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	background: var(--escbay-glass-bg);
	backdrop-filter: var(--escbay-glass-blur);
	-webkit-backdrop-filter: var(--escbay-glass-blur);
	border: 1px solid var(--escbay-glass-border);
	box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.escbay-chat--floating.is-open .escbay-chat__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.escbay-chat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--escbay-glass-border);
	font-weight: 700;
	font-size: 0.92rem;
}
.escbay-chat__close {
	border: none;
	background: transparent;
	color: var(--escbay-gray);
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
}
.escbay-chat__close:hover { color: var(--escbay-white); }

.escbay-chat__gate,
.escbay-chat__body {
	padding: 16px;
	overflow-y: auto;
}

.escbay-chat__hint {
	margin: 0 0 12px;
	font-size: 0.85rem;
	color: var(--escbay-gray);
}

.escbay-chat__quickform {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.escbay-chat__quickform input {
	font-family: var(--escbay-font);
	font-size: 0.9rem;
	color: var(--escbay-white);
	background: var(--escbay-bg-soft);
	border: 1px solid var(--escbay-border);
	border-radius: 8px;
	padding: 10px 12px;
}
.escbay-chat__quickform input:focus-visible {
	outline: 2px solid var(--escbay-orange);
	outline-offset: 1px;
}
.escbay-chat__quickform button { width: 100%; justify-content: center; }

.escbay-chat__message {
	display: none;
	font-size: 0.82rem;
	padding: 8px 12px;
	border-radius: 8px;
	background: rgba(202, 255, 51, 0.12);
	color: var(--escbay-phosphor);
}
.escbay-chat__message.is-visible { display: block; }
.escbay-chat__message.is-error {
	background: rgba(220, 60, 60, 0.14);
	color: #e07070;
}

.escbay-chat__altlogin {
	margin: 12px 0 0;
	font-size: 0.82rem;
	color: var(--escbay-gray);
	text-align: center;
}
.escbay-chat__altlogin a { color: var(--escbay-orange); font-weight: 700; }

.escbay-chat__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
	min-height: 0;
}

.escbay-chat__messages {
	flex: 1;
	min-height: 160px;
	max-height: 280px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.escbay-chat__msg {
	max-width: 84%;
	padding: 9px 12px;
	border-radius: 12px;
	font-size: 0.86rem;
	line-height: 1.6;
	word-break: break-word;
}
.escbay-chat__msg--me {
	align-self: flex-end;
	background: var(--escbay-glow-gradient);
	color: #1a0f00;
	border-bottom-left-radius: 4px;
}
.escbay-chat__msg--admin {
	align-self: flex-start;
	background: var(--escbay-card);
	border: 1px solid var(--escbay-border);
	border-bottom-right-radius: 4px;
}

.escbay-chat__sendform {
	display: flex;
	gap: 8px;
}
.escbay-chat__input {
	flex: 1;
	font-family: var(--escbay-font);
	font-size: 0.9rem;
	color: var(--escbay-white);
	background: var(--escbay-bg-soft);
	border: 1px solid var(--escbay-border);
	border-radius: 8px;
	padding: 10px 12px;
}
.escbay-chat__input:focus-visible {
	outline: 2px solid var(--escbay-orange);
	outline-offset: 1px;
}
.escbay-chat__sendform button { flex-shrink: 0; }

/* Inline variant — embedded in the account page's "گفتگو با پشتیبانی"
   tab: no launcher, panel sits in normal document flow. */
.escbay-chat--inline { position: relative; }
.escbay-chat--inline .escbay-chat__panel {
	position: static;
	width: 100%;
	max-width: none;
	opacity: 1;
	visibility: visible;
	transform: none;
	border-radius: var(--escbay-radius);
}
.escbay-chat--inline .escbay-chat__messages { max-height: 360px; }

@media (max-width: 560px) {
	.escbay-chat--floating { inset-inline-start: 14px; inset-block-end: 14px; }
	.escbay-chat--floating .escbay-chat__panel { width: calc(100vw - 28px); }
}
