/*
 * Techmart-only skin for the external <app-widget> chat.
 * Loaded inside the widget shadow root from helpers/chat_widget.php.
 * Selectors follow the widget's public class names. Inline ngStyle colors
 * are overridden with !important so this layer can restyle them.
 */

.chat-fab-wrap {
	padding: 22px;
	margin: -22px;
}

.chat-fab.shadow {
	position: relative;
	width: 60px;
	height: 60px;
	background: #ed1c24 !important;
	color: #fff !important;
	border: 0 !important;
	box-shadow:
		0 14px 34px -10px rgba(237, 28, 36, 0.72),
		0 8px 20px rgba(15, 23, 42, 0.16) !important;
	animation: techmart-chat-breathe 2.8s ease-in-out infinite;
}

.chat-fab::before,
.chat-fab::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 1.5px solid #ed1c24;
	opacity: 0;
	pointer-events: none;
	animation: techmart-chat-ping 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.chat-fab::after {
	animation-delay: 1.3s;
}

.chat-fab-logo {
	width: 40px;
	height: 40px;
}

@keyframes techmart-chat-breathe {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.06);
	}
}

@keyframes techmart-chat-ping {
	0% {
		opacity: 0.6;
		transform: scale(1);
	}
	100% {
		opacity: 0;
		transform: scale(1.7);
	}
}

.chat-panel.card {
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(226, 230, 236, 0.12) 100%),
		rgba(236, 239, 243, 0.78) !important;
	-webkit-backdrop-filter: blur(20px) saturate(1.35);
	backdrop-filter: blur(20px) saturate(1.35);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.7),
		inset 0 0 0 1px rgba(255, 255, 255, 0.35),
		0 16px 32px -8px rgba(15, 23, 42, 0.28),
		0 42px 80px -16px rgba(15, 23, 42, 0.46) !important;
	animation: techmart-chat-open-right 0.65s cubic-bezier(0.65, 0, 0.35, 1) backwards;
}

.chat-panel.rounded-4 {
	border-radius: 28px !important;
}

:host([position="bottom-left"]) .chat-panel.card,
:host([position="top-left"]) .chat-panel.card {
	animation-name: techmart-chat-open-left;
}

@keyframes techmart-chat-open-right {
	from {
		clip-path: circle(0px at 100% 100%);
	}
	to {
		clip-path: circle(1200px at 100% 100%);
	}
}

@keyframes techmart-chat-open-left {
	from {
		clip-path: circle(0px at 0% 100%);
	}
	to {
		clip-path: circle(1200px at 0% 100%);
	}
}

.chat-widget.is-expanded-fullscreen .chat-panel.card,
.chat-widget.container-mode .chat-panel.card {
	animation: none;
	clip-path: none;
	border-radius: 0 !important;
	background: #fff !important;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

.chat-panel .card-header {
	background: transparent !important;
	color: #16161a !important;
	border-bottom: 1px solid rgba(18, 18, 28, 0.08) !important;
	padding: 14px 14px 12px !important;
}

.chat-panel .card-header.rounded-top-4 {
	border-top-left-radius: 28px !important;
	border-top-right-radius: 28px !important;
}

.chat-panel .card-header img {
	width: 28px !important;
	height: 28px !important;
	padding: 4px;
	border-radius: 50% !important;
	background: #ed1c24;
	object-fit: contain;
}

.chat-header-title {
	color: #16161a !important;
	font-weight: 700;
	letter-spacing: -0.02em;
}

.chat-panel .header-actions .btn:not(.new-chat-btn) {
	width: 32px;
	height: 32px;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: rgba(18, 18, 28, 0.06) !important;
	color: #16161a !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.chat-panel .chat-body {
	background: transparent !important;
	color: #16161a !important;
	font-size: 14px;
}

.chat-panel .bot-message-bubble,
.chat-panel .user-message-bubble,
.chat-empty-state,
.chat-composer-input.form-control,
.chat-send-btn {
	font-size: 14px;
}

.chat-empty-state {
	color: #16161a;
	font-weight: 600;
	letter-spacing: -0.03em;
}

.chat-panel .user-message-bubble.rounded-4 {
	border-radius: 18px 18px 4px 18px !important;
	background: #ed1c24 !important;
	box-shadow: 0 10px 18px -12px rgba(237, 28, 36, 0.9);
}

.chat-panel .bot-message-bubble.rounded-4 {
	border-radius: 18px 18px 18px 4px !important;
	background: rgba(255, 255, 255, 0.94) !important;
	color: #16161a !important;
	box-shadow: inset 0 0 0 1px rgba(18, 18, 28, 0.08);
}

.chat-panel .card-footer {
	background: transparent !important;
	border-top: 1px solid rgba(18, 18, 28, 0.08) !important;
}

.chat-panel .card-footer.rounded-bottom-4 {
	border-bottom-left-radius: 28px !important;
	border-bottom-right-radius: 28px !important;
}

.chat-composer-input.form-control {
	border: 1px solid rgba(18, 18, 28, 0.12) !important;
	border-radius: 999px !important;
	background: rgba(255, 255, 255, 0.78) !important;
	box-shadow: none;
	min-height: 46px;
	padding-left: 16px;
	padding-right: 16px;
}

.chat-composer-input.form-control:focus {
	border-color: rgba(237, 28, 36, 0.45) !important;
	box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.14);
	outline: none;
}

.chat-send-btn {
	background: #ed1c24 !important;
	border: 0 !important;
	color: #fff !important;
	border-radius: 999px !important;
	min-height: 40px;
	font-weight: 600;
}

.chat-footer-meta,
.widget-brand {
	display: flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: auto !important;
	overflow: visible !important;
	clip-path: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.chat-fab.shadow,
	.chat-fab::before,
	.chat-fab::after,
	.chat-panel.card {
		animation: none;
	}

	.chat-panel.card {
		clip-path: none;
	}
}
