/**
 * UniteElements Slide-Out Chat Drawer & Direct Inquiry Styles
 *
 * Built with Brand Identity Tokens: Warm Pearl #F5F5F0, Electric Blue Ribbon #0052FF,
 * Shark #15181E, Ghost borders, and tactile frosted glass.
 */

.ue-chat-drawer-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(21, 24, 30, 0.45);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 999999;
	display: flex;
	justify-content: flex-end;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1)), visibility 0.28s;
}

.ue-chat-drawer-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

.ue-chat-drawer {
	width: 100%;
	max-width: 520px;
	height: 100%;
	background: #ffffff;
	box-shadow: -12px 0 40px -10px rgba(21, 24, 30, 0.18);
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform 0.32s var(--ease-spring, cubic-bezier(0.16, 1, 0.3, 1));
	position: relative;
	overflow: hidden;
}

.ue-chat-drawer-backdrop.is-open .ue-chat-drawer {
	transform: translateX(0);
}

/* Header */
.ue-chat-header {
	padding: 18px 24px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-shrink: 0;
	z-index: 2;
}

.ue-chat-header-left {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}

.ue-chat-recipient-avatar {
	width: 48px;
	height: 48px;
	border-radius: 14px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ue-chat-recipient-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ue-chat-recipient-badge-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 3px;
}

.ue-chat-type-pill {
	display: inline-block;
	font-size: 10.5px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 9999px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: rgba(0, 82, 255, 0.08);
	color: var(--color-blue-ribbon, #0052ff);
}

.ue-chat-status-indicator {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 11px;
	font-weight: 600;
	color: #10B981;
}

.ue-chat-status-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #10B981;
	box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
	animation: chatBeacon 2s infinite ease-in-out;
}

@keyframes chatBeacon {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.4); opacity: 0.7; }
}

.ue-chat-recipient-name {
	margin: 0;
	font-family: var(--font-heading, 'Outfit', sans-serif);
	font-size: 16px;
	font-weight: 700;
	color: var(--color-shark, #15181e);
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ue-chat-recipient-sub {
	font-size: 12px;
	color: var(--color-shark-muted, #576275);
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ue-chat-close-btn {
	background: #EEF1F6;
	border: 1px solid rgba(200, 205, 216, 0.6);
	width: 36px;
	height: 36px;
	border-radius: 10px;
	color: var(--color-shark-muted, #576275);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
	flex-shrink: 0;
}

.ue-chat-close-btn:hover {
	background: #ffffff;
	color: var(--color-shark, #15181e);
	border-color: var(--color-blue-ribbon, #0052ff);
	transform: scale(1.05);
}

/* Inquiry Setup Box */
.ue-chat-inquiry-setup {
	padding: 20px 24px;
	background: #FAFBFD;
	border-bottom: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	flex-shrink: 0;
	max-height: 48vh;
	overflow-y: auto;
}

.ue-chat-intro-card {
	background: rgba(0, 82, 255, 0.04);
	border: 1px solid rgba(0, 82, 255, 0.15);
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 16px;
}

.ue-chat-intro-title {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 700;
	color: var(--color-blue-ribbon, #0052ff);
	margin-bottom: 4px;
}

.ue-chat-intro-desc {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--color-shark-muted, #576275);
}

.ue-chat-form-row {
	margin-bottom: 14px;
}

.ue-chat-label {
	display: block;
	font-size: 11.5px;
	font-weight: 700;
	color: var(--color-shark, #15181e);
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ue-chat-input {
	width: 100%;
	padding: 10px 14px;
	background: #ffffff;
	border: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	border-radius: 10px;
	font-size: 13.5px;
	color: var(--color-shark, #15181e);
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ue-chat-input:focus {
	outline: none;
	border-color: var(--color-blue-ribbon, #0052ff);
	box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.12);
}

.ue-chat-selectors-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-bottom: 14px;
}

.ue-chat-pills-group {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ue-scope-pill {
	background: #ffffff;
	border: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	border-radius: 8px;
	padding: 6px 10px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--color-shark-muted, #576275);
	cursor: pointer;
	transition: all 0.18s ease;
}

.ue-scope-pill:hover {
	border-color: var(--color-blue-ribbon, #0052ff);
	color: var(--color-shark, #15181e);
}

.ue-scope-pill.is-active {
	background: rgba(0, 82, 255, 0.08);
	border-color: var(--color-blue-ribbon, #0052ff);
	color: var(--color-blue-ribbon, #0052ff);
	font-weight: 700;
}

.ue-chat-guest-fields {
	background: #ffffff;
	border: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	border-radius: 12px;
	padding: 14px;
	margin-top: 12px;
}

/* Conversation Stream */
.ue-chat-messages-stream {
	flex: 1;
	overflow-y: auto;
	padding: 20px 24px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: var(--color-bg, #f5f5f0);
}

.ue-chat-msg-row {
	display: flex;
	flex-direction: column;
	max-width: 85%;
}

.ue-chat-msg-row.is-self {
	align-self: flex-end;
	align-items: flex-end;
}

.ue-chat-msg-row.is-other {
	align-self: flex-start;
	align-items: flex-start;
}

.ue-chat-msg-header {
	font-size: 11px;
	font-weight: 600;
	color: var(--color-shark-muted, #576275);
	margin-bottom: 4px;
	font-variant-numeric: tabular-nums;
}

.ue-chat-bubble {
	padding: 12px 18px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.5;
	word-break: break-word;
	box-shadow: var(--shadow-sm, 0 2px 6px rgba(21, 24, 30, 0.04));
}

.ue-chat-msg-row.is-self .ue-chat-bubble {
	background: linear-gradient(135deg, #0052ff 0%, #003ecb 100%);
	color: #ffffff;
	border-bottom-right-radius: 4px;
}

.ue-chat-msg-row.is-other .ue-chat-bubble {
	background: #ffffff;
	color: var(--color-shark, #15181e);
	border: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	border-bottom-left-radius: 4px;
}

/* Footer & Input */
.ue-chat-footer {
	padding: 16px 24px 20px;
	background: #ffffff;
	border-top: 1px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	flex-shrink: 0;
	z-index: 2;
}

.ue-chat-input-bar {
	display: flex;
	gap: 10px;
	align-items: flex-end;
	background: #FAFBFD;
	border: 1.5px solid var(--color-ghost-border, rgba(200, 205, 216, 0.6));
	border-radius: 14px;
	padding: 6px 8px 6px 14px;
	transition: all 0.2s ease;
}

.ue-chat-input-bar:focus-within {
	border-color: var(--color-blue-ribbon, #0052ff);
	box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.12);
	background: #ffffff;
}

.ue-chat-textarea {
	flex: 1;
	border: none;
	background: transparent;
	padding: 6px 0;
	font-size: 13.5px;
	font-family: inherit;
	color: var(--color-shark, #15181e);
	resize: none;
	max-height: 120px;
	line-height: 1.4;
	box-sizing: border-box;
}

.ue-chat-textarea:focus {
	outline: none;
}

.ue-chat-send-btn {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(135deg, #0052ff 0%, #003ecb 100%);
	color: #ffffff;
	border: none;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	flex-shrink: 0;
}

.ue-chat-send-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(0, 82, 255, 0.4);
}

.ue-chat-send-btn:active {
	transform: scale(0.96);
}

.ue-chat-disclaimer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11px;
	color: var(--color-shark-muted, #576275);
	margin-top: 8px;
	padding: 0 4px;
}
