/**
 * Chat Positions CSS
 *
 * Styles for different chat positions (inline, modal, fullscreen, sidebar).
 *
 * @package AI360Chat
 * @subpackage Addons\Appearance
 */

/* Inline Popup */
.ai360-chat-inline-popup {
	position: absolute;
	width: 400px;
	max-width: 90vw;
	height: 500px;
	max-height: 80vh;
	background: white;
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	z-index: 9999;
	overflow: hidden;
}

/* Modal */
.ai360-chat-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9998;
	backdrop-filter: blur(2px);
}

.ai360-chat-modal {
	width: 500px;
	max-width: 90vw;
	height: 600px;
	max-height: 90vh;
	background: white;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* Fullscreen */
.ai360-chat-fullscreen {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: white;
	z-index: 9999;
	overflow: hidden;
	animation: fullscreenSlideIn 0.3s ease-out;
}

@keyframes fullscreenSlideIn {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Sidebar */
.ai360-chat-sidebar {
	position: fixed;
	top: 0;
	right: 0;
	width: 400px;
	max-width: 90vw;
	height: 100%;
	background: white;
	box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
	z-index: 9999;
	overflow: hidden;
	animation: sidebarSlideIn 0.3s ease-out;
}

@keyframes sidebarSlideIn {
	from {
		transform: translateX(100%);
	}
	to {
		transform: translateX(0);
	}
}

/* Close button for positioned chats */
.ai360-chat-close-button {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	z-index: 10;
}

.ai360-chat-close-button:hover {
	background: rgba(0, 0, 0, 0.2);
	transform: scale(1.1);
}

.ai360-chat-close-button::before,
.ai360-chat-close-button::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 2px;
	background: currentColor;
}

.ai360-chat-close-button::before {
	transform: rotate(45deg);
}

.ai360-chat-close-button::after {
	transform: rotate(-45deg);
}

/* Position classes */
.ai360chat-position {
	transition: all 0.3s ease;
}

.ai360chat-position-corner {
	/* Uses default floating position */
}

.ai360chat-position-inline {
	/* Styles applied via JavaScript */
}

.ai360chat-position-modal {
	/* Handled by modal overlay */
}

.ai360chat-position-fullscreen {
	/* Full viewport coverage */
}

.ai360chat-position-sidebar {
	/* Fixed sidebar position */
}

/* Mobile adjustments */
@media (max-width: 768px) {
	.ai360-chat-inline-popup {
		width: 90vw;
		height: 70vh;
		left: 5vw !important;
		top: 15vh !important;
	}

	.ai360-chat-modal {
		width: 95vw;
		height: 85vh;
	}

	.ai360-chat-sidebar {
		width: 100vw;
	}

	.ai360-chat-fullscreen {
		/* Already full width on mobile */
	}
}

/* Responsive adjustments for tablets */
@media (min-width: 769px) and (max-width: 1024px) {
	.ai360-chat-sidebar {
		width: 500px;
	}

	.ai360-chat-modal {
		width: 600px;
	}
}

/* Accessibility */
.ai360-chat-modal:focus,
.ai360-chat-fullscreen:focus,
.ai360-chat-sidebar:focus,
.ai360-chat-inline-popup:focus {
	outline: 2px solid var(--ai360chat-button-color, #25d366);
	outline-offset: -2px;
}

/* Loading state */
.ai360-chat-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
}

.ai360-chat-loading::after {
	content: '';
	width: 40px;
	height: 40px;
	border: 4px solid rgba(0, 0, 0, 0.1);
	border-top-color: var(--ai360chat-button-color, #25d366);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}
