/* ==========================================================================
   MineTown - Live-Support-Chat
   Optik kommt aus style.css (card, card-header, popup-close, confirm-input-field,
   cookie-category/switch, btn, news-item, login-status, s1-label).
   Hier steht nur, was ein schwebendes Fenster zusätzlich braucht:
   Position, Größe, kompaktere Abstände.
   ========================================================================== */

#mt-chat [hidden] { display: none !important; }

/* Schwebender Button – identisch zum Cookie-Button (#manage-consent-tab) */
#mt-chat-btn {
	position: fixed;
	right: 24px;
	bottom: 96px;
	z-index: 2997;
	width: 56px;
	height: 56px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-primary);
	transition: var(--transition-ios);
}
#mt-chat-btn:hover { transform: scale(1.1); }
#mt-chat-btn svg { width: 30px; height: 30px; fill: #fff; }
#mt-chat.mt-chat-raised #mt-chat-btn { bottom: 168px; }

#mt-chat-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	box-sizing: border-box;
	border-radius: 11px;
	background: #ff4757;
	color: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 22px;
	text-align: center;
}

/* Fenster: .card aus dem Theme, nur fixiert */
#mt-chat-panel.card {
	position: fixed;
	right: 24px;
	bottom: 168px;
	z-index: 2998;
	width: 380px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 200px);
	margin: 0;
	display: flex;
	flex-direction: column;
	box-shadow: var(--glass-shadow-strong);
}
#mt-chat-panel.card:hover { transform: none; }
#mt-chat.mt-chat-raised #mt-chat-panel { bottom: 240px; max-height: calc(100vh - 272px); }

#mt-chat-panel .card-header { padding: 18px 64px 18px 20px; flex-shrink: 0; }
#mt-chat-panel .mt-chat-x {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 36px;
	height: 36px;
}

#mt-chat-panel .card-content {
	padding: 20px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 14px;
	position: relative;
	z-index: 2;
}
#mt-chat-panel .card-content > p { margin: 0; }

.mt-chat-field { display: flex; flex-direction: column; gap: 8px; }
#mt-chat .confirm-input-field { margin-top: 0; box-sizing: border-box; resize: none; }
#mt-chat .cookie-category { margin-top: 0; padding: 14px 16px; }
#mt-chat .cookie-category-header { gap: 16px; }
#mt-chat .switch { flex-shrink: 0; }
#mt-chat .login-status { margin: 0; }
#mt-chat .btn { width: 100%; max-width: none; }
.mt-chat-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Verlauf: news-item als Nachrichten */
.mt-chat-conv { display: flex; flex-direction: column; min-height: 0; flex: 1; position: relative; z-index: 2; }
#mt-chat .mt-chat-log {
	list-style: none;
	margin: 0;
	padding: 16px 20px;
	gap: 10px;
	flex: 1;
	min-height: 200px;
	overflow-y: auto;
}
#mt-chat .mt-chat-msg { padding: 10px 14px; max-width: 85%; }
#mt-chat .mt-chat-msg:hover { transform: none; box-shadow: none; }
#mt-chat .mt-chat-msg p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-chat-you { align-self: flex-end; border-color: var(--primary) !important; }
.mt-chat-team { align-self: flex-start; }

.mt-chat-send {
	display: flex;
	gap: 10px;
	align-items: stretch;
	padding: 14px 20px;
	border-top: 2px solid var(--glass-border);
}
.mt-chat-send .confirm-input-field { flex: 1; }
#mt-chat .mt-chat-send .btn { width: auto; padding: 0 18px; }
.mt-chat-conv .login-status { margin: 0 20px 10px !important; }
.mt-chat-endrow { margin: 0 0 12px; text-align: center; font-size: 13px; }

@media (max-width: 480px) {
	#mt-chat-panel.card {
		left: 16px;
		right: 16px;
		width: auto;
		max-width: none;
		bottom: 96px;
		max-height: calc(100vh - 120px);
	}
	#mt-chat.mt-chat-raised #mt-chat-panel { bottom: 96px; max-height: calc(100vh - 120px); }
	#mt-chat.mt-chat-open #mt-chat-btn { display: none; }
}
