/* ==========================================================================
   TPD Tool - Chat & Messaging Stylesheet
   Supports real-time chat threads, guest traveler composer, and drawer modals.
   ========================================================================== */

.tpd-chat-messenger-box {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	box-shadow: 0 4px 20px -2px rgba(11, 21, 38, 0.06);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	height: 650px;
	max-height: 85vh;
}

/* Header */
.tpd-cmb-header {
	padding: 16px 22px;
	background: #ffffff;
	border-bottom: 1px solid #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.tpd-cmb-user-info {
	display: flex;
	align-items: center;
	gap: 14px;
}

.tpd-cmb-avatar-dot {
	position: relative;
	width: 44px;
	height: 44px;
}

.tpd-cmb-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #e2e8f0;
}

.tpd-online-dot {
	position: absolute;
	bottom: 1px;
	right: 1px;
	width: 12px;
	height: 12px;
	background-color: #10b981;
	border: 2px solid #ffffff;
	border-radius: 50%;
}

.tpd-cmb-user-info h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
}

.tpd-cmb-status {
	font-size: 12px;
	color: #64748b;
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
}

.tpd-cmb-status i {
	font-size: 7px;
}

/* Message Stream */
.tpd-cmb-stream {
	flex: 1;
	padding: 24px;
	overflow-y: auto;
	background: #f8fafc;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.tpd-cmb-stream::-webkit-scrollbar {
	width: 6px;
}

.tpd-cmb-stream::-webkit-scrollbar-thumb {
	background-color: #cbd5e1;
	border-radius: 4px;
}

.tpd-chat-bubble {
	max-width: 72%;
	padding: 14px 18px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.5;
	position: relative;
	animation: tpdFadeIn 0.25s ease-out forwards;
}

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

/* Inbound (Received) */
.tpd-bubble-inbound {
	align-self: flex-start;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #1e293b;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.tpd-bubble-inbound .tpd-cb-sender {
	font-size: 11.5px;
	font-weight: 700;
	color: #2563eb;
	margin-bottom: 5px;
}

/* Outbound (Sent) */
.tpd-bubble-outbound {
	align-self: flex-end;
	background: linear-gradient(135deg, #0b1526 0%, #1e3a8a 100%);
	color: #ffffff;
	border-bottom-right-radius: 4px;
	box-shadow: 0 4px 12px rgba(11, 21, 38, 0.12);
}

.tpd-bubble-outbound .tpd-cb-sender {
	display: none;
}

.tpd-cb-text {
	word-break: break-word;
}

.tpd-cb-time {
	font-size: 10.5px;
	margin-top: 6px;
	opacity: 0.75;
	text-align: right;
}

.tpd-bubble-inbound .tpd-cb-time {
	color: #64748b;
}

.tpd-bubble-outbound .tpd-cb-time {
	color: #cbd5e1;
}

/* Footer / Composer */
.tpd-cmb-footer {
	padding: 16px 20px;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
}

.tpd-guest-fields-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin-bottom: 12px;
}

.tpd-cmb-input-row {
	display: flex;
	gap: 12px;
	align-items: flex-end;
}

.tpd-chat-textarea {
	flex: 1;
	border: 1px solid #cbd5e1;
	border-radius: 12px;
	padding: 12px 14px;
	font-family: inherit;
	font-size: 13.5px;
	resize: none;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	background: #ffffff;
	line-height: 1.4;
}

.tpd-chat-textarea:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.tpd-chat-send-btn {
	width: 46px;
	height: 46px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: #0b1526;
	color: #ffffff;
	border: none;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
}

.tpd-chat-send-btn:hover {
	background: #1e3a8a;
	transform: translateY(-1px);
}

.tpd-chat-send-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.tpd-chat-alert-note {
	margin: 8px 0 0;
	font-size: 11.5px;
	color: #64748b;
	display: flex;
	align-items: center;
	gap: 6px;
}

.tpd-chat-alert-note i {
	color: #d97706;
}

/* Chat Drawer / Modal */
.tpd-chat-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(11, 21, 38, 0.5);
	backdrop-filter: blur(4px);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.tpd-chat-modal-content {
	background: #ffffff;
	width: 100%;
	max-width: 680px;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	position: relative;
}

.tpd-chat-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: #f1f5f9;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #64748b;
	transition: background 0.15s, color 0.15s;
	z-index: 10;
}

.tpd-chat-modal-close:hover {
	background: #fee2e2;
	color: #ef4444;
}
