/* DSGVO Consent Manager – Frontend-Styles */

.dcm-root[data-dcm-hidden="true"] { display: none; }

.dcm-root {
	position: fixed;
	inset: 0;
	z-index: 999999;
	font-family: var(--dcm-font, inherit);
	color: var(--dcm-text, #2d2d2d);
	line-height: 1.5;
	font-size: 15px;
}

.dcm-overlay {
	position: fixed;
	inset: 0;
	background: var(--dcm-overlay, rgba(0,0,0,.6));
	animation: dcm-fade .2s ease;
}
.dcm-overlay[data-dcm-passive="1"] { pointer-events: none; }

@keyframes dcm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dcm-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

.dcm-banner {
	position: fixed;
	background: var(--dcm-bg, #fff);
	border-radius: var(--dcm-radius, 10px);
	box-shadow: 0 12px 40px rgba(0,0,0,.25);
	padding: 26px;
	max-width: 460px;
	width: calc(100% - 40px);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	animation: dcm-rise .25s ease;
	box-sizing: border-box;
}

/* Positionen */
.dcm-pos-bottom-left .dcm-banner  { bottom: 20px; left: 20px; }
.dcm-pos-bottom-right .dcm-banner { bottom: 20px; right: 20px; }
.dcm-pos-bottom .dcm-banner       { bottom: 20px; left: 50%; transform: translateX(-50%); }
.dcm-pos-top .dcm-banner          { top: 20px; left: 50%; transform: translateX(-50%); }

/* Layout: zentriert (Modal) */
.dcm-layout-center .dcm-banner {
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	max-width: 540px;
}

/* Layout: Balken über volle Breite */
.dcm-layout-bar .dcm-banner {
	left: 0; right: 0; bottom: 0;
	max-width: 100%;
	width: 100%;
	border-radius: 0;
	transform: none;
}

.dcm-banner__logo {
	max-height: 46px;
	width: auto;
	margin-bottom: 12px;
	display: block;
}
.dcm-banner__title {
	margin: 0 0 12px;
	font-size: 20px;
	font-weight: 700;
	color: var(--dcm-text, #2d2d2d);
}
/* Dienst-Umschalter in der Detailansicht */
.dcm-service__toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.dcm-switch--sm { width: 34px; height: 20px; }
.dcm-switch--sm::after { width: 14px; height: 14px; }
.dcm-service__toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.dcm-service__toggle input:checked + .dcm-switch { background: var(--dcm-primary, #1a73e8); }
.dcm-service__toggle input:checked + .dcm-switch--sm::after { transform: translateX(14px); }
.dcm-banner__desc {
	margin-bottom: 16px;
	font-size: 14px;
}
.dcm-banner__desc p { margin: 0 0 8px; }

.dcm-banner__links {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 18px;
	font-size: 13px;
}
.dcm-banner__links a,
.dcm-banner__desc a { color: var(--dcm-link, #1a73e8); }

/* Buttons */
.dcm-banner__actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}
.dcm-btn {
	border: 0;
	border-radius: calc(var(--dcm-radius, 10px) - 2px);
	padding: 11px 18px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.2;
	transition: filter .15s ease, background .15s ease;
}
.dcm-btn:hover { filter: brightness(.95); }
.dcm-btn:focus-visible { outline: 2px solid var(--dcm-primary, #1a73e8); outline-offset: 2px; }

.dcm-btn-primary   { background: var(--dcm-primary, #1a73e8); color: var(--dcm-primary-text, #fff); }
.dcm-btn-secondary { background: var(--dcm-secondary, #f1f3f4); color: var(--dcm-secondary-text, #2d2d2d); }
.dcm-btn-text      { background: transparent; color: var(--dcm-link, #1a73e8); padding-left: 4px; padding-right: 4px; }

/* Gleiche Gewichtung von Akzeptieren/Ablehnen (Empfehlung Datenschutzbehörden):
   gleiche Breite UND gleiche optische Prominenz (kein „Nudging"). „Ablehnen"
   wird als kräftiger, gut sichtbarer Button dargestellt – gleichwertig zu
   „Akzeptieren", nur in anderer Farbe zur Unterscheidung. */
.dcm-actions-equal .dcm-btn-secondary,
.dcm-actions-equal .dcm-btn-primary { flex: 1 1 auto; }
.dcm-actions-equal { justify-content: stretch; }
.dcm-actions-equal .dcm-btn-secondary {
	background: var(--dcm-decline, #1f2937);
	color: var(--dcm-decline-text, #ffffff);
	font-weight: 600;
}
/* „Akzeptieren" (mittlerer Button) darf dezent hervorstechen: etwas breiter,
   die dunklen Buttons minimal weicher. Bewusst zurückhaltend – „Ablehnen"
   bleibt gleich groß, voll lesbar und klar erreichbar (kein Dark Pattern). */
.dcm-actions-equal .dcm-btn-primary { flex-grow: 1.3; }
.dcm-actions-equal .dcm-btn-secondary { opacity: .9; }
.dcm-actions-equal .dcm-btn-secondary:hover { opacity: 1; }

/* Gruppen / Einstellungen */
.dcm-groups { margin: 4px 0 18px; }
.dcm-group {
	border: 1px solid rgba(0,0,0,.1);
	border-radius: 8px;
	padding: 11px 14px;
	margin-bottom: 8px;
}
.dcm-group__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}
.dcm-group__toggle {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-weight: 600;
}
.dcm-group__name { font-size: 15px; }
.dcm-group__head-aside { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.dcm-group__body { margin-top: 10px; }
.dcm-group__desc { font-size: 13px; margin: 0 0 10px; opacity: .85; line-height: 1.45; }
.dcm-always-active { font-size: 12px; opacity: .6; white-space: nowrap; }

/* Schalter */
.dcm-group__toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.dcm-switch {
	position: relative;
	width: 42px; height: 24px;
	background: #ccc;
	border-radius: 24px;
	transition: background .2s ease;
	flex: 0 0 auto;
}
.dcm-switch::after {
	content: '';
	position: absolute;
	top: 3px; left: 3px;
	width: 18px; height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform .2s ease;
}
.dcm-group__toggle input:checked + .dcm-switch { background: var(--dcm-primary, #1a73e8); }
.dcm-group__toggle input:checked + .dcm-switch::after { transform: translateX(18px); }
.dcm-group__toggle input:disabled + .dcm-switch { opacity: .6; cursor: not-allowed; }

.dcm-group__details-toggle {
	background: none; border: 0;
	color: var(--dcm-link, #1a73e8);
	cursor: pointer; font-size: 12.5px; font-weight: 600;
	padding: 0; font-family: inherit;
	display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
}
.dcm-dt-hide { display: none; }
.dcm-group.is-open > .dcm-group__head .dcm-group__details-toggle .dcm-dt-show { display: none; }
.dcm-group.is-open > .dcm-group__head .dcm-group__details-toggle .dcm-dt-hide { display: inline; }
.dcm-dt-chev { transition: transform .2s ease; font-size: 11px; }
.dcm-group.is-open > .dcm-group__head .dcm-group__details-toggle .dcm-dt-chev { transform: rotate(180deg); }
/* Dienste sichtbar als "Kinder" der Gruppe einrücken. */
.dcm-group__services {
	margin-top: 10px;
	margin-left: 14px;
	padding-left: 14px;
	border-left: 2px solid rgba(0,0,0,.10);
}
.dcm-service {
	border-top: 1px dashed rgba(0,0,0,.12);
	padding-top: 10px; margin-top: 10px;
}
.dcm-service:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
/* Pro-Dienst Details-Umschalter (standardmäßig eingeklappt). */
.dcm-service__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dcm-service__details-toggle {
	background: none; border: 0; color: var(--dcm-link, #1a73e8);
	cursor: pointer; font-size: 12px; font-weight: 600; padding: 0; font-family: inherit;
	display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex: 0 0 auto;
}
.dcm-service.is-open .dcm-service__details-toggle .dcm-dt-show { display: none; }
.dcm-service.is-open .dcm-service__details-toggle .dcm-dt-hide { display: inline; }
.dcm-service.is-open .dcm-service__details-toggle .dcm-dt-chev { transform: rotate(180deg); }
.dcm-service__details { margin-top: 8px; }
.dcm-service__table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.dcm-service__table th { text-align: left; padding: 3px 8px 3px 0; vertical-align: top; white-space: nowrap; opacity: .7; font-weight: 600; }
.dcm-service__table td { padding: 3px 0; word-break: break-word; }

/* Schwebender Badge */
.dcm-badge {
	position: fixed;
	bottom: 18px; left: 18px;
	z-index: 999998;
	width: 44px; height: 44px;
	border-radius: 50%;
	border: 0;
	background: var(--dcm-primary, #1a73e8);
	color: var(--dcm-primary-text, #fff);
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.25);
	display: flex; align-items: center; justify-content: center;
	transition: transform .15s ease;
}
.dcm-badge:hover { transform: scale(1.08); }

/* Content-Blocker (Embed-Platzhalter) */
.dcm-content-blocker {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
	background: #f3f4f6;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	padding: 24px;
	text-align: center;
	box-sizing: border-box;
}
.dcm-content-blocker__inner { max-width: 480px; }
.dcm-content-blocker__title { font-weight: 700; margin: 0 0 8px; font-size: 16px; }
.dcm-content-blocker__text { font-size: 13.5px; margin: 0 0 14px; opacity: .85; }
.dcm-content-blocker__btn {
	background: var(--dcm-primary, #1a73e8);
	color: var(--dcm-primary-text, #fff);
	border: 0; border-radius: 6px;
	padding: 10px 18px; font-weight: 600;
	cursor: pointer; font-size: 14px;
}
.dcm-content-blocker__always {
	display: block;
	margin-top: 12px;
	font-size: 12px;
	opacity: .8;
	cursor: pointer;
}
.dcm-embed-loaded { width: 100%; }

/* Scrollsperre, solange Banner blockierend offen ist */
html.dcm-open { overflow: hidden; }

/* Mobile */
@media (max-width: 600px) {
	.dcm-banner {
		left: 0 !important; right: 0 !important; bottom: 0 !important;
		top: auto !important;
		transform: none !important;
		width: 100%; max-width: 100%;
		border-bottom-left-radius: 0; border-bottom-right-radius: 0;
		max-height: 85vh;
	}
	.dcm-banner__actions { flex-direction: column; align-items: stretch; }
	.dcm-btn { width: 100%; }
	.dcm-banner { padding: 18px; }
	.dcm-group { padding: 10px 12px; margin-bottom: 7px; }
	.dcm-group__name { font-size: 14px; }
	.dcm-group__desc { font-size: 12.5px; }
	.dcm-banner__desc { font-size: 13px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.dcm-banner, .dcm-overlay { animation: none; }
}

/* Content-Blocker: aufklappbare Datenschutz-Infos */
.dcm-content-blocker__info { margin-top: 12px; text-align: left; font-size: 13px; }
.dcm-content-blocker__info > summary { cursor: pointer; color: var(--dcm-link, #1a73e8); font-weight: 600; text-align: center; list-style: none; }
.dcm-content-blocker__info > summary::-webkit-details-marker { display: none; }
.dcm-content-blocker__info > summary::after { content: " ▾"; }
.dcm-content-blocker__info[open] > summary::after { content: " ▴"; }
.dcm-cb-info { margin-top: 10px; display: grid; gap: 6px; }
.dcm-cb-info__row { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: start; }
.dcm-cb-info__k { color: #64748b; font-weight: 600; }
.dcm-cb-info__v { word-break: break-word; }
.dcm-cb-info__cookies { margin: 0; padding-left: 16px; }
.dcm-cb-info__cookies li { margin: 2px 0; }
@media (max-width: 480px) { .dcm-cb-info__row { grid-template-columns: 1fr; gap: 1px; } }
