/*
 * Metal Dreams Chat Assistant 1.0.0
 * White panel with red accents, matching the Metal Dreams site.
 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&display=swap');

#wca-chat-root {
	--wca-primary: #A30B21;
	--wca-dark: #FFFFFF;
	--wca-darker: #FAF6F5;
	--wca-raised: #F8F2F1;
	--wca-line: #EADFDC;
	--wca-text: #1A120C;
	--wca-muted: #6E625C;
	--wca-bottom: 20px;
	--wca-right: 20px;
	position: fixed;
	right: var(--wca-right);
	bottom: var(--wca-bottom);
	width: 84px;
	height: 60px;
	z-index: 999998;
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--wca-text);
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}
#wca-chat-root *,
#wca-chat-root *::before,
#wca-chat-root *::after {
	box-sizing: border-box;
}

/* Logo launcher: the logo alone, no background */
#wca-chat-root .wca-launcher {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 84px;
	height: 60px;
	padding: 0;
	margin: 0;
	border: none;
	background: transparent;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
#wca-chat-root .wca-launcher:hover {
	transform: translateY(-2px) scale(1.04);
}
#wca-chat-root .wca-launcher:focus-visible {
	outline: 2px solid var(--wca-primary);
	outline-offset: 4px;
	border-radius: 8px;
}
#wca-chat-root .wca-robot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
}
#wca-chat-root .wca-robot img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
}
#wca-chat-root .wca-robot.wca-logo-fallback {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--wca-primary);
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

/* Premium text box beside the logo */
#wca-chat-root .wca-greeting {
	position: absolute;
	right: 96px;
	bottom: 16px;
	display: inline-flex;
	align-items: center;
	gap: 9px;
	max-width: calc(100vw - 140px);
	white-space: nowrap;
	padding: 11px 20px 11px 16px;
	background: linear-gradient(180deg, #FFFFFF 0%, #FBF6F5 100%);
	color: var(--wca-text);
	font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	letter-spacing: 0.3px;
	border: 1px solid rgba(163, 11, 33, 0.35);
	border-radius: 999px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
	pointer-events: auto;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
#wca-chat-root .wca-greeting::before {
	content: "";
	flex-shrink: 0;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wca-primary);
	box-shadow: 0 0 0 3px rgba(163, 11, 33, 0.15);
}

/* Hidden while the chat is open */
#wca-chat-root.wca-open .wca-launcher,
#wca-chat-root.wca-open .wca-greeting {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.9);
}

/* Logo in the header and as a fallback */
#wca-chat-root .wca-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
}
#wca-chat-root .wca-logo img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	filter: brightness(0);
}
#wca-chat-root .wca-logo-fallback {
	background: var(--wca-primary);
	color: #ffffff;
	font-weight: 700;
	font-size: 13px;
	letter-spacing: 0.5px;
}

/* Chat window */
#wca-chat-root .wca-window {
	position: absolute;
	right: 0;
	bottom: 0;
	width: min(330px, calc(100vw - 40px));
	height: min(460px, calc(100vh - var(--wca-bottom) - 40px));
	min-height: 340px;
	display: flex;
	flex-direction: column;
	background: var(--wca-dark);
	border: 1px solid var(--wca-line);
	border-radius: 16px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px) scale(0.98);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}
#wca-chat-root .wca-window.wca-open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

/* Header */
#wca-chat-root .wca-header {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	padding: 12px 12px 12px 14px;
	background: var(--wca-darker);
	border-bottom: 2px solid var(--wca-primary);
}
#wca-chat-root .wca-head-text {
	flex: 1;
	min-width: 0;
}
#wca-chat-root .wca-title {
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: 0.2px;
	color: var(--wca-text);
	overflow-wrap: anywhere;
}
#wca-chat-root .wca-sub {
	font-size: 11.5px;
	color: var(--wca-muted);
	margin-top: 2px;
}
#wca-chat-root .wca-close {
	flex-shrink: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--wca-line);
	border-radius: 50%;
	background: transparent;
	color: var(--wca-text);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
#wca-chat-root .wca-close:hover {
	border-color: var(--wca-primary);
	background: rgba(163, 11, 33, 0.15);
}
#wca-chat-root .wca-close:focus-visible {
	outline: 2px solid var(--wca-primary);
	outline-offset: 2px;
}

/* Conversation */
#wca-chat-root .wca-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	padding: 12px;
	background: var(--wca-dark);
	display: flex;
	flex-direction: column;
	gap: 9px;
}
#wca-chat-root .wca-msg {
	max-width: 92%;
	padding: 8px 11px;
	border-radius: 12px;
	font-size: 12.5px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}
#wca-chat-root .wca-msg a {
	color: #A30B21;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-all;
}
#wca-chat-root .wca-msg-bot {
	align-self: flex-start;
	background: var(--wca-raised);
	color: var(--wca-text);
	border: 1px solid var(--wca-line);
	border-bottom-left-radius: 4px;
}
#wca-chat-root .wca-msg-bot strong {
	font-weight: 700;
}
#wca-chat-root .wca-msg-user {
	align-self: flex-end;
	background: var(--wca-primary);
	color: #ffffff;
	font-weight: 600;
	border-bottom-right-radius: 4px;
}
#wca-chat-root .wca-msg-typing {
	align-self: flex-start;
	display: inline-flex;
	gap: 4px;
	padding: 10px 12px;
	background: var(--wca-raised);
	border: 1px solid var(--wca-line);
	border-radius: 12px;
	border-bottom-left-radius: 4px;
}
#wca-chat-root .wca-msg-typing span {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wca-primary);
	opacity: 0.5;
	animation: wca-blink 1.2s infinite ease-in-out;
}
#wca-chat-root .wca-msg-typing span:nth-child(2) { animation-delay: 0.2s; }
#wca-chat-root .wca-msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes wca-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

/* Quick buttons: compact two-column grid */
#wca-chat-root .wca-quick {
	flex-shrink: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 5px;
	padding: 8px;
	background: var(--wca-darker);
	border-top: 1px solid var(--wca-line);
}
#wca-chat-root .wca-quick-btn {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 30px;
	margin: 0;
	padding: 5px 7px;
	background: var(--wca-raised);
	color: var(--wca-text);
	border: 1px solid var(--wca-line);
	border-radius: 9px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	text-align: left;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}
#wca-chat-root .wca-quick-btn::before {
	content: "";
	flex-shrink: 0;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--wca-primary);
}
#wca-chat-root .wca-quick-btn:hover {
	border-color: var(--wca-primary);
	background: #FBEFF0;
}
#wca-chat-root .wca-quick-btn:focus-visible {
	outline: 2px solid var(--wca-primary);
	outline-offset: 2px;
}
#wca-chat-root .wca-quick-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

/* Input row */
#wca-chat-root .wca-input-row {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	margin: 0;
	padding: 8px 10px 10px;
	background: var(--wca-darker);
	border-top: 1px solid var(--wca-line);
}
#wca-chat-root .wca-input {
	flex: 1;
	min-width: 0;
	height: 36px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid var(--wca-line);
	border-radius: 999px;
	background: var(--wca-raised);
	color: var(--wca-text);
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 500;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#wca-chat-root .wca-input::placeholder {
	color: #9A8E87;
}
#wca-chat-root .wca-input:hover {
	border-color: #C9B9B4;
}
#wca-chat-root .wca-input:focus {
	border-color: var(--wca-primary);
	box-shadow: 0 0 0 3px rgba(163, 11, 33, 0.25);
}
#wca-chat-root .wca-send {
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: var(--wca-primary);
	color: #ffffff;
	box-shadow: 0 6px 16px rgba(163, 11, 33, 0.4);
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
#wca-chat-root .wca-send:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(163, 11, 33, 0.55);
}
#wca-chat-root .wca-send:active {
	transform: translateY(0);
}
#wca-chat-root .wca-send:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
}
#wca-chat-root .wca-send:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Small screens */
@media (max-width: 480px) {
	#wca-chat-root .wca-greeting {
		white-space: normal;
		width: min(200px, calc(100vw - 120px));
		font-size: 13px;
		line-height: 1.35;
		padding: 9px 16px;
	}
	#wca-chat-root .wca-window {
		width: calc(100vw - 32px);
		right: 0;
	}
}
@media (max-width: 340px) {
	#wca-chat-root .wca-quick {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	#wca-chat-root *,
	#wca-chat-root *::before,
	#wca-chat-root *::after {
		transition: none !important;
		animation: none !important;
	}
}
