/* Custom Live Chat - Frontend Styles */

.clc-widget {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.5;
}

/* Floating toggle button */
.clc-toggle {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: relative;
}

.clc-toggle:hover {
	transform: scale(1.08);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.clc-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	min-width: 20px;
	height: 20px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
}

/* Chat window */
.clc-window {
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 520px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

/* Header */
.clc-header {
	background: #2563eb;
	color: #fff;
	padding: 16px 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

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

.clc-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
	opacity: 0.85;
}

.clc-close:hover {
	opacity: 1;
}

/* Pre-chat form */
.clc-prechat {
	padding: 24px 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.clc-welcome-text {
	margin: 0 0 20px;
	color: #374151;
	text-align: center;
}

.clc-field {
	margin-bottom: 14px;
}

.clc-field label {
	display: block;
	margin-bottom: 4px;
	font-weight: 500;
	color: #374151;
	font-size: 13px;
}

.clc-field input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.clc-field input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.clc-btn {
	display: inline-block;
	padding: 12px 20px;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-align: center;
	width: 100%;
	transition: background 0.15s;
}

.clc-btn-primary {
	background: #2563eb;
	color: #fff;
}

.clc-btn-primary:hover {
	background: #1d4ed8;
}

/* Chat area */
.clc-chat-area {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.clc-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.clc-msg {
	max-width: 80%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.45;
	word-wrap: break-word;
}

.clc-msg.visitor {
	align-self: flex-end;
	background: #2563eb;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.clc-msg.agent {
	align-self: flex-start;
	background: #e2e8f0;
	color: #1e293b;
	border-bottom-left-radius: 4px;
}

.clc-msg-time {
	font-size: 11px;
	opacity: 0.7;
	margin-top: 4px;
	display: block;
}

/* Message form */
.clc-message-form {
	display: flex;
	align-items: flex-end;
	padding: 12px;
	border-top: 1px solid #e2e8f0;
	background: #fff;
	gap: 8px;
	flex-shrink: 0;
}

.clc-message-form textarea {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	padding: 10px 16px;
	font-size: 14px;
	resize: none;
	max-height: 100px;
	font-family: inherit;
	line-height: 1.4;
}

.clc-message-form textarea:focus {
	outline: none;
	border-color: #2563eb;
}

.clc-send-btn {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #2563eb;
	color: #fff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s;
}

.clc-send-btn:hover {
	background: #1d4ed8;
}

.clc-send-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Responsive */
@media (max-width: 420px) {
	.clc-widget {
		bottom: 16px;
		right: 16px;
	}

	.clc-window {
		width: calc(100vw - 32px);
		height: calc(100vh - 100px);
		bottom: 72px;
	}
}

/* Closed conversation state */
.clc-closed {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 20px;
	background: #f8fafc;
}

.clc-closed-content {
	text-align: center;
	max-width: 280px;
}

.clc-closed-icon {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
	font-size: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

.clc-closed-title {
	font-size: 18px;
	font-weight: 600;
	color: #0f172a;
	margin: 0 0 8px;
}

.clc-closed-text {
	font-size: 14px;
	color: #64748b;
	margin: 0 0 20px;
	line-height: 1.5;
}
