/* ====================================================================
   AMIR TECHNOLOGY AGENTS TEAM — Public Floating Chat Widget
   ==================================================================== */

#aat-floating-widget, #aat-floating-widget * {
	box-sizing: border-box;
	font-family: 'Vazirmatn', 'Yekan', 'IRANSans', Tahoma, -apple-system, BlinkMacSystemFont, sans-serif;
}

#aat-floating-widget, .aat-floating-widget {
	--aat-brand: #6C5CE7;
	--aat-widget-offset: 24px;
	--aat-widget-offset-side: 24px;

	/* تم تیره (پیش‌فرض) */
	--aat-bg: #0c0d16;
	--aat-bg-panel: rgba(16, 18, 30, 0.92);
	--aat-bg-elevated: rgba(255,255,255,0.06);
	--aat-bg-elevated-hover: rgba(255,255,255,0.1);
	--aat-text: #F4F4FA;
	--aat-text-muted: #A6A8BF;
	--aat-border: rgba(255,255,255,0.1);

	position: fixed;
	bottom: var(--aat-widget-offset);
	z-index: 999999;
}

/* تم روشن */
.aat-floating-widget[data-theme="light"] {
	--aat-bg: #F7F7FB;
	--aat-bg-panel: rgba(255, 255, 255, 0.96);
	--aat-bg-elevated: rgba(10,10,20,0.045);
	--aat-bg-elevated-hover: rgba(10,10,20,0.08);
	--aat-text: #1B1C2B;
	--aat-text-muted: #6E7090;
	--aat-border: rgba(10,10,20,0.09);
}

/* تم خودکار: از تنظیمات دستگاه کاربر پیروی می‌کند */
@media (prefers-color-scheme: light) {
	.aat-floating-widget[data-theme="auto"] {
		--aat-bg: #F7F7FB;
		--aat-bg-panel: rgba(255, 255, 255, 0.96);
		--aat-bg-elevated: rgba(10,10,20,0.045);
		--aat-bg-elevated-hover: rgba(10,10,20,0.08);
		--aat-text: #1B1C2B;
		--aat-text-muted: #6E7090;
		--aat-border: rgba(10,10,20,0.09);
	}
}

.aat-position-bottom-right {
	right: var(--aat-widget-offset-side);
}
.aat-position-bottom-left {
	left: var(--aat-widget-offset-side);
}

/* ---------------------------------------------------------------
   دکمه شناور
   --------------------------------------------------------------- */
.aat-widget-toggle {
	width: 62px;
	height: 62px;
	border-radius: 50%;
	border: none;
	cursor: pointer;
	background: linear-gradient(135deg, var(--aat-brand, #6C5CE7), color-mix(in srgb, var(--aat-brand, #6C5CE7) 60%, #00D2D3));
	box-shadow: 0 8px 30px rgba(0,0,0,0.3), 0 0 0 6px rgba(255,255,255,0.04);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	overflow: hidden;
	position: relative;
}
.aat-widget-toggle:hover { transform: scale(1.06); }
.aat-widget-toggle img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.aat-widget-toggle-icon-close { display: none; font-size: 20px; color: #fff; }
.aat-floating-widget.open .aat-widget-toggle-icon-open { display: none; }
.aat-floating-widget.open .aat-widget-toggle-icon-close { display: block; }

/* ---------------------------------------------------------------
   پنل چت — همیشه تمام‌صفحه (روی همه دستگاه‌ها، دقیقاً مثل اپ Gemini)
   نه فقط یک پنجره‌ی شناور؛ باز شدن یعنی یک تجربه‌ی غوطه‌ور و اختصاصی
   --------------------------------------------------------------- */
.aat-widget-panel {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	height: 100dvh;
	max-width: 100%;
	max-height: 100dvh;
	background: var(--aat-bg-panel);
	backdrop-filter: blur(28px);
	-webkit-backdrop-filter: blur(28px);
	border: none;
	border-radius: 0;
	box-shadow: none;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px);
	pointer-events: none;
	transition: opacity 0.3s cubic-bezier(.2,.9,.3,1.2), transform 0.3s cubic-bezier(.2,.9,.3,1.2);
	z-index: 1000000;
	color: var(--aat-text);
}

#aat-floating-widget.open .aat-widget-panel,
.aat-floating-widget.open .aat-widget-panel {
	opacity: 1;
	transform: translateY(0);
	pointer-events: all;
}

/* ---------------------------------------------------------------
   گرادیانت‌های متحرک تزئینی پایین صفحه (سبک Gemini)
   --------------------------------------------------------------- */
.aat-widget-orbs {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
	z-index: 0;
}
.aat-orb {
	position: absolute;
	border-radius: 50%;
	filter: blur(50px);
	opacity: 0.5;
	will-change: transform;
}
.aat-orb-1 {
	width: 300px; height: 300px;
	background: radial-gradient(circle, var(--aat-brand, #6C5CE7), transparent 70%);
	bottom: -70px; left: -50px;
	animation: aatOrbFloat1 14s ease-in-out infinite;
}
.aat-orb-2 {
	width: 240px; height: 240px;
	background: radial-gradient(circle, #00D2D3, transparent 70%);
	bottom: -60px; right: -30px;
	animation: aatOrbFloat2 18s ease-in-out infinite;
}
.aat-orb-3 {
	width: 190px; height: 190px;
	background: radial-gradient(circle, #FF6BCB, transparent 70%);
	bottom: -50px; left: 38%;
	animation: aatOrbFloat3 16s ease-in-out infinite;
}
@keyframes aatOrbFloat1 {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(40px, -30px) scale(1.15); }
}
@keyframes aatOrbFloat2 {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(-30px, -40px) scale(1.1); }
}
@keyframes aatOrbFloat3 {
	0%, 100% { transform: translate(0, 0) scale(1); }
	50% { transform: translate(20px, -50px) scale(1.2); }
}

/* ---------------------------------------------------------------
   هدر — دکمه منو (راست بالا در RTL)، انتخاب‌گر ایجنت (وسط)، بستن
   --------------------------------------------------------------- */
.aat-widget-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 14px;
	position: relative;
	z-index: 2;
	flex-shrink: 0;
}
.aat-widget-menu-btn,
.aat-widget-close {
	width: 38px; height: 38px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: var(--aat-text);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
	flex-shrink: 0;
}
.aat-widget-menu-btn:hover,
.aat-widget-close:hover { background: var(--aat-bg-elevated); }

.aat-widget-agent-switcher { position: relative; flex: 1; display: flex; justify-content: center; }
.aat-widget-agent-switcher-btn {
	display: flex; align-items: center; gap: 6px;
	background: transparent;
	border: none;
	color: var(--aat-text);
	font-size: 15px; font-weight: 700;
	cursor: pointer;
	padding: 8px 14px;
	border-radius: 20px;
	transition: background 0.2s ease;
	max-width: 240px;
}
.aat-widget-agent-switcher-btn:hover { background: var(--aat-bg-elevated); }
.aat-widget-agent-switcher-btn span:first-child {
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.aat-widget-agent-switcher-menu {
	position: absolute;
	top: 48px;
	right: 50%;
	transform: translateX(50%);
	min-width: 220px;
	max-width: 300px;
	max-height: 320px;
	overflow-y: auto;
	background: var(--aat-bg-panel);
	border: 1px solid var(--aat-border);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.35);
	padding: 8px;
	display: none;
	z-index: 10;
}
.aat-widget-agent-switcher.open .aat-widget-agent-switcher-menu { display: block; }
.aat-widget-agent-switcher-item {
	display: flex; align-items: center; gap: 10px;
	padding: 10px 12px;
	border-radius: 10px;
	cursor: pointer;
	color: var(--aat-text);
	font-size: 13.5px;
	transition: background 0.15s ease;
	margin-bottom: 4px;
}
.aat-widget-agent-switcher-item:last-child { margin-bottom: 0; }
.aat-widget-agent-switcher-item:hover { background: var(--aat-bg-elevated); }
.aat-widget-agent-switcher-item.active { background: var(--aat-bg-elevated-hover); font-weight: 700; }
.aat-widget-agent-switcher-item img,
.aat-widget-agent-switcher-item .aat-switcher-avatar-fallback {
	width: 26px; height: 26px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
	background: var(--aat-bg-elevated);
	display: flex; align-items: center; justify-content: center;
	font-size: 11px; font-weight: 700;
}

/* ---------------------------------------------------------------
   کشوی منو (تاریخچه/گفتگوی جدید/محرمانه/تم)
   --------------------------------------------------------------- */
.aat-widget-menu-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.45);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
	z-index: 1000001;
}
.aat-widget-menu-backdrop.open { opacity: 1; pointer-events: all; }

/* ---------------------------------------------------------------
   کشوی منو — یک کارت شناور با حاشیه‌ی گرادیانت چرخان
   (همان تکنیک کادر پیام / منوی افزونه AMIR SUITE)
   --------------------------------------------------------------- */
@property --aat-menu-angle {
	syntax: '<angle>';
	inherits: false;
	initial-value: 0deg;
}
@keyframes aat-menu-gb-spin { to { --aat-menu-angle: 360deg; } }

.aat-widget-menu-drawer {
	position: fixed;
	top: calc(env(safe-area-inset-top, 0px) + 16px);
	bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
	right: 16px;
	width: min(78vw, 300px);
	padding: 2px;
	border-radius: 24px;
	transform: translateX(115%);
	transition: transform 0.35s cubic-bezier(.2,.9,.3,1.2);
	z-index: 1000002;
}
[dir="rtl"] .aat-widget-menu-drawer { right: 16px; left: auto; transform: translateX(115%); }
.aat-widget-menu-drawer.open { transform: translateX(0); }

/* حلقه‌ی نازک گرادیانت چرخان */
.aat-widget-menu-drawer::after {
	content: '';
	position: absolute;
	inset: 0;
	padding: 2px;
	border-radius: inherit;
	z-index: 0;
	background: conic-gradient(
		from var(--aat-menu-angle, 0deg),
		var(--aat-brand, #6C5CE7), #00D2D3, #FF6BCB, #FFB75E, #a78bfa, var(--aat-brand, #6C5CE7)
	);
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	mask-composite: exclude;
	animation: aat-menu-gb-spin 4s linear infinite;
}
/* هاله‌ی نورانی محو پشت حلقه */
.aat-widget-menu-drawer::before {
	content: '';
	position: absolute;
	inset: -4px;
	padding: 6px;
	border-radius: inherit;
	background: conic-gradient(
		from var(--aat-menu-angle, 0deg),
		var(--aat-brand, #6C5CE7), #00D2D3, #FF6BCB, #FFB75E, #a78bfa, var(--aat-brand, #6C5CE7)
	);
	filter: blur(12px);
	opacity: 0.5;
	z-index: -1;
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	mask-composite: exclude;
	animation: aat-menu-gb-spin 4s linear infinite;
}

.aat-widget-menu-drawer-inner {
	position: relative;
	z-index: 1;
	height: 100%;
	background: var(--aat-bg-panel);
	border-radius: 22px;
	box-shadow: 0 20px 50px rgba(0,0,0,0.5);
	padding: 16px;
	overflow-y: auto;
}
.aat-widget-menu-item {
	display: flex; align-items: center; gap: 12px;
	padding: 13px 12px;
	border-radius: 12px;
	color: var(--aat-text);
	font-size: 13.5px; font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
	margin-bottom: 4px;
}
.aat-widget-menu-item:hover { background: var(--aat-bg-elevated); }
.aat-widget-menu-divider { height: 1px; background: var(--aat-border); margin: 8px 4px; }
.aat-toggle-sm { transform: scale(0.8); }

/* سوییچ روشن/خاموش (برای حالت محرمانه) */
.aat-toggle {
	position: relative;
	display: inline-block;
	width: 40px;
	height: 22px;
	flex-shrink: 0;
}
.aat-toggle input { opacity: 0; width: 0; height: 0; }
.aat-toggle-slider {
	position: absolute;
	cursor: pointer;
	inset: 0;
	background: var(--aat-bg-elevated);
	border: 1px solid var(--aat-border);
	border-radius: 22px;
	transition: background 0.2s ease;
}
.aat-toggle-slider::before {
	content: '';
	position: absolute;
	height: 16px; width: 16px;
	right: 3px; top: 2px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.2s ease;
}
.aat-toggle input:checked + .aat-toggle-slider {
	background: var(--aat-brand, #6C5CE7);
}
.aat-toggle input:checked + .aat-toggle-slider::before {
	transform: translateX(-18px);
}

/* ---------------------------------------------------------------
   پیام یادآوری اول گفتگو (سبک "Keep in mind" در Gemini)
   --------------------------------------------------------------- */
.aat-widget-terms-modal {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000003;
	padding: 20px;
}
.aat-widget-terms-card {
	background: var(--aat-bg-panel);
	border: 1px solid var(--aat-border);
	border-radius: 22px;
	padding: 28px 24px;
	max-width: 340px;
	width: 100%;
	text-align: center;
	box-shadow: 0 30px 70px rgba(0,0,0,0.4);
}
.aat-widget-terms-icon { font-size: 32px; margin-bottom: 10px; }
.aat-widget-terms-title { font-size: 16px; font-weight: 800; color: var(--aat-text); margin-bottom: 10px; }
.aat-widget-terms-text { font-size: 13px; line-height: 1.9; color: var(--aat-text-muted); margin-bottom: 20px; }
.aat-widget-terms-btn {
	background: linear-gradient(135deg, var(--aat-brand, #6C5CE7), color-mix(in srgb, var(--aat-brand, #6C5CE7) 60%, #00D2D3));
	color: #fff;
	border: none;
	border-radius: 14px;
	padding: 12px 28px;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	width: 100%;
}

/* لایه نور پس‌زمینه داخل پنل برای حس Liquid Glass */
.aat-widget-panel::before {
	content: '';
	position: absolute;
	width: 220px; height: 220px;
	background: radial-gradient(circle, color-mix(in srgb, var(--aat-brand, #6C5CE7) 40%, transparent), transparent 70%);
	top: -80px; right: -60px;
	border-radius: 50%;
	filter: blur(50px);
	pointer-events: none;
}

/* ---------------------------------------------------------------
   فوتر متن قابل‌تنظیم
   --------------------------------------------------------------- */
.aat-widget-footer-text {
	text-align: center;
	font-size: 10.5px;
	color: var(--aat-text-muted);
	padding: 6px 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
	letter-spacing: 0.3px;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}

/* ---------------------------------------------------------------
   پیام‌ها
   --------------------------------------------------------------- */
.aat-widget-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	position: relative;
	z-index: 1;
}
.aat-widget-messages::-webkit-scrollbar { width: 5px; }
.aat-widget-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 10px; }

.aat-msg { display: flex; }
.aat-msg-user { justify-content: flex-start; flex-direction: row-reverse; }
.aat-msg-agent { justify-content: flex-start; }

.aat-msg-bubble {
	max-width: 80%;
	padding: 11px 15px;
	border-radius: 18px;
	font-size: 13.5px;
	line-height: 1.8;
	word-wrap: break-word;
}
.aat-msg-agent .aat-msg-bubble {
	background: var(--aat-bg-elevated);
	color: var(--aat-text);
	border-bottom-right-radius: 4px;
}
.aat-msg-user .aat-msg-bubble {
	background: linear-gradient(135deg, var(--aat-brand, #6C5CE7), color-mix(in srgb, var(--aat-brand, #6C5CE7) 70%, #00D2D3));
	color: #fff;
	border-bottom-left-radius: 4px;
}
.aat-msg-error .aat-msg-bubble {
	background: rgba(255, 92, 124, 0.15);
	color: #FF8FA3;
}

/* تایپینگ */
.aat-widget-typing {
	display: flex;
	gap: 4px;
	padding: 0 18px 10px;
}
.aat-widget-typing span {
	width: 6px; height: 6px;
	border-radius: 50%;
	background: var(--aat-brand, #6C5CE7);
	animation: aatTypingBounce 1.2s infinite ease-in-out;
}
.aat-widget-typing span:nth-child(2) { animation-delay: 0.15s; }
.aat-widget-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aatTypingBounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-5px); opacity: 1; }
}

/* ---------------------------------------------------------------
   نوار ابزار پیوست (تصویر/ویدیو/فایل/لوکیشن/صوت)
   --------------------------------------------------------------- */
.aat-widget-toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 14px;
	border-top: 1px solid var(--aat-border);
}
.aat-tool-btn {
	width: 32px; height: 32px;
	border-radius: 50%;
	border: none;
	background: transparent;
	color: var(--aat-text-muted);
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.aat-tool-btn:hover { background: var(--aat-bg-elevated); color: var(--aat-text); }
.aat-tool-mic.recording { color: #FF5C7C; }

.aat-attachment-preview {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	font-size: 11.5px;
	color: var(--aat-text-muted);
}
.aat-spinner-dot {
	width: 8px; height: 8px;
	border-radius: 50%;
	background: var(--aat-brand, #6C5CE7);
	animation: aatPulseDot 1s infinite ease-in-out;
}
@keyframes aatPulseDot {
	0%, 100% { opacity: 0.3; transform: scale(0.8); }
	50% { opacity: 1; transform: scale(1.2); }
}

/* ---------------------------------------------------------------
   ضبط پیام صوتی با انیمیشن جذاب (شبیه ضبط‌کننده موبایل)
   --------------------------------------------------------------- */
.aat-voice-recorder {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	background: linear-gradient(135deg, rgba(255,92,124,0.08), rgba(108,92,231,0.06));
	border-top: 1px solid rgba(255,92,124,0.2);
	position: relative;
	overflow: hidden;
}
.aat-voice-recorder::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at center, rgba(255,92,124,0.05) 0%, transparent 70%);
	animation: aatRecordGlow 2s ease-in-out infinite alternate;
}
@keyframes aatRecordGlow {
	from { opacity: 0.4; }
	to   { opacity: 1; }
}

.aat-voice-stop {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, #FF5C7C, #FF8FA3);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
	animation: aatRecordPulse 1.4s ease-in-out infinite;
	box-shadow: 0 0 0 0 rgba(255,92,124,0.6);
}
@keyframes aatRecordPulse {
	0%   { box-shadow: 0 0 0 0 rgba(255,92,124,0.6); transform: scale(1); }
	50%  { box-shadow: 0 0 0 12px rgba(255,92,124,0); transform: scale(1.05); }
	100% { box-shadow: 0 0 0 0 rgba(255,92,124,0); transform: scale(1); }
}
.aat-voice-stop-dot {
	width: 13px;
	height: 13px;
	background: #fff;
	border-radius: 3px;
	transition: border-radius 0.2s ease;
}
.aat-voice-stop:hover .aat-voice-stop-dot {
	border-radius: 50%;
}

/* اکولایزر پویا */
.aat-voice-equalizer {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 3px;
	height: 36px;
	position: relative;
	z-index: 1;
}
.aat-voice-equalizer span {
	display: inline-block;
	width: 3px;
	border-radius: 3px;
	background: linear-gradient(180deg, #FF5C7C 0%, #FF8FA3 50%, #6C5CE7 100%);
	min-height: 4px;
	max-height: 32px;
	height: 12px;
	transition: height 0.08s ease;
	box-shadow: 0 0 6px rgba(255,92,124,0.5);
}
/* انیمیشن پیش‌فرض هنگام سکوت */
.aat-voice-equalizer span:nth-child(1) { animation: aatEqIdle 1.2s 0.0s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(2) { animation: aatEqIdle 1.2s 0.1s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(3) { animation: aatEqIdle 1.2s 0.2s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(4) { animation: aatEqIdle 1.2s 0.3s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(5) { animation: aatEqIdle 1.2s 0.2s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(6) { animation: aatEqIdle 1.2s 0.1s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(7) { animation: aatEqIdle 1.2s 0.0s ease-in-out infinite; }
.aat-voice-equalizer span:nth-child(8) { animation: aatEqIdle 1.2s 0.3s ease-in-out infinite; }
@keyframes aatEqIdle {
	0%, 100% { height: 6px; }
	50%       { height: 18px; }
}
/* وقتی Web Audio active است، JS ارتفاع را کنترل می‌کند — انیمیشن override می‌شود */
.aat-voice-equalizer.aat-eq-active span {
	animation: none;
}

.aat-voice-timer {
	font-size: 13px;
	font-weight: 800;
	color: #F4F4FA;
	min-width: 42px;
	text-align: center;
	direction: ltr;
	position: relative;
	z-index: 1;
}
.aat-voice-timer::before {
	content: '🔴 ';
	font-size: 10px;
	animation: aatBlinkDot 1s step-end infinite;
}
@keyframes aatBlinkDot {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0; }
}
.aat-voice-cancel {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	border: 1px solid rgba(255,255,255,0.15);
	background: rgba(255,255,255,0.06);
	color: #A6A8BF;
	cursor: pointer;
	font-size: 12px;
	transition: all 0.2s ease;
	flex-shrink: 0;
	position: relative;
	z-index: 1;
}
.aat-voice-cancel:hover {
	background: rgba(255,255,255,0.14);
	color: #fff;
	border-color: rgba(255,255,255,0.3);
}

/* دکمه میکروفون در toolbar — حالت فعال */
.aat-tool-mic.aat-mic-recording {
	background: rgba(255,92,124,0.2) !important;
	color: #FF5C7C !important;
	animation: aatMicBlink 1s ease-in-out infinite;
}
@keyframes aatMicBlink {
	0%, 100% { opacity: 1; }
	50%       { opacity: 0.6; }
}

/* ---------------------------------------------------------------
   نمایش پیوست‌ها درون حباب پیام
   --------------------------------------------------------------- */
.aat-msg-text { margin-top: 6px; }
.aat-msg-bubble:has(.aat-msg-image:only-child),
.aat-msg-bubble:has(.aat-msg-video:only-child) { padding: 5px; }

.aat-msg-image {
	max-width: 220px;
	max-height: 220px;
	border-radius: 14px;
	display: block;
	object-fit: cover;
}
.aat-msg-video {
	max-width: 240px;
	border-radius: 14px;
	display: block;
}
.aat-msg-audio {
	max-width: 230px;
	display: block;
	height: 36px;
}
.aat-msg-file, .aat-msg-location {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	background: rgba(255,255,255,0.08);
	border-radius: 12px;
	color: inherit;
	text-decoration: none;
	font-size: 12px;
	font-weight: 600;
}
.aat-msg-file:hover, .aat-msg-location:hover { background: rgba(255,255,255,0.14); }

/* ---------------------------------------------------------------
   فرم ورودی
   --------------------------------------------------------------- */
.aat-widget-input-form {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px 10px;
	position: relative;
	z-index: 1;
	flex-shrink: 0;
}

/* ---------------------------------------------------------------
   کادر گرادیانت چرخشی دور ورودی پیام — الهام‌گرفته از افزونه AMIR SUITE
   (تکنیک conic-gradient + مسک برای ساخت یک حلقه‌ی نازک نورانی و چرخان)
   --------------------------------------------------------------- */
@property --aat-input-angle {
	syntax: '<angle>';
	initial-value: 0deg;
	inherits: false;
}
@keyframes aat-input-gb-spin { to { --aat-input-angle: 360deg; } }

.aat-input-gb-wrap {
	flex: 1;
	position: relative;
	border-radius: 26px;
	padding: 2px;
	z-index: 0;
}
.aat-input-gb-wrap::before {
	content: '';
	position: absolute;
	inset: 0;
	padding: 2px;
	border-radius: inherit;
	background: conic-gradient(
		from var(--aat-input-angle),
		var(--aat-brand, #6C5CE7),
		#00D2D3,
		#FF6BCB,
		#FFB75E,
		#a78bfa,
		var(--aat-brand, #6C5CE7)
	);
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	mask-composite: exclude;
	animation: aat-input-gb-spin 4s linear infinite;
}

.aat-widget-input {
	width: 100%;
	background: var(--aat-bg-elevated);
	border: none;
	border-radius: 24px;
	padding: 16px 20px;
	color: var(--aat-text);
	font-size: 15px;
	outline: none;
	transition: box-shadow 0.2s ease;
	min-height: 54px;
	position: relative;
	z-index: 1;
}
.aat-widget-input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--aat-brand, #6C5CE7) 15%, transparent); }
.aat-widget-input::placeholder { color: var(--aat-text-muted); }

.aat-widget-send {
	width: 48px; height: 48px;
	border-radius: 50%;
	border: none;
	background: linear-gradient(135deg, var(--aat-brand, #6C5CE7), color-mix(in srgb, var(--aat-brand, #6C5CE7) 70%, #00D2D3));
	display: flex; align-items: center; justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	transition: transform 0.2s ease;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--aat-brand, #6C5CE7) 40%, transparent);
}
.aat-widget-send:hover { transform: scale(1.08); }
.aat-widget-send svg { transform: scaleX(-1); }

/* ---------------------------------------------------------------
   Embed/Fullscreen Chat (شورت‌کد)
   --------------------------------------------------------------- */
.aat-chat-embed {
	font-family: 'Vazirmatn', 'Yekan', 'IRANSans', Tahoma, sans-serif;
	direction: rtl;
	background: rgba(16,18,30,0.9);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 20px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	max-width: 100%;
}
.aat-chat-embed.aat-mode-fullscreen { height: 80vh; }
.aat-chat-header {
	display: flex; align-items: center; gap: 12px;
	padding: 16px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.aat-chat-header .aat-avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
.aat-agent-meta strong { color: #F4F4FA; font-size: 14px; display: block; }
.aat-agent-meta span { color: #A6A8BF; font-size: 11.5px; }
.aat-chat-messages { flex: 1; overflow-y: auto; padding: 16px; }
.aat-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(255,255,255,0.08); }
.aat-chat-input {
	flex: 1; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
	border-radius: 18px; padding: 10px 16px; color: #fff; font-size: 13px; outline: none;
}
.aat-chat-send {
	background: linear-gradient(135deg, #6C5CE7, #00D2D3); border: none; color: #fff;
	border-radius: 18px; padding: 10px 20px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}

/* ---------------------------------------------------------------
   Team Grid (شورت‌کد [aat_team])
   --------------------------------------------------------------- */
.aat-team-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 16px;
	direction: rtl;
	font-family: 'Vazirmatn', 'Yekan', 'IRANSans', Tahoma, sans-serif;
}
.aat-team-card {
	background: rgba(16,18,30,0.6);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 20px;
	padding: 20px;
	text-align: center;
	transition: transform 0.2s ease;
}
.aat-team-card:hover { transform: translateY(-4px); }
.aat-team-card img, .aat-avatar-placeholder {
	width: 60px; height: 60px;
	border-radius: 18px;
	margin: 0 auto 12px;
	object-fit: cover;
	display: flex; align-items: center; justify-content: center;
	background: linear-gradient(135deg, var(--aat-brand, #6C5CE7), transparent);
	color: #fff; font-weight: 700; font-size: 20px;
}
.aat-team-card h4 { color: #F4F4FA; font-size: 14px; margin: 6px 0; }
.aat-team-card p { color: #A6A8BF; font-size: 12px; line-height: 1.7; margin-bottom: 14px; }
.aat-open-chat {
	background: linear-gradient(135deg, var(--aat-brand, #6C5CE7), #00D2D3);
	border: none; color: #fff; padding: 9px 18px; border-radius: 18px;
	font-size: 12px; font-weight: 700; cursor: pointer;
}

/* ---------------------------------------------------------------
   Safe-area (notch) و رفتار عمومی تمام‌صفحه — روی همه‌ی اندازه‌های صفحه اعمال می‌شود
   --------------------------------------------------------------- */
.aat-widget-header {
	padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
}
.aat-widget-input-form,
.aat-widget-toolbar {
	padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
}
/* دکمه شناور پشت پنل تمام‌صفحه پنهان می‌شود */
.aat-floating-widget.open .aat-widget-toggle {
	visibility: hidden;
}

/* وقتی ویجت باز است، اسکرول پشت آن (صفحه‌ی اصلی سایت) قفل می‌شود */
body.aat-widget-fullscreen-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
}

/* ---------------------------------------------------------------
   Voice Call Bar (تماس صوتی زنده)
   --------------------------------------------------------------- */
.aat-voice-call-bar {
	padding: 8px 14px;
	border-bottom: 1px solid rgba(255,255,255,0.08);
	background: rgba(0,200,150,0.06);
}
.aat-voice-call-btn {
	display: inline-flex; align-items: center; gap: 8px;
	background: #00C896; color: #06110d; border: none;
	padding: 8px 16px; border-radius: 20px; font-size: 13px;
	font-weight: 700; cursor: pointer; font-family: inherit;
	transition: background 0.15s ease, box-shadow 0.15s ease;
}
.aat-voice-call-btn:hover { background: #1ee0ac; box-shadow: 0 0 12px rgba(0,200,150,0.4); }
.aat-voice-call-btn.aat-voice-connecting { background: #F4B740; color: #201a05; animation: aatVoicePulse 1.2s infinite; }
.aat-voice-call-btn.aat-voice-active { background: #FF5C7C; color: #fff; }
@keyframes aatVoicePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------------------------------------------------------------
   Voice Visualizer (آواتار پالسی + اکولایزر صوتی زنده)
   --------------------------------------------------------------- */
.aat-voice-visualizer {
	display: flex; align-items: center; justify-content: center; gap: 18px;
	padding: 18px 14px 20px; flex-direction: column;
	background: radial-gradient(circle at 50% 0%, rgba(0,200,150,0.10), transparent 70%);
}
.aat-voice-avatar-wrap {
	position: relative; width: 84px; height: 84px;
	display: flex; align-items: center; justify-content: center;
}
.aat-voice-avatar {
	width: 68px; height: 68px; border-radius: 50%; object-fit: cover;
	position: relative; z-index: 2; box-shadow: 0 0 0 3px rgba(0,200,150,0.35);
}
.aat-voice-avatar-fallback {
	background: linear-gradient(135deg, #6C5CE7, #00C896);
	color: #fff; font-size: 26px; font-weight: 800;
	display: flex; align-items: center; justify-content: center;
}
.aat-voice-ring {
	position: absolute; inset: 0; border-radius: 50%;
	background: radial-gradient(circle, rgba(0,200,150,0.55) 0%, rgba(0,200,150,0.12) 55%, transparent 75%);
	transform: scale(1); opacity: 0.4; z-index: 1;
	transition: transform 0.06s linear, opacity 0.06s linear;
}
.aat-voice-bars {
	display: flex; align-items: center; justify-content: center;
	gap: 5px; height: 34px;
}
.aat-voice-bars span {
	display: block; width: 5px; height: 34px; border-radius: 3px;
	background: linear-gradient(180deg, #00C896, #1ee0ac);
	transform: scaleY(0.2); transform-origin: center;
	transition: transform 0.06s linear;
}

