/* =========================
	WhatsApp Cloud – Chat UI
	========================= */

/* Reset-ish */
.nxtcc-whatsapp-widget, .nxtcc-whatsapp-widget * {
	box-sizing: border-box;
}

/* ROOT WRAPPER */
.nxtcc-whatsapp-widget {
	max-width: 900px;
	height: 100%;
	max-height: 600px;
	min-height: 300px;
	margin: 10px auto;
	display: flex;
	overflow: hidden;
	flex-direction: row;
	border-radius: 14px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
	background: #f8f8f8;
	font-family: inherit;
}

/* INBOX PANEL */
.nxtcc-inbox-panel {
	width: 320px;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	border-right: 1px solid #eee;
	background: #fff;
	overflow: hidden;
}

.nxtcc-inbox-header {
	padding: 14px 16px;
	background: #f3f3f3;
	border-bottom: 1px solid #eee;
}

.nxtcc-inbox-title {
	font-weight: 600;
	font-size: 1.25em;
	margin-bottom: 6px;
}

.nxtcc-inbox-search {
	width: 100%;
	padding: 6px 8px;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
	margin-bottom: 10px;
}

.nxtcc-chat-list {
	flex: 1;
	overflow-y: auto;
	max-height: 300px;
	padding: 0 8px 0 0;
}
.nxtcc-chat-list::-webkit-scrollbar { width: 6px; }
.nxtcc-chat-list::-webkit-scrollbar-thumb {
	background-color: #bbb;
	border-radius: 6px;
}

.nxtcc-chat-head {
	display: flex;
	align-items: center;
	padding: 12px 14px;
	border-bottom: 1px solid #f3f3f3;
	cursor: pointer;
	background: #fff;
	transition: background 0.15s;
}
.nxtcc-chat-head.active,
.nxtcc-chat-head:hover { background: #e9f6eb; }

.nxtcc-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2em;
	margin-right: 12px;
	flex-shrink: 0;
}

/* allow text children to shrink so ellipsis can work */
.nxtcc-chat-head-main { flex: 1 1 auto; min-width: 0; }

/* single-line truncation for name + preview */
.nxtcc-chat-head-name {
	font-weight: 600;
	margin-bottom: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.nxtcc-chat-head-preview {
	font-size: 0.99em;
	color: #626262;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nxtcc-chat-head-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	min-width: 58px;
}
.nxtcc-chat-head-time { font-size: 0.90em; color: #999; }
.nxtcc-chat-head-unread {
	display: inline-block;
	margin-top: 6px;
	background: #25d366;
	color: #fff;
	font-size: 0.85em;
	min-width: 22px;
	text-align: center;
	padding: 2px 6px;
	border-radius: 12px;
	font-weight: bold;
}

/* CHAT PANEL */
.nxtcc-chat-panel {
	flex: 1 1 0;
	background: #f5f6fa;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	overflow: hidden;
	position: relative; /* positioning context for scroll button */
}

.nxtcc-chat-header {
	display: flex;
	align-items: center;
	padding: 13px 16px;
	border-bottom: 1px solid #eaeaea;
	background: #fff;
	font-weight: 600;
	min-height: 56px;
	position: relative;
	gap: 10px;
}
.nxtcc-chat-back-btn {
	display: none;
	margin-right: 6px;
	background: none;
	border: none;
	font-size: 1.4em;
	color: #626262;
	cursor: pointer;
	padding: 2px 4px;
}
.nxtcc-chat-contact-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}
.nxtcc-chat-contact-name {
	font-weight: 600;
	font-size: 1.12em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.nxtcc-chat-contact-number {
	font-size: 0.92em;
	color: #888;
	margin-top: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Selection-mode header actions */
.nxtcc-chat-actions {
	margin-left: auto;
	display: none;
	align-items: center;
	gap: 8px;
}
.nxtcc-chat-actions .nxtcc-selected-count {
	font-weight: 600;
	margin-right: 4px;
}
.nxtcc-chat-actions button {
	background: #fff;
	border: 1px solid #e3e3e3;
	border-radius: 8px;
	padding: 6px 8px;
	cursor: pointer;
	line-height: 1;
}
.nxtcc-chat-actions button[disabled] {
	opacity: .5;
	cursor: not-allowed;
}

/* Header favorite icon inside the Favorite button (empty ☆ / filled ★) */
.nxtcc-chat-actions .nxtcc-act-favorite {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.nxtcc-chat-actions .nxtcc-act-favorite-icon {
	font-size: 1.05em;
	line-height: 1;
	color: #f5c518; /* gold */
}
.nxtcc-chat-actions button[disabled] .nxtcc-act-favorite-icon {
	opacity: .7;
}

/* THREAD */
.nxtcc-chat-thread {
	flex: 1;
	overflow-y: auto;
	min-height: 60vh;
	max-height: 60vh;
	padding: 18px 16px 10px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.nxtcc-chat-thread::-webkit-scrollbar { width: 6px; }
.nxtcc-chat-thread::-webkit-scrollbar-thumb {
	background-color: #bbb;
	border-radius: 6px;
}

.nxtcc-load-older {
	text-align: center;
	padding: 5px;
	color: #888;
}

/* BUBBLES */
.nxtcc-chat-bubble {
	max-width: 74%;
	margin-bottom: 12px;
	padding: 9px 13px 8px 13px;
	border-radius: 15px;
	position: relative;
	word-break: break-word;
	background: #fff;
	box-shadow: 0 2px 4px rgba(40, 55, 71, 0.04);
	cursor: pointer;
}
.nxtcc-chat-bubble.sent {
	background: #d2f7ce;
	margin-left: auto;
}
.nxtcc-chat-bubble.received {
	background: #fff;
	margin-right: auto;
}

/* Meta row: inline-flex so star sits beside the date */
.nxtcc-chat-bubble .nxtcc-msg-meta {
	margin-top: 7px;
	font-size: 0.82em;
	color: #888;
	opacity: 0.8;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	justify-content: flex-end;
	width: 100%;
	text-align: right;
}

/* Inline favorite star beside date */
.nxtcc-fav-star-inline {
	color: #f5c518;
	font-size: 1em;
	line-height: 1;
}

/* (Legacy) absolute star on bubble – neutralized */
.nxtcc-fav-star { display: none; }

/* Reply quote block */
.nxtcc-reply-quote {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 6px 8px;
	margin-bottom: 6px;
	background: #f1f3f4;
	border-left: 3px solid #25d366;
	border-radius: 8px;
}
.nxtcc-reply-thumb {
	width: 48px;
	height: auto;
	border-radius: 6px;
	display: block;
	flex-shrink: 0;
}
.nxtcc-reply-content { min-width: 0; }
.nxtcc-reply-text {
	font-size: 0.92em;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Selection affordances */
.nxtcc-chat-bubble.nxtcc-selected {
	outline: 2px solid #25d366;
	background: #e9f6eb;
}
.nxtcc-chat-bubble .nxtcc-check {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #25d366;
	color: #fff;
	font-size: 12px;
	display: none;
	align-items: center;
	justify-content: center;
}
.nxtcc-chat-bubble.nxtcc-selected .nxtcc-check { display: flex; }

/* Status icons */
.nxtcc-status-tick { color: #555; margin-left: 5px; }
.nxtcc-status-tick.read { color: #25d366; }
.nxtcc-status-retry { color: #da6e10; }
.nxtcc-status-fail  { color: #d63434; }

/* Media inside messages */
.nxtcc-msg-media {
	max-width: 200px;
	height: auto;
	margin-top: 5px;
	display: block;
	border-radius: 8px;
}

/* Unread marker */
.nxtcc-first-unread { outline: 2px solid #25d366; }
@keyframes pulse-highlight {
	0% { outline-color: #25d366; }
	100% { outline-color: transparent; }
}

/* === INLINE / BLOCK FORMATTING INSIDE BUBBLES === */

/* General strong/em/del tweaks (optional, browsers have defaults) */
.nxtcc-chat-bubble strong { font-weight: 600; }
.nxtcc-chat-bubble em { font-style: italic; }
.nxtcc-chat-bubble del {
	text-decoration: line-through;
	opacity: 0.9;
}

.nxtcc-code-block {
	margin: 6px 0 4px;
	padding: 6px 8px;
	background: #f5f5f5; /* lighter, WhatsApp-style */
	color: #222;
	border-radius: 6px;
	border: 1px solid #e0e0e0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 0.9em;
	overflow-x: auto;
}
.nxtcc-code-block code {
	white-space: pre;
}

/* Inline code: `code` (matches JS class "nxtcc-inline-code") */
.nxtcc-inline-code {
	display: inline-block;
	padding: 1px 4px;
	border-radius: 4px;
	background: #f5f5f5;
	border: 1px solid #e0e0e0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
	font-size: 0.95em;
}

.nxtcc-strike {
	text-decoration: line-through;
}

.nxtcc-list {
	margin: 4px 0;
	padding-left: 1.25em;
}

.nxtcc-list li {
	list-style: disc;
	margin: 2px 0;
}

/* (unused now, but harmless if kept) */
/* Bullet lines: "* text" or "- text" */
.nxtcc-bullet {
	margin: 2px 0;
	padding-left: 0;
	font-size: 0.98em;
}

/* Quote line: "> text" */
.nxtcc-quote {
	margin: 2px 0;
	padding-left: 8px;
	border-left: 3px solid #c4c4c4;
	color: #555;
	font-size: 0.96em;
}

/* INPUT + REPLY STRIP */
.nxtcc-chat-input-wrapper {
	border-top: 1px solid #ddd;
	background: #fff;
	position: sticky;
	bottom: 0;
	z-index: 10;
	width: 100%;
}

.nxtcc-reply-strip {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-top: 1px solid #ddd;
	background: #fff7f0;
}
.nxtcc-reply-strip .nxtcc-reply-label { font-weight: 600; margin-right: 6px; }
.nxtcc-reply-strip .nxtcc-reply-snippet {
	color: #555;
	max-width: 70%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.nxtcc-reply-strip .nxtcc-reply-cancel {
	margin-left: auto;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	color: #ff0000;
}

.nxtcc-chat-input-bar {
	display: flex;
	align-items: center;
	padding: 10px 12px;
	border-top: 1px solid #ddd;
	background: #fff;
}
.nxtcc-chat-textarea {
	flex: 1;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid #ccc;
	resize: none;
	font-family: inherit;
	font-size: 1em;
}
.nxtcc-send-msg-btn {
	margin-left: 8px;
	padding: 6px 10px;
	border: none;
	background: #25d366;
	color: #fff;
	border-radius: 6px;
	cursor: pointer;
	font-size: 1.2em;
	flex-shrink: 0;
}

/* FORWARD MODAL */
.nxtcc-forward-modal { display: none; }
.nxtcc-forward-modal .nxtcc-forward-backdrop {
	position: fixed; inset: 0;
	background: rgba(0,0,0,0.35);
	z-index: 100001;
}
.nxtcc-forward-modal .nxtcc-forward-dialog {
	position: fixed; left: 50%; top: 50%;
	transform: translate(-50%,-50%);
	width: 520px; max-width: 92vw;
	background: #fff; border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.2);
	display: flex; flex-direction: column;
	overflow: hidden;
	z-index: 100002;
}
.nxtcc-forward-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 14px; border-bottom: 1px solid #eee; background: #f7f7f7;
}
.nxtcc-forward-title { font-weight: 700; }
.nxtcc-forward-close {
	background: none; border: none; cursor: pointer; font-size: 16px;
}

.nxtcc-forward-body { padding: 12px 14px; max-height: 50vh; overflow: auto; }
.nxtcc-forward-search {
	width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 10px;
}
.nxtcc-forward-list { width: 100%; }
.nxtcc-forward-empty { padding: 16px; color: #888; text-align: center; }

.nxtcc-forward-row {
	display: flex; align-items: center; justify-content: space-between;
	padding: 8px 6px; border-bottom: 1px solid #f2f2f2;
}
.nxtcc-forward-row .meta { color: #777; font-size: .9em; }
.nxtcc-forward-row input[type="checkbox"] { transform: scale(1.05); }

.nxtcc-forward-footer {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 14px; border-top: 1px solid #eee; background: #fafafa;
}
.nxtcc-forward-selected-count { color: #555; }
.nxtcc-forward-send {
	border: none; border-radius: 8px; padding: 8px 12px;
	background: #25d366; color: #fff; cursor: pointer;
}
.nxtcc-forward-send[disabled] { opacity: .5; cursor: not-allowed; }

/* RESPONSIVE */
@media (max-width: 750px) {
	.nxtcc-whatsapp-widget {
	flex-direction: column;
	min-width: 0;
	border-radius: 0;
	box-shadow: none;
	max-width: 100vw;
	min-height: 320px;
	}
	.nxtcc-inbox-panel,
	.nxtcc-chat-panel { width: 100%; max-width: 100vw; }
	.nxtcc-inbox-panel { border-right: none; border-bottom: 1px solid #eaeaea; }
	.nxtcc-chat-panel {
	position: relative;
	min-height: 360px;
	flex: 1 1 0;
	}
	.nxtcc-inbox-panel.hide { display: none !important; }
	.nxtcc-chat-panel:not(.active) { display: none !important; }
	.nxtcc-chat-back-btn { display: inline-block; }

	.nxtcc-send-msg-btn { padding: 8px 10px; font-size: 1.1em; }
}

/* Caption under media */
.nxtcc-msg-caption { margin-top: 6px; font-size: 0.92em; color: #444; }

/* Upload button look */
.nxtcc-upload-btn {
	margin-right: 8px;
	padding: 6px 8px;
	border: none;
	background: #f0f0f0;
	border-radius: 6px;
	cursor: pointer;
}

/* floating "scroll to bottom" button */
.nxtcc-scroll-bottom {
	position: absolute;
	right: 16px;
	/* sit above the composer; tweak if your composer height changes */
	bottom: 92px;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #000;
	font-size: 20px;
	line-height: 1;
	display: none;            /* hidden by default */
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(0,0,0,.18);
	cursor: pointer;
	z-index: 15;
}
.nxtcc-scroll-bottom.show { display: flex; }

@media (max-width: 750px) {
	.nxtcc-scroll-bottom { bottom: 86px; }
}

/* =========================
	FULLSCREEN MODE
	========================= */

.nxtcc-whatsapp-widget.nxtcc-fullscreen {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	max-width: none;
	max-height: none;
	margin: 0;
	border-radius: 0;
	z-index: 99999;
}

/* Let inbox list and chat thread breathe more in fullscreen */
.nxtcc-whatsapp-widget.nxtcc-fullscreen .nxtcc-chat-list {
	max-height: none;
}

.nxtcc-whatsapp-widget.nxtcc-fullscreen .nxtcc-chat-thread {
	min-height: 0;
	max-height: none;
}



