/**
 * Luxury Chat Agent Styling
 *
 * Premium chat interface with gold accents, smooth animations,
 * and elegant luxury aesthetic.
 *
 * @package WaseemNasirLuxury
 * @since 1.0.0
 */

/* ============================================
   Chat Container & Toggle
   ============================================ */

.luxury-chat-container {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	z-index: 9999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.luxury-chat-toggle {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: linear-gradient(135deg, hsl(42, 75%, 55%) 0%, hsl(38, 60%, 45%) 100%);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: hsl(240, 10%, 4%);
	box-shadow: 0 8px 32px hsla(42, 75%, 55%, 0.3),
	            0 2px 8px hsla(0, 0%, 0%, 0.2);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.luxury-chat-toggle:hover {
	transform: translateY(-2px) scale(1.05);
	box-shadow: 0 12px 40px hsla(42, 75%, 55%, 0.4),
	            0 4px 12px hsla(0, 0%, 0%, 0.3);
}

.luxury-chat-toggle:active {
	transform: translateY(0) scale(0.98);
}

.luxury-chat-toggle .chat-icon,
.luxury-chat-toggle .close-icon {
	position: absolute;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.luxury-chat-toggle .chat-icon {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

.luxury-chat-toggle .close-icon {
	opacity: 0;
	transform: scale(0.8) rotate(90deg);
}

.chat-open .luxury-chat-toggle .chat-icon {
	opacity: 0;
	transform: scale(0.8) rotate(-90deg);
}

.chat-open .luxury-chat-toggle .close-icon {
	opacity: 1;
	transform: scale(1) rotate(0deg);
}

/* Chat Badge */
.chat-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	width: 24px;
	height: 24px;
	background: hsl(0, 85%, 55%);
	color: white;
	border-radius: 50%;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 600;
	border: 2px solid hsl(240, 10%, 4%);
	animation: pulse-badge 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-badge {
	0%, 100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
}

/* ============================================
   Chat Window
   ============================================ */

.luxury-chat-window {
	position: absolute;
	bottom: 80px;
	right: 0;
	width: 400px;
	max-width: calc(100vw - 3rem);
	height: 600px;
	max-height: calc(100vh - 140px);
	background: hsl(240, 10%, 6%);
	border-radius: 16px;
	box-shadow: 0 20px 60px hsla(0, 0%, 0%, 0.5),
	            0 0 0 1px hsla(42, 75%, 55%, 0.1);
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: scale(0.95) translateY(20px);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform, opacity;
	overflow: hidden;
}

.chat-open .luxury-chat-window {
	opacity: 1;
	visibility: visible;
	transform: scale(1) translateY(0);
}

/* ============================================
   Chat Header
   ============================================ */

.luxury-chat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1.25rem 1.5rem;
	background: linear-gradient(135deg, hsl(240, 10%, 8%) 0%, hsl(240, 10%, 6%) 100%);
	border-bottom: 1px solid hsla(42, 75%, 55%, 0.1);
}

.chat-header-info {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.chat-avatar {
	position: relative;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: linear-gradient(135deg, hsl(42, 75%, 55%) 0%, hsl(38, 60%, 45%) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: 1.125rem;
	color: hsl(240, 10%, 4%);
	flex-shrink: 0;
}

.status-indicator {
	position: absolute;
	bottom: 2px;
	right: 2px;
	width: 12px;
	height: 12px;
	background: hsl(142, 76%, 46%);
	border: 2px solid hsl(240, 10%, 6%);
	border-radius: 50%;
	animation: pulse-status 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-status {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.chat-header-text h3 {
	font-size: 1rem;
	font-weight: 600;
	color: hsl(45, 30%, 94%);
	margin: 0 0 0.25rem 0;
	line-height: 1.2;
}

.chat-header-text p {
	font-size: 0.75rem;
	color: hsl(45, 20%, 65%);
	margin: 0;
	line-height: 1.2;
}

.chat-minimize {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: transparent;
	border: none;
	color: hsl(45, 20%, 65%);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.chat-minimize:hover {
	background: hsla(42, 75%, 55%, 0.1);
	color: hsl(42, 75%, 55%);
}

/* ============================================
   Chat Messages
   ============================================ */

.luxury-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	scroll-behavior: smooth;
}

/* Custom Scrollbar */
.luxury-chat-messages::-webkit-scrollbar {
	width: 6px;
}

.luxury-chat-messages::-webkit-scrollbar-track {
	background: hsla(240, 10%, 10%, 0.5);
	border-radius: 3px;
}

.luxury-chat-messages::-webkit-scrollbar-thumb {
	background: hsla(42, 75%, 55%, 0.3);
	border-radius: 3px;
	transition: background 0.2s ease;
}

.luxury-chat-messages::-webkit-scrollbar-thumb:hover {
	background: hsla(42, 75%, 55%, 0.5);
}

/* Chat Message */
.chat-message {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	max-width: 85%;
	animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.bot-message {
	align-self: flex-start;
}

.user-message {
	align-self: flex-end;
}

.message-content {
	padding: 1rem 1.25rem;
	border-radius: 12px;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.bot-message .message-content {
	background: linear-gradient(135deg, hsl(240, 10%, 10%) 0%, hsl(240, 10%, 8%) 100%);
	border: 1px solid hsla(42, 75%, 55%, 0.15);
	color: hsl(45, 30%, 90%);
	border-bottom-left-radius: 4px;
}

.user-message .message-content {
	background: linear-gradient(135deg, hsl(42, 75%, 55%) 0%, hsl(38, 60%, 45%) 100%);
	color: hsl(240, 10%, 4%);
	border-bottom-right-radius: 4px;
}

.message-content p {
	margin: 0;
}

.message-content p + p {
	margin-top: 0.75rem;
}

.message-content strong {
	font-weight: 600;
	color: hsl(42, 75%, 55%);
}

.user-message .message-content strong {
	color: hsl(240, 10%, 4%);
}

.message-time {
	font-size: 0.6875rem;
	color: hsl(45, 20%, 55%);
	padding: 0 0.5rem;
}

/* ============================================
   Quick Actions
   ============================================ */

.chat-quick-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-top: 0.5rem;
}

.quick-action-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	background: hsla(240, 10%, 10%, 0.5);
	border: 1px solid hsla(42, 75%, 55%, 0.2);
	border-radius: 8px;
	color: hsl(45, 30%, 90%);
	font-size: 0.8125rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-action-btn:hover {
	background: hsla(42, 75%, 55%, 0.1);
	border-color: hsl(42, 75%, 55%);
	color: hsl(42, 75%, 55%);
	transform: translateY(-2px);
}

.quick-action-btn svg {
	flex-shrink: 0;
}

/* ============================================
   Typing Indicator
   ============================================ */

.luxury-typing-indicator {
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.25rem;
	margin: 0 1.5rem;
	background: linear-gradient(135deg, hsl(240, 10%, 10%) 0%, hsl(240, 10%, 8%) 100%);
	border: 1px solid hsla(42, 75%, 55%, 0.15);
	border-radius: 12px;
	border-bottom-left-radius: 4px;
	width: fit-content;
}

.typing-dot {
	width: 8px;
	height: 8px;
	background: hsl(42, 75%, 55%);
	border-radius: 50%;
	animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
	animation-delay: 0s;
}

.typing-dot:nth-child(2) {
	animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
	animation-delay: 0.4s;
}

@keyframes typing-bounce {
	0%, 60%, 100% {
		transform: translateY(0);
		opacity: 0.7;
	}
	30% {
		transform: translateY(-10px);
		opacity: 1;
	}
}

/* ============================================
   Chat Input
   ============================================ */

.luxury-chat-input {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	background: hsl(240, 10%, 8%);
	border-top: 1px solid hsla(42, 75%, 55%, 0.1);
}

.luxury-chat-input input {
	flex: 1;
	padding: 0.875rem 1rem;
	background: hsl(240, 10%, 10%);
	border: 1px solid hsla(42, 75%, 55%, 0.2);
	border-radius: 8px;
	color: hsl(45, 30%, 90%);
	font-size: 0.9375rem;
	font-family: inherit;
	outline: none;
	transition: all 0.2s ease;
}

.luxury-chat-input input::placeholder {
	color: hsl(45, 20%, 55%);
}

.luxury-chat-input input:focus {
	border-color: hsl(42, 75%, 55%);
	box-shadow: 0 0 0 3px hsla(42, 75%, 55%, 0.1);
}

.chat-send-btn {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: linear-gradient(135deg, hsl(42, 75%, 55%) 0%, hsl(38, 60%, 45%) 100%);
	border: none;
	color: hsl(240, 10%, 4%);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	flex-shrink: 0;
}

.chat-send-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px hsla(42, 75%, 55%, 0.4);
}

.chat-send-btn:active {
	transform: translateY(0);
}

/* ============================================
   Chat Footer CTAs
   ============================================ */

.luxury-chat-footer {
	display: flex;
	gap: 0.75rem;
	padding: 1rem 1.5rem;
	background: hsl(240, 10%, 7%);
	border-top: 1px solid hsla(42, 75%, 55%, 0.1);
}

.chat-cta-btn {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 1rem;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.email-btn {
	background: hsl(142, 70%, 49%);
	color: white;
	border: 1px solid hsl(142, 70%, 49%);
}

.email-btn:hover {
	background: hsl(142, 70%, 44%);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px hsla(142, 70%, 49%, 0.3);
}

.booking-btn {
	background: transparent;
	color: hsl(42, 75%, 55%);
	border: 1px solid hsl(42, 75%, 55%);
}

.booking-btn:hover {
	background: hsla(42, 75%, 55%, 0.1);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px hsla(42, 75%, 55%, 0.2);
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 640px) {
	.luxury-chat-container {
		bottom: 1rem;
		right: 1rem;
	}

	.luxury-chat-toggle {
		width: 56px;
		height: 56px;
	}

	.luxury-chat-window {
		width: calc(100vw - 2rem);
		height: calc(100vh - 100px);
		bottom: 72px;
		right: 0;
	}

	.luxury-chat-header {
		padding: 1rem;
	}

	.chat-avatar {
		width: 40px;
		height: 40px;
		font-size: 1rem;
	}

	.luxury-chat-messages {
		padding: 1rem;
	}

	.chat-message {
		max-width: 90%;
	}

	.message-content {
		padding: 0.875rem 1rem;
		font-size: 0.875rem;
	}

	.luxury-chat-input {
		padding: 0.875rem 1rem;
	}

	.luxury-chat-input input {
		padding: 0.75rem 0.875rem;
		font-size: 0.875rem;
	}

	.chat-send-btn {
		width: 36px;
		height: 36px;
	}

	.luxury-chat-footer {
		padding: 0.875rem 1rem;
	}

	.chat-cta-btn {
		padding: 0.75rem 0.875rem;
		font-size: 0.8125rem;
	}
}

/* ============================================
   Accessibility
   ============================================ */

.luxury-chat-toggle:focus-visible,
.chat-minimize:focus-visible,
.chat-send-btn:focus-visible,
.quick-action-btn:focus-visible,
.chat-cta-btn:focus-visible {
	outline: 2px solid hsl(42, 75%, 55%);
	outline-offset: 2px;
}

.luxury-chat-input input:focus-visible {
	outline: none;
	border-color: hsl(42, 75%, 55%);
	box-shadow: 0 0 0 3px hsla(42, 75%, 55%, 0.2);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.luxury-chat-toggle,
	.luxury-chat-window,
	.chat-message,
	.quick-action-btn,
	.chat-send-btn,
	.chat-cta-btn {
		animation: none;
		transition: none;
	}

	.typing-dot {
		animation: none;
	}

	.chat-badge,
	.status-indicator {
		animation: none;
	}
}
