/* ============================================================
   DW Netzwerkkarte – Frontend Styles
   All colours are driven by CSS custom properties so CI
   adjustments only require overriding variables.
   ============================================================ */

/* ---- Root tokens ---- */
.dwnk-wrapper {
	--dwnk-chart-bg:       #f3f0e3;
	--dwnk-color-stark:    #3c9267;
	--dwnk-color-mittel:   #68ac6e;
	--dwnk-color-schwach:  #b8b953;
	--dwnk-dark:           #1a2744;
	--dwnk-green-panel:    #7cd799;
	--dwnk-radius-card:    20px;
	--dwnk-sidebar-width:  33%;
	--dwnk-font:           inherit;
	--dwnk-einrichtung-font-size: 1.8rem;   /* Org-Name im Kreismittelpunkt */
	--dwnk-stakeholder-font-size: 1.5rem;  /* Stakeholder-Karten­name */
	--dwnk-font-label:     1.4rem;         /* Quadranten-/Bereichsbezeichnungen */
	--dwnk-font-heading:   1.7rem;           /* Formular-Überschriften */
	--dwnk-font-input:     1.6rem;         /* Eingabefelder, Labels, Fließtext */
	--dwnk-font-btn:       1.6rem;         /* Alle Schaltflächen */
	--dwnk-font-small:     1.2rem;         /* Karten-Aktionsbuttons */
	--dwnk-font-mobile:    1.8rem;         /* Mobile Buttons */

	display: flex;
	gap: 24px;
	align-items: flex-start;
	font-family: var(--dwnk-font);
	box-sizing: border-box;
}

/* ============================================================
   CHART AREA
   ============================================================ */

.dwnk-chart-area {
	flex: 1;
	min-width: 0;
}

.dwnk-chart {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background-color: var(--dwnk-chart-bg);
	overflow: hidden;
	border-radius: 4px;
	touch-action: none; /* needed for pointer events drag */
}

/* ---- Crosshair ---- */
.dwnk-crosshair-h,
.dwnk-crosshair-v {
	position: absolute;
	background: var(--var-blau);
	pointer-events: none;
	z-index: 2;
}

.dwnk-crosshair-h {
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	transform: translateY(-50%);
}

.dwnk-crosshair-v {
	left: 50%;
	top: 0;
	bottom: 0;
	width: 1px;
	transform: translateX(-50%);
}

/* ---- Circles ---- */
.dwnk-circle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	pointer-events: none;
	z-index: 1;
}

.dwnk-circle-schwach {
	width: 96%;
	aspect-ratio: 1;
	background-color: var(--dwnk-color-schwach);
}

.dwnk-circle-mittel {
	width: 66%;
	aspect-ratio: 1;
	background-color: var(--dwnk-color-mittel);
}

.dwnk-circle-stark {
	width: 36%;
	aspect-ratio: 1;
	background-color: var(--dwnk-color-stark);
}

/* ---- Centre element ---- */
.dwnk-center {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: var(--dwnk-dark);
	color: #fff;
	padding: 7px 18px;
	border-radius: 24px;
	font-weight: 700;
	text-transform: uppercase;
	font-size: var(--var-einrichtung-font-size);
	letter-spacing: 0.08em;
	cursor: pointer;
	z-index: 10;
	white-space: nowrap;
	user-select: none;
	outline: none;
	border: none;
	min-width: 60px;
	text-align: center;
}

.dwnk-center[contenteditable='true'] {
	outline: 2px solid rgba(255, 255, 255, 0.7);
	outline-offset: 2px;
	cursor: text;
}

/* ---- Section labels in corners ---- */
.dwnk-section-label {
	position: absolute;
	font-size: 1.5rem;
	
	max-width: 200px;
	line-height: 1.25;
	z-index: 3;
	pointer-events: none;
	
	letter-spacing: 0.03em;

    font-family: 'Outfit';
    font-weight: 700;
    line-height: 1.5em;
    letter-spacing: 0.02em;
    color: var(--var-blau);

}

.dwnk-label-tl { top: 8px;  left: 8px; }
.dwnk-label-tr { top: 8px;  right: 8px; text-align: right; }
.dwnk-label-bl { bottom: 8px; left: 8px; }
.dwnk-label-br { bottom: 8px; right: 8px; text-align: right; }

/* ============================================================
   STAKEHOLDER CARDS
   ============================================================ */

.dwnk-card {
	position: absolute;
	background: #fff;
	border: 2px solid var(--dwnk-dark);
	border-radius: var(--dwnk-radius-card);
	padding: 5px 14px;
	font-size: var(--var-stakeholder-font-size);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--dwnk-dark);
	cursor: grab;
	z-index: 20;
	user-select: none;
	transform: translate(-50%, -50%);
	white-space: normal;
	text-align: center;
	transition: box-shadow 0.15s, border-radius 0.2s;
	box-sizing: border-box;
	line-height: 1.3;
}

.dwnk-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.dwnk-card.is-dragging {
	cursor: grabbing;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
	z-index: 50;
	opacity: 0.9;
}

.dwnk-card.is-expanded {
	border-radius: 12px;
	padding: 12px 14px;
	min-width: 180px;
	max-width: 220px;
	z-index: 30;
	cursor: default;
	text-align: left;
}

/* Card name row */
.dwnk-card-name {
	display: flex;
	align-items: center;
	gap: 6px;
}

.dwnk-card-intensity-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* Details (hidden until expanded) */
.dwnk-card-details {
	display: none;
	margin-top: 8px;
	font-size: var(--dwnk-font-label);
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: #333;
	line-height: 1.5;
}

.dwnk-card.is-expanded .dwnk-card-details {
	display: block;
}

.dwnk-card-details p {
	margin: 2px 0;
}

.dwnk-card-details .dwnk-detail-notiz {
	color: #555;
	font-style: italic;
	margin-top: 4px;
}

/* Action buttons */
.dwnk-card-actions {
	display: none;
	gap: 12px;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid #eee;
}

.dwnk-card.is-expanded .dwnk-card-actions {
	display: flex;
}

.dwnk-card-btn {
	font-size: var(--dwnk-font-small);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--dwnk-dark);
	padding: 0;
	font-weight: 700;
}

.dwnk-card-btn:hover {
	text-decoration: underline;
}

.dwnk-card-btn--delete {
	color: #c0392b;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.dwnk-modal-close:focus{
	border:none !important;
	position: absolute;
}

.dwnk-sidebar {
	width: var(--dwnk-sidebar-width);
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* ---- Form panel ---- */
.dwnk-form-panel, .dwnk-save-section {
	background: var(--dwnk-green-panel);
	border-radius: 12px;
	padding: 22px 20px;
	color: var(--dwnk-dark);
}

.dwnk-form-panel h3, .dwnk-save-section h3 {
	font-size: 2.5rem;
	font-family: 'Literata';
	font-weight: 700;
	margin: 0 0 14px;
	color: var(--var-blau);
}

.dwnk-form-panel input[type='text'],
.dwnk-form-panel textarea, .dwnk-save-section input[type='text'], .dwnk-save-section textarea {
	display: block;
	width: 100%;
	border: none;
	border-radius: 24px;
	padding: 9px 16px;
	font-size: var(--dwnk-font-input);
	background: #fff;
	color: var(--dwnk-dark);
	margin-bottom: 9px;
	box-sizing: border-box;
	outline: none;
	font-family: var(--dwnk-font);
}

.dwnk-form-panel textarea, .dwnk-save-section textarea {
	border-radius: 12px;
	min-height: 88px;
	resize: vertical;
	line-height: 1.5;
}

.dwnk-form-panel input[type='text']::placeholder,
.dwnk-form-panel textarea::placeholder,
.dwnk-save-section input[type='text']::placeholder,
.dwnk-save-section textarea::placeholder {
	color: var(--var-blau);
}

.dwnk-form-panel--modal input[type='text'],
.dwnk-form-panel--modal textarea {
	background: #f7f7f7;
	border: 1px solid #e0e0e0;
}

.dwnk-intensity-label {
	display: block;
	font-size: 2rem;
	font-family: 'Outfit';
	font-weight: normal;
	margin-bottom: 0;
}

.dwnk-intensity-options {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	line-height: 1;
	margin-bottom:20px;
}

.dwnk-intensity-option {
	display: flex;
	align-items: center;
	gap: 5px;
	cursor: pointer;
	font-size: 2rem;
	font-family: 'Outfit';
	font-weight: normal;
}

.dwnk-submit-btn {
	display: block;
	width: 100%;
	background: var(--dwnk-dark);
	color: #fff;
	border: none;
	border-radius: 24px;
	padding: 11px 16px;
	font-size: var(--dwnk-font-btn);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	cursor: pointer;
	font-family: var(--dwnk-font);
	transition: background 0.15s;
	max-width: 50%;
}

.dwnk-submit-btn:hover {
	background: #2a3a60;
	border:none !important;
}

/* ---- Save section ---- */
.xxxdwnk-save-section {
	background: #f5f5f5;
	border-radius: 8px;
	padding: 14px 16px;
}

.dwnk-guest-notice {
	font-size: var(--dwnk-font-input);
	color: #555;
	line-height: 1.5;
	margin: 0;
}

.dwnk-guest-notice a {
	color: var(--dwnk-dark);
	font-weight: 700;
}

/* Logged-in save UI */
.dwnk-user-save {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dwnk-user-save label {
	font-size: var(--dwnk-font-input);
	font-weight: normal;
	color: var(--var-blau);
	line-height:1;
}

.dwnk-map-name-input,
.dwnk-maps-dropdown {
	width: 100%;
	border: 1px solid #ddd;
	border-radius: 100px;
	padding: 8px 12px;
	font-size: var(--dwnk-font-input);
	box-sizing: border-box;
	font-family: var(--dwnk-font);
	background: #fff;
}

.dwnk-user-save-row {
	display: flex;
	gap: 8px;
	margin-bottom:10px;
}

.dwnk-save-btn {
	flex: 1;
	background: var(--var-creme);
	color: var(--var-blau);
	border: none;
	border-radius: 100px;
	padding: 8px 12px;
	font-size: var(--dwnk-font-btn);
	font-weight: 700;
	cursor: pointer;
	font-family: var(--dwnk-font);
}

.dwnk-save-btn:hover, 
.dwnk-save-btn:focus,
.dwnk-new-btn:hover,
.dwnk-new-btn:focus
{
	background: var(--var-blau);
	color: white;
}

.dwnk-new-btn {
	background: var(--var-creme);
	color: var(--var-blau);
	border: 1px solid var(--var-creme);
	border-radius: 100px;
	padding: 8px 12px;
	font-size: var(--dwnk-font-btn);
	font-weight: 600;
	cursor: pointer;
	font-family: var(--dwnk-font);
}

/* ---- PDF section ---- */
.dwnk-pdf-section {
	margin-top: 0;
}

.dwnk-info-section{
	margin-bottom:20px;
}

.dwnk-instructions{
	font-size:1.5rem;
	line-height:1.5;
}

.dwnk-instructions li{
	margin-bottom:5px;
}

.dwnk-pdf-btn {
	flex: 1;
	background: var(--var-violett);
	color: var(--var-blau);
	border: none;
	border-radius: 100px;
	padding: 8px 12px;
	font-size: var(--dwnk-font-btn);
	font-weight: 700;
	cursor: pointer;
	font-family: var(--dwnk-font);
}

.dwnk-pdf-btn--full {
	display: block;
	width: 100%;
}

.dwnk-pdf-btn:hover {
	background: var(--var-blau);
	color:white;
	border:none !important;
}

/* ============================================================
   MOBILE ADD BUTTON
   ============================================================ */

.dwnk-mobile-add-btn {
	display: none; /* shown via media query */
}

/* ============================================================
   MOBILE PDF BUTTON
   ============================================================ */

.dwnk-mobile-pdf-btn {
	display: none; /* shown via media query */
}

/* ============================================================
   MODAL OVERLAY
   ============================================================ */

.dwnk-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99998;
	justify-content: center;
	align-items: center;
	padding: 16px;
	box-sizing: border-box;
}

.dwnk-modal-overlay.is-open {
	display: flex;
}

.dwnk-modal {
	background: #fff;
	border-radius: 14px;
	padding: 24px 20px;
	width: 100%;
	max-width: 420px;
	max-height: 92vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.dwnk-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: #777;
	padding: 0;
}

.dwnk-modal-close:hover {
	color: #333;
}

/* ---- Modal form panel overrides ---- */
.dwnk-form-panel--modal {
	background: transparent;
	padding: 0;
}

/* ============================================================
   EDIT MODAL (dynamically created by JS)
   ============================================================ */

#dwnk-edit-modal .dwnk-modal h3 {
	margin-top: 0;
	color: var(--dwnk-dark);
	font-size: 3rem;
}

.dwnk-edit-field {
	display: block;
	width: 100%;
	border: 1px solid #ddd;
	border-radius: 8px;
	padding: 9px 12px;
	font-size: 2rem !important;
	margin-bottom: 9px;
	box-sizing: border-box;
	font-family: inherit;
	background: #fff;
}

.dwnk-edit-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}

.dwnk-edit-submit {
	/* Hardcoded because this element is appended to <body>,
	   outside .dwnk-wrapper where the CSS variable is defined. */
	background: #1a2744;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 20px;
	cursor: pointer;
	font-size: 1.6rem;
	font-weight: 700;
	font-family: inherit;
	flex: 1;
	transition: background 0.15s;
}

.dwnk-edit-submit:hover {
	background: #2a3a60;
}

.dwnk-edit-cancel {
	background: #e8e8e8;
	color: #1a2744;
	border: 1px solid #ccc;
	border-radius: 6px;
	padding: 10px 16px;
	cursor: pointer;
	font-size: 1.6rem;
	font-weight: 600;
	font-family: inherit;
	transition: background 0.15s;
}

.dwnk-edit-cancel:hover {
	background: #ddd;
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */

#dwnk-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--dwnk-dark);
	color: #fff;
	padding: 10px 22px;
	border-radius: 8px;
	font-size: 1.7rem;
	z-index: 99999;
	pointer-events: none;
	transition: opacity 0.35s;
	white-space: nowrap;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
	.dwnk-wrapper {
		flex-direction: column;
		gap: 16px;
	}

	/* align-items: flex-start würde in column-Richtung die Breite auf 0 kollabieren lassen */
	.dwnk-chart-area {
		width: 100%;
	}

	.dwnk-sidebar {
		width: 100%;
	}

	.dwnk-sidebar .dwnk-form-panel {
		display: none; /* replaced by mobile modal */
	}

	.dwnk-mobile-add-btn {
		display: block;
		width: 100%;
		background: var(--dwnk-green-panel);
		color: var(--dwnk-dark);
		border: none;
		border-radius: 24px;
		padding: 12px 16px;
		font-size: var(--dwnk-font-mobile);
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.06em;
		cursor: pointer;
		font-family: var(--dwnk-font);
		margin-top: 4px;
	}

	.dwnk-mobile-pdf-btn {
		display: block;
		width: 100%;
		background: #e8e8e8;
		color: var(--dwnk-dark);
		border: 1px solid #ccc;
		border-radius: 24px;
		padding: 11px 16px;
		font-size: var(--dwnk-font-mobile);
		font-weight: 600;
		cursor: pointer;
		font-family: var(--dwnk-font);
		margin-top: 8px;
	}

	/* Also show PDF button below chart on mobile */
	.dwnk-pdf-section {
		display: block;
	}

	.dwnk-submit-btn{
		max-width: auto;
	}
}
