/* Ringkas Chat — widget front-end (v0.1.0). Namespace "rchat-" sepenuhnya
   berasingan dari CSS Ringkas Checkout ("rc-"), elak sebarang perlanggaran
   selector walaupun dua-dua plugin aktif serentak pada site yang sama. */

.rchat-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.rchat-bubble {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #16a34a;
	border: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.rchat-bubble:hover {
	background: #15803d;
}

/* Fasa 2 — titik merah bila ada reply admin baru masuk selagi panel ditutup
   (pelanggan tak sedar perbualan tu dah dijawab melainkan dia nampak ni). */
.rchat-badge {
	position: absolute;
	top: -3px;
	right: -3px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #dc2626;
	border: 2px solid #fff;
	animation: rchat-badge-pulse 1.6s infinite;
}

.rchat-badge[hidden] {
	display: none;
}

@keyframes rchat-badge-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.15); }
}

.rchat-reply-bubble-admin {
	background: #dcfce7;
	border: 1px solid #bbf7d0;
}

.rchat-panel {
	position: absolute;
	right: 0;
	bottom: 70px;
	width: 340px;
	max-width: calc(100vw - 32px);
	max-height: 70vh;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.rchat-panel[hidden] {
	display: none;
}

.rchat-panel-header {
	background: #16a34a;
	color: #fff;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.rchat-panel-title {
	font-weight: 700;
	font-size: 15px;
}

.rchat-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.rchat-panel-body {
	padding: 16px;
	overflow-y: auto;
	flex-grow: 1;
}

.rchat-menu-greeting {
	font-size: 14px;
	color: #333;
	margin: 0 0 14px;
}

.rchat-menu-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 8px;
	background: #f3f4f6;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	cursor: pointer;
	text-align: left;
}

.rchat-menu-btn:hover {
	background: #e5e7eb;
}

.rchat-back {
	background: none;
	border: none;
	color: #16a34a;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 0 0 12px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.rchat-field-label {
	display: block;
	font-size: 13px;
	color: #444;
	margin-bottom: 6px;
}

.rchat-input,
.rchat-textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	margin-bottom: 10px;
	font-family: inherit;
}

.rchat-textarea {
	min-height: 70px;
	resize: vertical;
}

.rchat-submit {
	width: 100%;
	padding: 11px;
	background: #16a34a;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
}

.rchat-submit:disabled {
	opacity: .6;
	cursor: default;
}

.rchat-skip {
	width: 100%;
	padding: 9px;
	background: none;
	color: #666;
	border: none;
	font-size: 13px;
	cursor: pointer;
	margin-top: 4px;
}

.rchat-result {
	margin-top: 14px;
	font-size: 14px;
	color: #222;
	line-height: 1.5;
}

.rchat-order-card {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 10px 12px;
	margin-bottom: 8px;
}

.rchat-order-card-head {
	display: flex;
	justify-content: space-between;
	font-weight: 700;
	margin-bottom: 4px;
}

.rchat-order-status {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: #dcfce7;
	color: #166534;
	font-size: 12px;
	font-weight: 700;
}

.rchat-order-items {
	font-size: 13px;
	color: #555;
	margin: 6px 0 0;
}

.rchat-reply-bubble {
	background: #f3f4f6;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	color: #222;
	margin-top: 10px;
	line-height: 1.5;
}

.rchat-error {
	color: #b91c1c;
	font-size: 13px;
	margin-top: 8px;
}
