/* Smart Chat WP Widget Styles */

.scwp-widget {
	position: fixed;
	z-index: 9999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

.scwp-widget-container {
	background: #ffffff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	overflow: hidden;
	width: 350px;
	max-width: 90vw;
	transition: all 0.3s ease;
}

.scwp-header {
	background: #0073aa;
	color: #ffffff;
	padding: 12px 16px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
}

.scwp-header-content {
	display: flex;
	align-items: center;
	gap: 8px;
}

.scwp-title {
	font-weight: 600;
	font-size: 16px;
}

.scwp-status {
	font-size: 12px;
	opacity: 0.8;
}

.scwp-toggle {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 18px;
	cursor: pointer;
	padding: 4px;
	border-radius: 4px;
	transition: background-color 0.2s;
}

.scwp-toggle:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.scwp-toggle-icon {
	display: inline-block;
	transition: transform 0.3s ease;
}

.scwp-widget.minimized .scwp-toggle-icon {
	transform: rotate(180deg);
}

.scwp-body {
	height: 400px;
	display: flex;
	flex-direction: column;
}

.scwp-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f8f9fa;
}

.scwp-message {
	margin-bottom: 12px;
	display: flex;
	flex-direction: column;
}

.scwp-message-user {
	align-items: flex-end;
}

.scwp-message-assistant {
	align-items: flex-start;
}

.scwp-message-content {
	max-width: 80%;
	padding: 8px 12px;
	border-radius: 12px;
	word-wrap: break-word;
}

.scwp-message-user .scwp-message-content {
	background: #0073aa;
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.scwp-message-assistant .scwp-message-content {
	background: #ffffff;
	color: #333333;
	border: 1px solid #e1e5e9;
	border-bottom-left-radius: 4px;
}

.scwp-input-container {
	padding: 16px;
	background: #ffffff;
	border-top: 1px solid #e1e5e9;
}

.scwp-limit-notice {
	background: #fff3cd;
	border: 1px solid #ffeaa7;
	color: #856404;
	padding: 8px 12px;
	border-radius: 4px;
	margin-bottom: 12px;
	font-size: 13px;
}

.scwp-limit-notice a {
	color: #0073aa;
	text-decoration: none;
	font-weight: 600;
}

.scwp-limit-notice a:hover {
	text-decoration: underline;
}

.scwp-input-wrapper {
	display: flex;
	width: 100%;
	gap: 10px;
	align-items: flex-end;
}

.scwp-message-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 1px solid #ddd;
	border-radius: 20px;
	padding: 10px 16px;
	resize: none;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	min-height: 40px;
	max-height: 100px;
	overflow-y: auto;
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.scwp-message-input:focus {
	outline: none;
	border-color: #0073aa;
}

.scwp-send-button {
	background: #0073aa;
	color: #ffffff;
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	min-width: 40px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s;
	flex-shrink: 0;
	margin-bottom: 0;
	margin-left: auto;
}

.scwp-send-button:hover:not(:disabled) {
	background: #005a87;
	transform: scale(1.05);
}

.scwp-send-button:disabled {
	background: #ccc;
	cursor: not-allowed;
	transform: none;
}

.scwp-send-icon {
	font-size: 16px;
	font-weight: bold;
}

.scwp-typing {
	color: #666;
	font-size: 13px;
	font-style: italic;
	margin-top: 8px;
}

/* Shortcode styles */
.scwp-shortcode-container {
	border: 1px solid #e1e5e9;
	border-radius: 8px;
	overflow: hidden;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	position: relative;
	transition: all 0.3s ease;
}

.scwp-shortcode-container .scwp-body {
	height: 100%;
}

/* Expand button */
.scwp-expand-button {
	background: none;
	border: none;
	color: #ffffff;
	font-size: 20px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	transition: background-color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.scwp-expand-button:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.scwp-expand-icon {
	display: inline-block;
	transition: transform 0.3s ease;
}

/* Fullscreen mode */
.scwp-shortcode-container.scwp-fullscreen {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	z-index: 99999 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
}

.scwp-shortcode-container.scwp-fullscreen .scwp-body {
	height: calc(100vh - 60px) !important;
}

.scwp-shortcode-container.scwp-fullscreen .scwp-expand-icon::before {
	content: '⛶';
}

/* Update header to support expand button */
.scwp-shortcode-container .scwp-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

/* Responsive design */
@media (max-width: 480px) {
	.scwp-widget-container {
		width: 100vw;
		max-width: 100vw;
		border-radius: 0;
		height: 100vh;
	}
	
	.scwp-body {
		height: calc(100vh - 60px);
	}
}

/* Animation for new messages */
.scwp-message {
	animation: slideIn 0.3s ease-out;
}

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

/* Loading animation */
.scwp-typing::after {
	content: '';
	animation: dots 1.5s infinite;
}

@keyframes dots {
	0%, 20% {
		content: '';
	}
	40% {
		content: '.';
	}
	60% {
		content: '..';
	}
	80%, 100% {
		content: '...';
	}
}

/* Scrollbar styling */
.scwp-messages::-webkit-scrollbar {
	width: 6px;
}

.scwp-messages::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.scwp-messages::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 3px;
}

.scwp-messages::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}

/* Message input scrollbar */
.scwp-message-input::-webkit-scrollbar {
	width: 4px;
}

.scwp-message-input::-webkit-scrollbar-track {
	background: transparent;
}

.scwp-message-input::-webkit-scrollbar-thumb {
	background: #c1c1c1;
	border-radius: 2px;
}

.scwp-message-input::-webkit-scrollbar-thumb:hover {
	background: #a8a8a8;
}
