/**
 * Consent-Banner, Platzhalter und Einstellungs-Dialog.
 *
 * Farben über Branding-Variablen (Firmen-Branding), Fallback Standard.
 */

/* --- Banner (dezente Karte unten rechts, blockiert nichts) --- */

.ms-consent-banner {
	position: fixed;
	right: 24px;
	bottom: 24px;
	left: 24px;
	z-index: 99998;
	display: flex;
	justify-content: flex-end;
	pointer-events: none;
}

.ms-consent-banner-card {
	pointer-events: auto;
	max-width: 420px;
	padding: 24px;
	border-radius: 14px;
	background: #ffffff;
	box-shadow: 0 12px 40px rgba(31, 45, 61, 0.18);
	border-top: 4px solid var(--main-color, #37b6ae);
	animation: ms-consent-slide-in 0.35s ease-out;
}

@keyframes ms-consent-slide-in {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ms-consent-banner-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	color: #1f2d3d;
}

.ms-consent-banner-text {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: #4a5568;
}

.ms-consent-banner-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

/* --- Buttons --- */

.ms-consent-btn {
	margin: 0;
	padding: 10px 20px;
	border: 0;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ms-consent-btn-primary {
	background: var(--main-color, #37b6ae);
	color: #ffffff;
}

.ms-consent-btn-primary:hover,
.ms-consent-btn-primary:focus {
	background: var(--hover-color, #2f8f88);
	color: #ffffff;
}

.ms-consent-btn-secondary {
	background: #ffffff;
	color: var(--main-color, #37b6ae);
	box-shadow: inset 0 0 0 2px var(--main-color, #37b6ae);
}

.ms-consent-btn-secondary:hover,
.ms-consent-btn-secondary:focus {
	background: var(--main-color, #37b6ae);
	color: #ffffff;
}

.ms-consent-btn-link {
	padding: 10px 6px;
	background: transparent;
	color: #4a5568;
	text-decoration: underline;
	font-weight: 500;
}

.ms-consent-btn-link:hover,
.ms-consent-btn-link:focus {
	color: var(--main-color, #37b6ae);
}

/* --- Floating-Button (Widerruf/Einstellungen) ---
   Unten rechts: unten links liegen bereits Lehrerzimmer-Links. */

.ms-consent-reopen {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99997;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ffffff;
	color: var(--main-color, #37b6ae);
	box-shadow: 0 4px 16px rgba(31, 45, 61, 0.2);
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.ms-consent-reopen:hover,
.ms-consent-reopen:focus {
	opacity: 1;
	transform: scale(1.06);
}

/* --- Zwei-Klick-Platzhalter für externe Videos --- */

.ms-consent-placeholder {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	background: linear-gradient(135deg, #263238 0%, #37474f 100%);
	color: #ffffff;
	overflow: hidden;
}

.ms-consent-placeholder-inner {
	max-width: 480px;
	padding: 24px;
	text-align: center;
}

.ms-consent-placeholder-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin-bottom: 12px;
	border-radius: 50%;
	background: var(--main-color, #37b6ae);
	color: #ffffff;
}

.ms-consent-placeholder-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 700;
	color: #ffffff;
}

.ms-consent-placeholder-text {
	margin: 0 0 16px;
	font-size: 13px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.85);
}

.ms-consent-placeholder-text a {
	color: #ffffff;
	text-decoration: underline;
}

.ms-consent-placeholder-load {
	margin: 0;
	padding: 12px 28px;
	border: 0;
	border-radius: 999px;
	background: var(--main-color, #37b6ae);
	color: #ffffff;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ms-consent-placeholder-load:hover,
.ms-consent-placeholder-load:focus {
	background: var(--hover-color, #2f8f88);
}

/* --- Einstellungs-Dialog (Inhalt im msModal) --- */

/* Modal-Header einheitlich in Markenfarbe, Titel und Schließen-Kreuz in Weiß.
   Doppelte Deklaration + !important: Die msModal-Basis-Styles werden per JS
   injiziert und setzen die Farbe ohne Fallback – ausgeloggt fehlt die
   Branding-Variable, daher hier garantierter Festwert als erste Stufe. */
.ms-consent-modal .ms-mitarbeiter-modal-header {
	background-color: #37b6ae !important;
	background-color: var(--main-color, #37b6ae) !important;
	border-bottom: 0 !important;
}

.ms-consent-modal .ms-mitarbeiter-modal-title {
	color: #ffffff !important;
}

.ms-consent-modal .ms-mitarbeiter-modal-close {
	color: #ffffff !important;
}

.ms-consent-modal-intro {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.55;
	color: #4a5568;
}

.ms-consent-category {
	padding: 14px 16px;
	margin-bottom: 10px;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}

.ms-consent-category-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.ms-consent-category-label {
	font-size: 15px;
	font-weight: 700;
	color: #1f2d3d;
}

.ms-consent-category-desc {
	margin: 8px 0 0;
	font-size: 13px;
	line-height: 1.5;
	color: #4a5568;
}

.ms-consent-category-services {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	font-size: 12px;
	color: #718096;
}

.ms-consent-category-services a {
	color: inherit;
	text-decoration: underline;
}

/* Schalter (Checkbox als Toggle) */

.ms-consent-toggle {
	position: relative;
	display: inline-block;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
}

/* Native Checkbox vollständig neutralisieren – Theme-/LearnDash-Styles
   machen disabled-Checkboxen sonst wieder sichtbar. */
.ms-consent-toggle input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	opacity: 0 !important;
	cursor: pointer;
}

.ms-consent-toggle input:disabled {
	cursor: not-allowed;
}

.ms-consent-toggle-slider {
	position: absolute;
	inset: 0;
	border-radius: 24px;
	background: #cbd5e0;
	transition: background-color 0.2s ease;
	pointer-events: none;
}

.ms-consent-toggle-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #ffffff;
	transition: transform 0.2s ease;
}

.ms-consent-toggle input:checked + .ms-consent-toggle-slider {
	background: var(--main-color, #37b6ae);
}

.ms-consent-toggle input:checked + .ms-consent-toggle-slider::before {
	transform: translateX(20px);
}

.ms-consent-toggle input:disabled + .ms-consent-toggle-slider {
	opacity: 0.55;
	cursor: not-allowed;
}

.ms-consent-modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 16px;
}

/* --- Mobile --- */

@media (max-width: 600px) {
	.ms-consent-banner {
		right: 12px;
		bottom: 12px;
		left: 12px;
	}

	.ms-consent-banner-card {
		max-width: none;
		padding: 18px;
	}

	.ms-consent-banner-actions .ms-consent-btn {
		flex: 1 1 auto;
		text-align: center;
	}

	.ms-consent-placeholder {
		aspect-ratio: auto;
		min-height: 260px;
	}
}
