/**
 * Brand Ambassador — Skyy Rose Chatbot Widget
 *
 * Floating chat widget with dark luxury styling, rose gold accents,
 * glassmorphism panel, and smooth transitions.
 *
 * @package SkyyRose_Flagship
 * @since   3.10.0
 */

/* ============================================================
   Widget Container
   ============================================================ */

.sr-ambassador {
	position: fixed;
	bottom: 1.5rem;
	right: 1.5rem;
	z-index: 9999;
	font-family: 'Inter', sans-serif;
}

/* ============================================================
   Floating Action Button (Avatar)
   ============================================================ */

.sr-ambassador__fab {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 2px solid rgba(183, 110, 121, 0.5);
	background: #111;
	padding: 0;
	cursor: pointer;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(183, 110, 121, 0.15);
	transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
}

.sr-ambassador__fab:hover {
	transform: scale(1.08);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(183, 110, 121, 0.25);
}

.sr-ambassador__fab:focus-visible {
	outline: 2px solid var(--color-primary, #B76E79);
	outline-offset: 3px;
}

.sr-ambassador__fab-avatar {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

/* Pulsing ring around FAB */
.sr-ambassador__fab-pulse {
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	border: 2px solid rgba(183, 110, 121, 0.4);
	animation: sr-pulse 2.5s ease-in-out infinite;
}

@keyframes sr-pulse {
	0%, 100% { transform: scale(1); opacity: 0.6; }
	50%      { transform: scale(1.15); opacity: 0; }
}

/* Hide FAB when panel is open */
.sr-ambassador.open .sr-ambassador__fab {
	transform: scale(0);
	pointer-events: none;
}

/* ============================================================
   Greeting Bubble
   ============================================================ */

.sr-ambassador__greeting {
	position: absolute;
	bottom: 72px;
	right: 0;
	background: #1a1a1a;
	border: 1px solid rgba(183, 110, 121, 0.25);
	border-radius: 12px 12px 0 12px;
	padding: 0.65rem 2rem 0.65rem 0.85rem;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.8125rem;
	line-height: 1.4;
	white-space: nowrap;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.35s, transform 0.35s;
	pointer-events: none;
}

.sr-ambassador__greeting.visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.sr-ambassador.open .sr-ambassador__greeting {
	opacity: 0;
	pointer-events: none;
}

.sr-ambassador__greeting-close {
	position: absolute;
	top: 2px;
	right: 6px;
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.35);
	font-size: 1rem;
	cursor: pointer;
	padding: 2px;
	line-height: 1;
}
.sr-ambassador__greeting-close:hover {
	color: rgba(255, 255, 255, 0.7);
}

/* ============================================================
   Chat Panel
   ============================================================ */

.sr-ambassador__panel {
	position: absolute;
	bottom: 0;
	right: 0;
	width: 340px;
	max-height: 520px;
	display: flex;
	flex-direction: column;
	background: #111;
	border: 1px solid rgba(183, 110, 121, 0.2);
	border-radius: 16px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), 0 0 40px rgba(183, 110, 121, 0.06);
	overflow: hidden;
	opacity: 0;
	transform: translateY(16px) scale(0.95);
	transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sr-ambassador__panel[aria-hidden="false"] {
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* ============================================================
   Panel Header
   ============================================================ */

.sr-ambassador__header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.85rem 1rem;
	background: rgba(183, 110, 121, 0.08);
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sr-ambassador__header-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	border: 1px solid rgba(183, 110, 121, 0.3);
}

.sr-ambassador__header-info {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.sr-ambassador__header-info strong {
	font-size: 0.8125rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.02em;
}

.sr-ambassador__header-status {
	font-size: 0.625rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-primary, #B76E79);
}

.sr-ambassador__close {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 50%;
	color: rgba(255, 255, 255, 0.5);
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
}
.sr-ambassador__close:hover {
	background: rgba(183, 110, 121, 0.15);
	color: #fff;
}
.sr-ambassador__close:focus-visible {
	outline: 2px solid var(--color-primary, #B76E79);
	outline-offset: 2px;
}

/* ============================================================
   Messages Area
   ============================================================ */

.sr-ambassador__messages {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-height: 200px;
	max-height: 300px;
}

.sr-ambassador__messages::-webkit-scrollbar {
	width: 3px;
}
.sr-ambassador__messages::-webkit-scrollbar-thumb {
	background: rgba(183, 110, 121, 0.2);
	border-radius: 2px;
}

/* Message bubbles */
.sr-msg {
	max-width: 85%;
	padding: 0.6rem 0.85rem;
	border-radius: 12px;
	font-size: 0.8125rem;
	line-height: 1.55;
	animation: sr-msgIn 0.3s ease;
}

@keyframes sr-msgIn {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.sr-msg--bot {
	align-self: flex-start;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 255, 255, 0.06);
	color: rgba(255, 255, 255, 0.85);
}

.sr-msg--user {
	align-self: flex-end;
	background: rgba(183, 110, 121, 0.15);
	border: 1px solid rgba(183, 110, 121, 0.25);
	color: #fff;
}

.sr-msg a {
	color: var(--color-primary, #B76E79);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.sr-msg a:hover {
	color: var(--color-accent, #d4af37);
}

/* Typing indicator */
.sr-msg--typing .sr-dots {
	display: inline-flex;
	gap: 3px;
}
.sr-msg--typing .sr-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(183, 110, 121, 0.5);
	animation: sr-dotBounce 1.2s ease-in-out infinite;
}
.sr-msg--typing .sr-dot:nth-child(2) { animation-delay: 0.15s; }
.sr-msg--typing .sr-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes sr-dotBounce {
	0%, 60%, 100% { transform: translateY(0); }
	30%           { transform: translateY(-4px); }
}

/* ============================================================
   Quick Replies
   ============================================================ */

.sr-ambassador__quick-replies {
	padding: 0 1rem 0.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.sr-quick-reply {
	padding: 0.4rem 0.75rem;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(183, 110, 121, 0.2);
	border-radius: 20px;
	color: rgba(255, 255, 255, 0.7);
	font-family: 'Inter', sans-serif;
	font-size: 0.6875rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	white-space: nowrap;
}

.sr-quick-reply:hover {
	background: rgba(183, 110, 121, 0.1);
	border-color: rgba(183, 110, 121, 0.4);
	color: #fff;
}

.sr-quick-reply:focus-visible {
	outline: 2px solid var(--color-primary, #B76E79);
	outline-offset: 1px;
}

/* ============================================================
   Text Input
   ============================================================ */

.sr-ambassador__input-form {
	display: flex;
	gap: 0;
	padding: 0.6rem;
	border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sr-ambassador__input {
	flex: 1;
	padding: 0.55rem 0.75rem;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px 0 0 10px;
	color: #fff;
	font-family: 'Inter', sans-serif;
	font-size: 0.8125rem;
	outline: none;
	transition: border-color 0.2s;
}

.sr-ambassador__input::placeholder {
	color: rgba(255, 255, 255, 0.25);
}

.sr-ambassador__input:focus {
	border-color: rgba(183, 110, 121, 0.4);
}

.sr-ambassador__send {
	padding: 0.55rem 0.75rem;
	background: var(--color-primary, #B76E79);
	border: 1px solid var(--color-primary, #B76E79);
	border-left: none;
	border-radius: 0 10px 10px 0;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s;
}

.sr-ambassador__send:hover {
	background: #a05a64;
}

.sr-ambassador__send:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 420px) {
	.sr-ambassador {
		bottom: 1rem;
		right: 1rem;
	}
	.sr-ambassador__panel {
		width: calc(100vw - 2rem);
		max-height: 70vh;
	}
}

/* ============================================================
   Reduced Motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
	.sr-ambassador__fab,
	.sr-ambassador__panel,
	.sr-ambassador__greeting,
	.sr-msg {
		transition: none;
		animation: none;
	}
	.sr-ambassador__fab-pulse {
		animation: none;
		display: none;
	}
	.sr-msg--typing .sr-dot {
		animation: none;
	}
}
