/**
 * Manu Messenger Vibe Frontend Stylesheet.
 * Apple iMessage / Modern UX Chat Interface.
 */

/* Main Container */
.manu-msg-app-container {
	display: flex;
	width: 100%;
	height: 650px;
	max-height: 85vh;
	background: #ffffff;
	border: 1px solid #e1e4e8;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
	color: #1a1a1a;
	box-sizing: border-box;
}

.manu-msg-app-container * {
	box-sizing: border-box;
}

/* Left Sidebar */
.manu-msg-sidebar {
	width: 320px;
	min-width: 280px;
	border-right: 1px solid #e1e4e8;
	display: flex;
	flex-direction: column;
	background: #fcfcfc;
}

.manu-msg-sidebar-header {
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-bottom: 1px solid #e1e4e8;
}

.manu-msg-sidebar-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #111827;
}

.manu-msg-badge {
	background: #ef4444;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 10px;
}

.manu-msg-search-box {
	padding: 12px 16px;
	border-bottom: 1px solid #f0f2f5;
}

.manu-msg-search-box input {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 13px;
	outline: none;
	background: #ffffff;
	transition: border-color 0.2s;
}

.manu-msg-search-box input:focus {
	border-color: #2563eb;
}

.manu-msg-inbox-list {
	flex: 1;
	overflow-y: auto;
}

.manu-msg-conversation-item {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	border-bottom: 1px solid #f3f4f6;
	cursor: pointer;
	transition: background 0.15s;
}

.manu-msg-conversation-item:hover {
	background: #f3f4f6;
}

.manu-msg-conversation-item.active {
	background: #eef2ff;
	border-left: 3px solid #2563eb;
}

.manu-msg-item-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 12px;
	flex-shrink: 0;
}

.manu-msg-item-content {
	flex: 1;
	min-width: 0;
}

.manu-msg-item-top {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 4px;
}

.manu-msg-item-name {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.manu-msg-item-time {
	font-size: 11px;
	color: #9ca3af;
	margin-left: 6px;
	flex-shrink: 0;
}

.manu-msg-item-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.manu-msg-item-snippet {
	font-size: 12px;
	color: #6b7280;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Right Main Area */
.manu-msg-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	position: relative;
}

.manu-msg-thread-header {
	padding: 14px 20px;
	border-bottom: 1px solid #e1e4e8;
	display: flex;
	align-items: center;
	background: #ffffff;
	min-height: 60px;
}

.manu-msg-participant-info {
	display: flex;
	align-items: center;
}

.manu-msg-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	margin-right: 12px;
}

.manu-msg-participant-info h4 {
	margin: 0 0 2px 0;
	font-size: 15px;
	font-weight: 700;
	color: #111827;
}

.manu-msg-status {
	font-size: 11px;
	color: #10b981;
}

/* Messages Feed */
.manu-msg-feed {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #fafafa;
}

.manu-msg-empty-feed {
	margin: auto;
	text-align: center;
	color: #9ca3af;
}

.manu-msg-empty-feed .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	margin-bottom: 12px;
	color: #d1d5db;
}

/* Message Bubbles */
.manu-msg-bubble-wrapper {
	display: flex;
	flex-direction: column;
	max-width: 70%;
}

.manu-msg-bubble-wrapper.self {
	align-self: flex-end;
	align-items: flex-end;
}

.manu-msg-bubble-wrapper.other {
	align-self: flex-start;
	align-items: flex-start;
}

.manu-msg-bubble {
	padding: 10px 15px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.45;
	word-break: break-word;
}

.manu-msg-bubble-self {
	background: #2563eb;
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.manu-msg-bubble-self a {
	color: #ffffff;
	text-decoration: underline;
}

.manu-msg-bubble-other {
	background: #e5e7eb;
	color: #1f2937;
	border-bottom-left-radius: 4px;
}

.manu-msg-bubble-other a {
	color: #2563eb;
}

.manu-msg-bubble-time {
	font-size: 10px;
	color: #9ca3af;
	margin-top: 3px;
	padding: 0 4px;
}

/* Input Bar */
.manu-msg-input-bar {
	padding: 12px 16px;
	background: #ffffff;
	border-top: 1px solid #e1e4e8;
	display: flex;
	gap: 10px;
	align-items: flex-end;
}

.manu-msg-input-bar textarea {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	font-size: 14px;
	resize: none;
	outline: none;
	max-height: 100px;
	line-height: 1.4;
	font-family: inherit;
}

.manu-msg-input-bar textarea:focus {
	border-color: #2563eb;
}

.manu-msg-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #2563eb;
	color: #ffffff;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s, transform 0.1s;
	flex-shrink: 0;
}

.manu-msg-send-btn:hover {
	background: #1d4ed8;
	transform: scale(1.05);
}

.manu-msg-send-btn .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
}

/* FAQ Suggestion Bar & Toggle Button */
.manu-msg-faq-toggle-btn {
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 50%;
	width: 38px;
	height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 16px;
	flex-shrink: 0;
	transition: background 0.15s, transform 0.1s;
}

.manu-msg-faq-toggle-btn:hover {
	background: #e5e7eb;
	transform: scale(1.05);
}

.manu-msg-faq-container {
	padding: 12px 16px;
	background: #f8fafc;
	border-top: 1px solid #e2e8f0;
	max-height: 220px;
	overflow-y: auto;
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.manu-msg-faq-categories {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-bottom: 8px;
	margin-bottom: 8px;
	border-bottom: 1px solid #e2e8f0;
}

.manu-msg-faq-cat-btn {
	padding: 5px 12px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 500;
	background: #ffffff;
	border: 1px solid #cbd5e1;
	cursor: pointer;
	white-space: nowrap;
	transition: all 0.15s ease;
	color: #334155;
}

.manu-msg-faq-cat-btn:hover,
.manu-msg-faq-cat-btn.active {
	background: #0071e3;
	border-color: #0071e3;
	color: #ffffff;
}

.manu-msg-faq-list {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.manu-msg-faq-chip {
	padding: 6px 12px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	font-size: 12px;
	color: #1e293b;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
	text-align: left;
}

.manu-msg-faq-chip:hover {
	background: #eff6ff;
	border-color: #93c5fd;
	color: #1d4ed8;
}

.manu-msg-faq-answer-preview {
	margin-top: 8px;
	padding: 10px 14px;
	background: #eff6ff;
	border-left: 3px solid #0071e3;
	border-radius: 4px;
	font-size: 13px;
	color: #1e3a8a;
	line-height: 1.4;
}

/* Chat Button Trigger */
.manu-msg-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	background: #2563eb;
	color: #ffffff !important;
	border-radius: 6px;
	text-decoration: none !important;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.2s, transform 0.1s;
}

.manu-msg-trigger-btn:hover {
	background: #1d4ed8;
	transform: translateY(-1px);
}

/* Floating Launcher */
.manu-msg-floating-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #2563eb;
	color: #ffffff;
	box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 999990;
	transition: transform 0.2s, background 0.2s;
}

.manu-msg-floating-launcher:hover {
	transform: scale(1.08);
	background: #1d4ed8;
}

.manu-msg-floating-launcher .dashicons {
	font-size: 26px;
	width: 26px;
	height: 26px;
}

.manu-msg-floating-badge {
	position: absolute;
	top: -2px;
	right: -2px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: bold;
	padding: 2px 6px;
	border-radius: 10px;
	border: 2px solid #fff;
}

.manu-msg-floating-drawer {
	position: fixed;
	bottom: 90px;
	right: 24px;
	width: 380px;
	height: 580px;
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
	z-index: 999991;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: manuMsgSlideUp 0.25s ease-out;
}

@keyframes manuMsgSlideUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.manu-msg-drawer-header {
	padding: 12px 16px;
	background: #2563eb;
	color: #fff;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.manu-msg-drawer-header h4 {
	margin: 0;
	color: #fff;
	font-size: 15px;
}

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

.manu-msg-drawer-body {
	flex: 1;
	overflow: hidden;
	display: flex;
}

.manu-msg-drawer-body .manu-msg-app-container {
	height: 100%;
	border: none;
	border-radius: 0;
	box-shadow: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
	.manu-msg-app-container {
		height: 550px;
	}
	.manu-msg-sidebar {
		width: 100%;
	}
	.manu-msg-main {
		display: none;
	}
	.manu-msg-app-container.chat-active .manu-msg-sidebar {
		display: none;
	}
	.manu-msg-app-container.chat-active .manu-msg-main {
		display: flex;
	}
	.manu-msg-floating-drawer {
		width: calc(100vw - 32px);
		right: 16px;
		bottom: 80px;
	}
}
