/**
 * HDL Support – Live Chat Widget
 */

#hdl-ss-chat-widget {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 99999;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#hdl-ss-chat-toggle {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: #4f46e5;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.15s, box-shadow 0.15s;
}

#hdl-ss-chat-toggle:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

#hdl-ss-chat-panel {
	position: absolute;
	bottom: 70px;
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	height: 480px;
	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;
	border: 1px solid #e2e8f0;
}

#hdl-ss-chat-panel[hidden] {
	display: none !important;
}

.hdl-chat-header {
	background: #4f46e5;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 0.95rem;
}

#hdl-ss-chat-close {
	background: transparent;
	border: none;
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
	padding: 0 4px;
}

#hdl-ss-chat-close:hover {
	opacity: 1;
}

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

.hdl-chat-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 12px;
	font-size: 0.9rem;
	line-height: 1.45;
	word-wrap: break-word;
}

.hdl-chat-msg.customer {
	align-self: flex-end;
	background: #4f46e5;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.hdl-chat-msg.agent {
	align-self: flex-start;
	background: #fff;
	color: #0f172a;
	border: 1px solid #e2e8f0;
	border-bottom-left-radius: 4px;
}

.hdl-chat-msg .meta {
	font-size: 0.7rem;
	opacity: 0.7;
	margin-top: 4px;
}

#hdl-ss-chat-form-wrap {
	border-top: 1px solid #e2e8f0;
	padding: 12px;
	background: #fff;
}

#hdl-ss-chat-preform {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

#hdl-ss-chat-preform input {
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.9rem;
	font-family: inherit;
}

#hdl-ss-chat-preform button,
#hdl-ss-chat-form button {
	padding: 10px 16px;
	background: #4f46e5;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-weight: 500;
	font-size: 0.9rem;
	cursor: pointer;
	font-family: inherit;
}

#hdl-ss-chat-preform button:hover,
#hdl-ss-chat-form button:hover {
	background: #4338ca;
}

#hdl-ss-chat-form {
	display: flex;
	gap: 8px;
}

#hdl-ss-chat-form[hidden] {
	display: none !important;
}

#hdl-ss-chat-input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.9rem;
	font-family: inherit;
}

#hdl-ss-chat-input:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

@media (max-width: 400px) {
	#hdl-ss-chat-widget {
		bottom: 16px;
		right: 16px;
	}
	#hdl-ss-chat-panel {
		width: calc(100vw - 32px);
	}
}
