/**
 * Migkapa Agent Chat - Frontend Styles
 * Styles for the floating chat widget and embeds.
 */

/* Floating root container */
.mac-floating-root {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 16px;
	pointer-events: none;
}

.mac-floating-root > * {
	pointer-events: auto;
}

/* Floating Action Button (FAB) */
.mac-fab {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: none;
	background-color: #000;
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.12);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	overflow: visible;
	flex-shrink: 0;
}

.mac-fab:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.15);
}

.mac-fab:focus {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.mac-fab:active {
	transform: scale(0.98);
}

/* FAB Icons */
.mac-icon-open,
.mac-icon-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.mac-icon-open svg,
.mac-icon-close svg {
	width: 100%;
	height: 100%;
	fill: currentColor;
}

.mac-icon-close {
	position: absolute;
	opacity: 0;
	transform: rotate(-90deg) scale(0.8);
}

.mac-fab.is-open .mac-icon-open {
	opacity: 0;
	transform: rotate(90deg) scale(0.8);
}

.mac-fab.is-open .mac-icon-close {
	opacity: 1;
	transform: rotate(0deg) scale(1);
}

/* Floating chat panel container */
.mac-floating-container {
	display: none;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.95);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.mac-floating-container.is-visible {
	display: block;
	opacity: 1;
	transform: translateY(0) scale(1);
}

/* Ensure the chat element fills its container */
.mac-floating-container .mac-embed {
	display: block;
	width: 100%;
	height: 100%;
	border: none;
}

/* Block/shortcode embed styling */
.mac-embed {
	display: block;
	box-sizing: border-box;
	border-radius: 8px;
	overflow: hidden;
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
	.mac-floating-container {
		background: #1a1a1a;
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
	}
}

/* Responsive adjustments for small screens */
@media (max-width: 480px) {
	.mac-floating-container {
		position: fixed !important;
		top: 0 !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		height: 100% !important;
		max-width: none !important;
		max-height: none !important;
		border-radius: 0;
	}

	.mac-fab {
		width: 56px;
		height: 56px;
	}
}
