/* ============================================================
   Aqar Voice Widget — Floating Noura Robot Character
   ============================================================ */

/* Chat widget completely hidden — robot uses voice-only conversation */
.aqar-chat-root,
.aqar-chat-toggle,
.aqar-chat-window { display: none !important; }

/* ElevenLabs ConvAI widget — constrained in size so it doesn't dominate.
   The default floating button is hidden because we use the Noura robot to trigger it. */
elevenlabs-convai {
	position: fixed !important;
	inset-inline-start: 24px !important;
	bottom: 24px !important;
	width: 320px !important;
	max-width: calc(100vw - 32px) !important;
	max-height: 60vh !important;
	z-index: 9998 !important;
}
elevenlabs-convai::part(button) { display: none !important; }

/* Mobile: smaller widget so it doesn't cover the property + showcase */
@media (max-width: 768px) {
	elevenlabs-convai {
		width: calc(100vw - 24px) !important;
		max-width: 360px !important;
		max-height: 45vh !important;
		bottom: 12px !important;
		inset-inline-start: 12px !important;
	}
}
@media (max-width: 480px) {
	elevenlabs-convai {
		max-height: 40vh !important;
	}
}

/* ============ Floating Noura Robot Character ============ */
.aqar-noura {
	position: fixed;
	inset-inline-start: 24px;
	bottom: 24px;
	width: 220px;
	height: 280px;
	z-index: 9995;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: auto;
	transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.aqar-noura:hover {
	transform: scale(1.06);
}

.aqar-noura__inner {
	position: relative;
	width: 100%;
	height: 100%;
	animation: aqar-noura-float 4s ease-in-out infinite;
}

/* Idle floating animation */
@keyframes aqar-noura-float {
	0%, 100% { transform: translateY(0) rotate(-1.5deg); }
	25%      { transform: translateY(-10px) rotate(0deg); }
	50%      { transform: translateY(-18px) rotate(1.5deg); }
	75%      { transform: translateY(-8px) rotate(0deg); }
}

.aqar-noura__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	position: relative;
	z-index: 2;
	pointer-events: none;
	-webkit-user-drag: none;
}

/* Aura / shadow removed - clean transparent floating robot */
.aqar-noura__aura,
.aqar-noura__shadow { display: none; }

/* Speech bubble that appears on idle prompting interaction */
.aqar-noura__bubble {
	position: absolute;
	bottom: 100%;
	inset-inline-start: 50%;
	transform: translateX(-50%) translateY(-8px);
	background: #fff;
	color: #1F2937;
	font-family: 'Tajawal', sans-serif;
	font-size: 14px;
	font-weight: 700;
	padding: 10px 16px;
	border-radius: 18px;
	box-shadow: 0 10px 25px rgba(0,0,0,.15);
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity .4s ease, transform .4s ease;
	z-index: 3;
}

.aqar-noura__bubble::after {
	content: '';
	position: absolute;
	bottom: -6px;
	inset-inline-start: 50%;
	transform: translateX(-50%) rotate(45deg);
	width: 12px; height: 12px;
	background: #fff;
}

.aqar-noura.is-visible-bubble .aqar-noura__bubble {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Status badge below the robot */
.aqar-noura__badge {
	position: absolute;
	bottom: 4px;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	background: linear-gradient(135deg, #006C35, #C9A35D);
	color: #fff;
	font-family: 'Tajawal', sans-serif;
	font-size: 12px;
	font-weight: 800;
	padding: 4px 14px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
	box-shadow: 0 4px 12px rgba(0,0,0,.2);
	z-index: 4;
}

.aqar-noura__badge::before {
	content: '';
	width: 7px; height: 7px;
	border-radius: 50%;
	background: #4ADE80;
	animation: aqar-noura-dot 1.4s ease-in-out infinite;
}

@keyframes aqar-noura-dot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: .4; transform: scale(.7); }
}

/* States */
.aqar-noura[data-state="listening"] .aqar-noura__badge {
	background: linear-gradient(135deg, #0EA5E9, #006C35);
}
.aqar-noura[data-state="listening"] .aqar-noura__badge::before {
	background: #ef4444;
	animation: aqar-noura-dot .8s ease-in-out infinite;
}

.aqar-noura[data-state="speaking"] .aqar-noura__inner {
	animation: aqar-noura-talk .6s ease-in-out infinite;
}
.aqar-noura[data-state="speaking"] .aqar-noura__badge {
	background: linear-gradient(135deg, #C9A35D, #006C35);
}

@keyframes aqar-noura-talk {
	0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
	25%      { transform: translateY(-4px) rotate(-1deg) scale(1.02); }
	50%      { transform: translateY(-8px) rotate(1deg) scale(1.03); }
	75%      { transform: translateY(-4px) rotate(-1deg) scale(1.02); }
}

/* Hover hint */
.aqar-noura:hover .aqar-noura__bubble {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Close/minimize button */
.aqar-noura__close {
	position: absolute;
	top: 0;
	inset-inline-end: 0;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255,255,255,.95);
	color: #1F2937;
	border: 1px solid rgba(0,0,0,.1);
	font-size: 16px;
	cursor: pointer;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0,0,0,.15);
	opacity: 0;
	transition: opacity .2s;
}
.aqar-noura:hover .aqar-noura__close { opacity: 1; }
.aqar-noura__close:hover { background: #fff; transform: scale(1.1); }

/* When hidden */
.aqar-noura.is-hidden {
	opacity: 0;
	transform: translateY(40px) scale(.8);
	pointer-events: none;
}

/* Minimize state - show small floating action button */
.aqar-noura.is-minimized {
	width: 64px;
	height: 64px;
}
.aqar-noura.is-minimized .aqar-noura__bubble,
.aqar-noura.is-minimized .aqar-noura__badge,
.aqar-noura.is-minimized .aqar-noura__close { display: none; }

/* Restore button when minimized */
.aqar-noura-restore {
	position: fixed;
	bottom: 24px;
	inset-inline-start: 24px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: linear-gradient(135deg, #006C35, #C9A35D);
	color: #fff;
	font-size: 28px;
	border: 0;
	cursor: pointer;
	z-index: 9994;
	box-shadow: 0 8px 20px rgba(0,0,0,.25);
	display: none;
	align-items: center;
	justify-content: center;
	animation: aqar-noura-restore-pulse 2s ease-in-out infinite;
}
.aqar-noura-restore.is-visible { display: flex; }
@keyframes aqar-noura-restore-pulse {
	0%, 100% { box-shadow: 0 8px 20px rgba(0,0,0,.25), 0 0 0 0 rgba(0,108,53,.5); }
	50%      { box-shadow: 0 8px 20px rgba(0,0,0,.25), 0 0 0 14px rgba(0,108,53,0); }
}

/* Responsive */
@media (max-width: 768px) {
	.aqar-noura {
		width: 140px;
		height: 180px;
		bottom: 16px;
		inset-inline-start: 16px;
	}
	.aqar-noura__bubble {
		font-size: 12px;
		padding: 7px 12px;
	}
	.aqar-noura__badge {
		font-size: 10px;
		padding: 3px 10px;
	}
}

/* ============================================================
   Voice transcript bubble — shows what user said + Noura's reply
   ============================================================ */
.aqar-voice-transcript {
	position: fixed;
	bottom: 320px;
	inset-inline-start: 24px;
	width: 320px;
	max-width: calc(100vw - 48px);
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 12px 30px rgba(0,0,0,.2);
	padding: 14px 16px;
	z-index: 9994;
	font-family: 'Tajawal', sans-serif;
	font-size: 14px;
	color: #1F2937;
	direction: rtl;
	display: none;
	opacity: 0;
	transform: translateY(20px);
	transition: opacity .25s, transform .25s;
}
.aqar-voice-transcript.is-visible {
	display: block;
	opacity: 1;
	transform: translateY(0);
}
.aqar-voice-transcript__label {
	font-size: 11px;
	color: #6B7280;
	margin-bottom: 4px;
	font-weight: 700;
}
.aqar-voice-transcript__text {
	line-height: 1.5;
	max-height: 100px;
	overflow-y: auto;
}
.aqar-voice-transcript__mic {
	display: inline-flex; align-items: center; gap: 6px;
	color: #006C35; font-weight: 700; margin-top: 6px;
}
.aqar-voice-transcript__mic::before {
	content: ''; width: 8px; height: 8px;
	background: #ef4444; border-radius: 50%;
	animation: aqar-mic-pulse 1s ease-in-out infinite;
}
@keyframes aqar-mic-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%      { opacity: .4; transform: scale(1.3); }
}
@media (max-width: 768px) {
	.aqar-voice-transcript { bottom: 220px; width: auto; inset-inline-end: 16px; }
}

/* Property Showcase Overlay styles are injected by voice-widget.js — see injectShowcaseStyles() */
