/* ==============================================
   Alert Now — Chat Widget Frontend Styles
   ============================================== */
#alertnow-chat-wrapper {
	display: none;
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

/* ---- Toggle button ---- */
#alertnow-chat-toggle {
	width: 56px;
	height: 56px;
	border: none;
	border-radius: 50%;
	background: #0073aa;
	color: #fff;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	bottom: 0;
	right: 0;
	transition: transform 0.2s ease;
}

#alertnow-chat-toggle:hover {
	transform: scale(1.08);
}

#alertnow-chat-toggle svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

#alertnow-chat-icon-close {
	display: none;
}

/* ---- Panel ---- */
#alertnow-chat-panel {
	display: none;
	position: absolute;
	bottom: 70px;
	right: 0;
	width: 340px;
	max-height: 490px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	flex-direction: column;
}

#alertnow-chat-panel.alertnow-chat-open {
	display: flex;
}

/* ---- Header ---- */
#alertnow-chat-header {
	background: #0073aa;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

#alertnow-chat-header-text h4 {
	margin: 0 0 2px;
	font-size: 15px;
	font-weight: 600;
}

#alertnow-chat-header-text span {
	font-size: 12px;
	opacity: 0.85;
}

#alertnow-chat-close {
	background: none;
	border: none;
	color: #fff;
	cursor: pointer;
	font-size: 20px;
	padding: 0 4px;
	line-height: 1;
}

/* ---- Pre-chat form ---- */
#alertnow-chat-prechat {
	padding: 20px 16px;
}

#alertnow-chat-prechat label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #555;
	margin-bottom: 4px;
}

#alertnow-chat-prechat input {
	width: 100%;
	padding: 8px 10px;
	margin-bottom: 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 13px;
	box-sizing: border-box;
}

#alertnow-chat-prechat input:focus {
	border-color: #0073aa;
	outline: none;
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

#alertnow-chat-start {
	width: 100%;
	padding: 10px;
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

#alertnow-chat-start:hover {
	background: #005177;
}

#alertnow-chat-prechat-error {
	display: none;
	color: #d63638;
	font-size: 12px;
	margin-top: 8px;
}

/* ---- Messages ---- */
#alertnow-chat-messages {
	display: none;
	flex: 1;
	overflow-y: auto;
	padding: 12px 16px;
	max-height: 290px;
}

#alertnow-chat-msg-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* Message bubbles */
.alertnow-chat-msg {
	max-width: 80%;
	padding: 8px 12px;
	border-radius: 12px;
	word-wrap: break-word;
	font-size: 13px;
	line-height: 1.45;
}

.alertnow-chat-msg-visitor {
	align-self: flex-end;
	background: #0073aa;
	color: #fff;
	border-bottom-right-radius: 4px;
}

.alertnow-chat-msg-owner {
	align-self: flex-start;
	background: #f0f0f0;
	color: #333;
	border-bottom-left-radius: 4px;
}

.alertnow-chat-msg-system {
	align-self: center;
	background: transparent;
	color: #888;
	font-size: 12px;
	font-style: italic;
	text-align: center;
}

.alertnow-chat-msg-error {
	align-self: center;
	background: #fef0f0;
	color: #d63638;
	font-size: 12px;
	text-align: center;
	border: 1px solid #f1c6c7;
}

/* ---- Footer input ---- */
#alertnow-chat-footer {
	display: none;
	padding: 10px 12px;
	border-top: 1px solid #eee;
	gap: 8px;
	align-items: flex-end;
}

#alertnow-chat-message {
	flex: 1;
	resize: none;
	border: 1px solid #ccc;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	min-height: 36px;
	max-height: 72px;
	font-family: inherit;
}

#alertnow-chat-message:focus {
	border-color: #0073aa;
	outline: none;
}

#alertnow-chat-send {
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease;
}

#alertnow-chat-send:hover {
	background: #005177;
}

#alertnow-chat-send:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}