/**
 * Chatbot UI Stylesheet
 * LAAW AI Legal Assistant
 */

/* Floating Launcher Button */
.laaw-chat-launcher {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999990;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 24px;
	background: #C08C50;
	color: #000000;
	border: 1px solid rgba(192, 140, 80, 0.5);
	border-radius: 9999px;
	font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 8px 30px rgba(192, 140, 80, 0.35);
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.laaw-chat-launcher:hover {
	background: #D49D5E;
	transform: translateY(-3px);
	box-shadow: 0 12px 35px rgba(192, 140, 80, 0.5);
}

.laaw-chat-launcher__icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Chat Drawer Outer Backdrop Container */
.laaw-chat-widget {
	position: fixed;
	top: 32px;
	bottom: 32px;
	left: 32px;
	right: 32px;
	width: auto !important;
	height: auto !important;
	max-width: none !important;
	max-height: none !important;
	z-index: 999995;
	display: flex;
	visibility: hidden;
	opacity: 0;
	transform: translateY(20px) scale(0.98);
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
	pointer-events: none;
}

.laaw-chat-widget.is-open {
	visibility: visible;
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
}

.laaw-chat-container {
	display: flex;
	width: 100%;
	height: 100%;
	background: #0A0E1A;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(192, 140, 80, 0.15);
}

/* Left Sidebar */
.laaw-chat-sidebar {
	width: 270px;
	min-width: 270px;
	background: #0D111E;
	border-right: 1px solid rgba(255, 255, 255, 0.08);
	display: flex;
	flex-direction: column;
	min-height: 0;
	height: 100%;
}

.laaw-sidebar-header {
	padding: 20px 16px 14px;
	flex-shrink: 0;
}

.laaw-btn-new-chat {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 18px;
	background: #C08C50;
	color: #000000;
	border: none;
	border-radius: 9999px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.laaw-btn-new-chat:hover {
	background: #D49D5E;
	box-shadow: 0 4px 15px rgba(192, 140, 80, 0.3);
}

.laaw-sidebar-search {
	padding: 0 16px 16px;
	flex-shrink: 0;
}

.laaw-search-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.laaw-search-icon {
	position: absolute;
	left: 12px;
	color: #64748B;
}

.laaw-search-input-wrapper input {
	width: 100%;
	padding: 10px 12px 10px 36px;
	background: #141723;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	color: #FFFFFF;
	font-size: 13px;
	outline: none;
	transition: border-color 0.2s;
}

.laaw-search-input-wrapper input:focus {
	border-color: rgba(192, 140, 80, 0.5);
}

.laaw-sidebar-content {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	min-height: 0;
	overflow-y: auto;
	flex-direction: column;
}

.laaw-sidebar-empty-state {
	text-align: center;
}

.laaw-empty-icon {
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748B;
}

.laaw-empty-title {
	font-size: 15px;
	font-weight: 600;
	color: #C08C50;
	margin-bottom: 6px;
}

.laaw-empty-sub {
	font-size: 13px;
	color: #64748B;
	margin: 0;
}

/* Right Main Workspace */
.laaw-chat-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: #0A0E1A;
	position: relative;
	overflow: hidden;
	min-height: 0;
	height: 100%;
}

.laaw-chat-authenticated-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	width: 100%;
	height: calc(100% - 70px);
	overflow: hidden;
}

/* Header */
.laaw-chat-header {
	height: 70px;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #0D111E;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	flex-shrink: 0;
}

.laaw-chat-header__info {
	display: flex;
	align-items: center;
	gap: 12px;
}

.laaw-assistant-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #C08C50;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 0 15px rgba(192, 140, 80, 0.3);
}

.laaw-chat-header__title {
	font-size: 16px;
	font-weight: 700;
	color: #FFFFFF;
	margin: 0 0 2px 0;
}

.laaw-chat-header__status {
	font-size: 12px;
	color: #94A3B8;
	display: flex;
	align-items: center;
	gap: 6px;
}

.laaw-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #10B981;
	box-shadow: 0 0 8px #10B981;
}

.laaw-chat-header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
}

.laaw-btn-escalate-header {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 18px;
	background: #C08C50;
	color: #000000;
	border: none;
	border-radius: 9999px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
}

.laaw-btn-escalate-header:hover {
	background: #D49D5E;
	transform: translateY(-1px);
}

.laaw-chat-close-btn {
	background: transparent;
	border: none;
	color: #94A3B8;
	cursor: pointer;
	padding: 6px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.laaw-chat-close-btn:hover {
	color: #FFFFFF;
	background: rgba(255, 255, 255, 0.1);
}

/* Scrollable Conversation Body */
.laaw-chat-body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-height: 0;
	scroll-behavior: smooth;
}

.laaw-chat-widget *,
.laaw-chat-widget {
	scrollbar-width: thin;
	scrollbar-color: rgba(192, 140, 80, 0.35) transparent;
}

.laaw-chat-widget *::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

.laaw-chat-widget *::-webkit-scrollbar-track {
	background: transparent;
}

.laaw-chat-widget *::-webkit-scrollbar-thumb {
	background: rgba(192, 140, 80, 0.3);
	border-radius: 9999px;
}

.laaw-chat-widget *::-webkit-scrollbar-thumb:hover {
	background: rgba(192, 140, 80, 0.6);
}

.laaw-chat-widget *::-webkit-scrollbar-button {
	display: none;
	width: 0;
	height: 0;
}

.laaw-chat-messages {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Messages */
.laaw-message {
	display: flex;
	gap: 12px;
	max-width: 85%;
	animation: laawFadeIn 0.25s ease-out;
}

@keyframes laawFadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.laaw-message--assistant {
	align-self: flex-start;
}

.laaw-message--user {
	align-self: flex-end;
	flex-direction: row-reverse;
}

.laaw-message__avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: rgba(192, 140, 80, 0.15);
	border: 1px solid rgba(192, 140, 80, 0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.laaw-message__content {
	background: #141723;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 0 16px 16px 16px;
	padding: 16px 20px;
	color: #FFFFFF;
	font-size: 14.5px;
	line-height: 1.6;
}

.laaw-message--user .laaw-message__content {
	background: rgba(192, 140, 80, 0.2);
	border-color: rgba(192, 140, 80, 0.4);
	border-radius: 16px 16px 0 16px;
	color: #FFFFFF;
}

.laaw-message__content p {
	margin: 0 0 12px 0;
}

.laaw-message__content p:last-child {
	margin-bottom: 0;
}

.laaw-message__content h1,
.laaw-message__content h2,
.laaw-message__content h3,
.laaw-message__content h4,
.laaw-message__content h5 {
	font-size: 15px !important;
	font-weight: 700 !important;
	color: #FFFFFF !important;
	margin: 10px 0 6px 0 !important;
	line-height: 1.35 !important;
	display: block !important;
}

.laaw-message__content h1:first-child,
.laaw-message__content h2:first-child,
.laaw-message__content h3:first-child,
.laaw-message__content h4:first-child,
.laaw-message__content h5:first-child {
	margin-top: 0 !important;
}

.laaw-message__content img.emoji {
	width: 1.25em !important;
	height: 1.25em !important;
	vertical-align: -0.2em !important;
	display: inline !important;
}

.laaw-message__content ul,
.laaw-message__content ol {
	margin: 8px 0 12px 20px;
	padding: 0;
}

.laaw-message__content li {
	margin-bottom: 4px;
}

.laaw-message__content a {
	color: #C08C50;
	text-decoration: underline;
}

/* Disclaimer Box Card */
.laaw-disclaimer-card {
	background: #111522;
	border: 1px solid rgba(192, 140, 80, 0.3);
	border-radius: 14px;
	padding: 16px 20px;
	margin-top: 4px;

}

.laaw-disclaimer-card__header {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.laaw-disclaimer-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	background: rgba(192, 140, 80, 0.2);
	color: #C08C50;
	border-radius: 50%;
	font-size: 12px;
	font-weight: bold;
	flex-shrink: 0;
	margin-top: 2px;
}

.laaw-disclaimer-card__text {
	font-size: 13px;
	color: #94A3B8;
	line-height: 1.5;
	margin: 0;
}

.laaw-disclaimer-card__action {
	margin-top: 14px;
	display: flex;
}

.laaw-btn-disclaimer-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: rgba(192, 140, 80, 0.1);
	color: #C08C50;
	border: 1px solid rgba(192, 140, 80, 0.4);
	border-radius: 9999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.laaw-btn-disclaimer-cta:hover {
	background: #C08C50;
	color: #000000;
}

/* Typing Loading Dots */
.laaw-typing-indicator {
	display: flex;
	align-items: center;
	gap: 12px;
	align-self: flex-start;
}

.laaw-typing-dots {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #141723;
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 0 16px 16px 16px;
	padding: 14px 20px;
}

.laaw-typing-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #C08C50;
	animation: laawPulse 1.4s infinite ease-in-out both;
}

.laaw-typing-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.laaw-typing-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes laawPulse {

	0%,
	80%,
	100% {
		transform: scale(0.6);
		opacity: 0.4;
	}

	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Inline Attorney Escalation Button */
.laaw-btn-escalate-cta {
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	background: #C08C50;
	color: #000000 !important;
	border: 1px solid #C08C50;
	border-radius: 20px;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 4px 12px rgba(192, 140, 80, 0.25);
}

.laaw-btn-escalate-cta:hover {
	background: #D49D5E;
	border-color: #D49D5E;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(192, 140, 80, 0.35);
}

/* Suggestion Quick Pills */
.laaw-chat-suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 24px 12px;
	flex-shrink: 0;
}

.laaw-suggestion-pill {
	background: #141723;
	color: #CBD5E1;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 9999px;
	padding: 7px 15px;
	font-size: 13px;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.laaw-suggestion-pill:hover {
	border-color: #C08C50;
	color: #C08C50;
	background: rgba(192, 140, 80, 0.1);
}

/* Chat Input Footer */
.laaw-chat-footer {
	padding: 12px 24px 16px;
	background: #0A0E1A;
	flex-shrink: 0;
	position: relative;
	z-index: 10;
	margin-top: auto;
}

.laaw-chat-input-box {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #141723;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	padding: 8px 12px 8px 18px;
	transition: border-color 0.2s ease;
}

.laaw-chat-input-box:focus-within {
	border-color: rgba(192, 140, 80, 0.6);
	box-shadow: 0 0 15px rgba(192, 140, 80, 0.15);
}

.laaw-chat-input-box textarea {
	flex: 1;
	background: transparent;
	border: none;
	outline: none;
	color: #FFFFFF;
	font-size: 14.5px;
	line-height: 1.4;
	max-height: 100px;
	resize: none;
}

.laaw-chat-input-box textarea::placeholder {
	color: #64748B;
}

.laaw-chat-send-btn {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: #C08C50;
	color: #000000;
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: all 0.2s ease;
	padding: 0 !important;
}

.laaw-chat-send-btn:hover {
	background: #D49D5E !important;
	transform: scale(1.05);
}

.laaw-chat-disclaimer-note {
	font-size: 11px;
	color: #64748B;
	text-align: center;
	margin-top: 8px;
}

/* Authenticated View Container */
.laaw-chat-authenticated-view {
	flex: 1;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

/* Authentication Gate Overlay */
.laaw-auth-gate {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 30px 20px;
	background: #0A0E1A;
}

.laaw-auth-gate__card {
	max-width: 440px;
	width: 100%;
	background: #141723;
	border: 1px solid rgba(192, 140, 80, 0.35);
	border-radius: 18px;
	padding: 36px 28px;
	text-align: center;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.laaw-auth-gate__icon-badge {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: rgba(192, 140, 80, 0.15);
	border: 1px solid rgba(192, 140, 80, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.laaw-auth-gate__title {
	font-size: 20px;
	font-weight: 700;
	color: #FFFFFF;
	margin: 0 0 10px 0;
}

.laaw-auth-gate__description {
	font-size: 14px;
	color: #94A3B8;
	line-height: 1.6;
	margin: 0 0 24px 0;
}

.laaw-auth-gate__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.laaw-btn-auth-login {
	width: 100%;
	padding: 13px;
	background: #C08C50;
	color: #000000 !important;
	border-radius: 9999px;
	font-weight: 700;
	font-size: 14.5px;
	text-align: center;
	transition: all 0.2s ease;
}

.laaw-btn-auth-login:hover {
	background: #D49D5E;
	transform: translateY(-1px);
}

.laaw-btn-auth-register {
	width: 100%;
	padding: 12px;
	background: rgba(192, 140, 80, 0.1);
	color: #C08C50 !important;
	border: 1px solid rgba(192, 140, 80, 0.4);
	border-radius: 9999px;
	font-weight: 600;
	font-size: 14px;
	text-align: center;
	transition: all 0.2s ease;
}

.laaw-btn-auth-register:hover {
	background: #C08C50;
	color: #000000 !important;
}

/* History List Sidebar Stream */
.laaw-history-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	overflow-y: auto;
	max-height: 100%;
	padding-right: 4px;
}

.laaw-history-item {
	display: flex;
	flex-direction: column;
	padding: 12px 14px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	text-align: left;
	transition: all 0.2s ease;
	width: 100%;
}

.laaw-history-item:hover {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.08);
}

.laaw-history-item.is-active {
	background: rgba(192, 140, 80, 0.15);
	border-color: rgba(192, 140, 80, 0.4);
}

.laaw-history-item__title {
	font-size: 13.5px;
	font-weight: 600;
	color: #FFFFFF;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 4px;
}

.laaw-history-item.is-active .laaw-history-item__title {
	color: #C08C50;
}

.laaw-history-item__date {
	font-size: 11.5px;
	color: #64748B;
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 2px;
}

.laaw-history-item__date {
	display: flex;
	flex-direction: column;
	gap: 5px;
	text-align: left;
	align-items: flex-start;
}

.laaw-history-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 7px;
	background: rgba(192, 140, 80, 0.15);
	color: #C08C50;
	border: 1px solid rgba(192, 140, 80, 0.35);
	border-radius: 9999px;
	font-size: 10px;
	font-weight: 700;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
	.laaw-chat-widget {
		top: 8px !important;
		bottom: 8px !important;
		left: 8px !important;
		right: 8px !important;
		width: auto !important;
		height: auto !important;
		max-width: none !important;
		max-height: none !important;
	}

	.laaw-chat-container {
		border-radius: 16px;
		border: 1px solid rgba(255, 255, 255, 0.12);
	}

	.laaw-chat-sidebar {
		display: none;
		/* Hide history sidebar on small screens */
	}

	.laaw-chat-header {
		padding: 0 14px;
	}

	.laaw-chat-header__title {
		font-size: 13.5px;
	}

	.laaw-btn-escalate-header span {
		display: none;
		/* Hide label text, show icon on small screens */
	}

	.laaw-chat-body {
		padding: 14px 12px;
		-webkit-overflow-scrolling: touch;
	}

	.laaw-chat-message__bubble {
		max-width: 88% !important;
		font-size: 13.5px !important;
		padding: 12px 14px !important;
	}

	.laaw-chat-footer {
		padding: 10px 12px 12px;
	}

	/* CRITICAL: Prevent iOS Safari WebKit Auto-Zoom on Input Focus */
	.laaw-chat-input textarea,
	.laaw-chat-widget input,
	.laaw-chat-widget textarea,
	.laaw-chat-widget select {
		font-size: 16px !important;
		/* Forces 16px minimum font-size on mobile to disable iOS viewport auto-zoom on focus */
	}
}

@media (max-width: 480px) {
	.laaw-chat-launcher {
		bottom: calc(14px + env(safe-area-inset-bottom, 0px));
		right: 14px;
		padding: 10px 16px;
		font-size: 13.5px;
	}

	.laaw-chat-widget {
		top: 0 !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
	}

	.laaw-chat-container {
		border-radius: 0 !important;
		border: none !important;
	}
}