/* ============================================================
   ChinaDeals – Frontend (Deal-Dashboard) & Admin Styles
   ============================================================ */

/* ---------- Frontend Dashboard ---------- */
.cd-dashboard {
	--cd-accent: #2563eb;
	--cd-border: #e5e7eb;
	--cd-muted: #6b7280;
	--cd-text: #111827;
	max-width: 920px;
	margin: 0 auto;
	color: var(--cd-text);
	font-size: 16px;
	line-height: 1.55;
}
.cd-dashboard * { box-sizing: border-box; }

/* Kopfzeile: Begrüßung + Sprache + Logout */
.cd-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	padding-bottom: 18px;
	margin-bottom: 22px;
	border-bottom: 1px solid var(--cd-border);
}
.cd-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
}
.cd-topbar-right {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.cd-lang-switch {
	display: inline-flex;
	border: 1px solid var(--cd-border);
	border-radius: 8px;
	overflow: hidden;
}
.cd-lang-btn {
	display: inline-block;
	padding: 6px 12px;
	font-size: 13px;
	color: #374151;
	text-decoration: none;
	background: #fff;
	border: 0;
	border-left: 1px solid var(--cd-border);
	cursor: pointer;
	line-height: 1.4;
}
.cd-lang-switch .cd-lang-btn:first-child { border-left: 0; }
.cd-lang-btn:hover { background: #f3f4f6; }
.cd-lang-btn.is-active {
	background: var(--cd-accent);
	color: #fff;
	font-weight: 600;
}
.cd-logout {
	font-size: 13px;
	color: var(--cd-muted);
	text-decoration: none;
	white-space: nowrap;
}
.cd-logout:hover { color: #b91c1c; text-decoration: underline; }

/* Tab-Navigation */
.cd-tabnav {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	border-bottom: 2px solid var(--cd-border);
	margin: 18px 0 22px;
}
.cd-tabnav a {
	padding: 10px 16px;
	text-decoration: none;
	color: #374151;
	font-weight: 600;
	font-size: 15px;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
}
.cd-tabnav a:hover { color: var(--cd-accent); }
.cd-tabnav a.is-active { color: var(--cd-accent); border-bottom-color: var(--cd-accent); }
.cd-panel { display: none; } /* JS zeigt das aktive Panel; <noscript> blendet alle ein */
.cd-panel:first-of-type { display: block; } /* Fallback: erstes Panel sichtbar, falls JS spät lädt */

/* Überschriften der Abschnitte */
.cd-dashboard h3 {
	font-size: 18px;
	font-weight: 600;
	margin: 30px 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid #f1f5f9;
}

/* Guthaben-Karte mit Dealgott (Zahl auf dem Schild) */
.cd-balance-card {
	background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
	color: #0f172a;
	border: 1px solid #bfdbfe;
	border-radius: 14px;
	padding: 22px 24px 24px;
	text-align: center;
	box-shadow: 0 6px 20px rgba(30, 58, 138, .10);
}
.cd-balance-label {
	display: block;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .12em;
	color: #1d4ed8;
	font-weight: 600;
}
.cd-balance-figure {
	position: relative;
	display: inline-block;
	width: 260px;
	max-width: 78%;
	margin: 8px auto 0;
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .14);
}
.cd-balance-figure .cd-god {
	display: block;
	width: 100%;
	height: auto;
}
/* Zahl mittig auf dem leeren Schild des Gottes */
.cd-balance-number {
	position: absolute;
	left: 50%;
	top: 60.5%;
	transform: translate(-50%, -50%);
	font-size: clamp(34px, 14vw, 60px);
	font-weight: 800;
	line-height: 1;
	color: #1e3a8a;
	letter-spacing: -.02em;
	text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
	pointer-events: none;
}
.cd-balance-card.is-negative .cd-balance-number { color: #b91c1c; }
.cd-balance-low {
	color: #b45309;
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: 500;
}

/* Kampagnen-Banner */
.cd-campaign-banner {
	background: #fff7ed;
	border: 1px solid #fdba74;
	color: #9a3412;
	border-radius: 10px;
	padding: 12px 16px;
	margin-top: 18px;
	font-size: 15px;
}

/* Pakete */
.cd-packages {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 250px, 1fr ) );
	gap: 16px;
}
.cd-package {
	border: 1px solid var(--cd-border);
	border-radius: 12px;
	padding: 18px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0,0,0,.05);
	transition: box-shadow .15s ease;
	display: flex;
	flex-direction: column;
}
.cd-package:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.cd-package-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}
.cd-package-name { font-weight: 700; font-size: 17px; }
.cd-package-deals {
	background: #eef2ff;
	color: #3730a3;
	border-radius: 999px;
	padding: 3px 12px;
	font-size: 13px;
	font-weight: 600;
}
.cd-package-save {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 10px;
}
.cd-package-orig { font-size: 13px; color: var(--cd-muted); }
.cd-package-orig s { color: var(--cd-muted); }
.cd-save-badge {
	background: #dcfce7;
	color: #166534;
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 700;
}
.cd-package-prices {
	font-size: 14px;
	margin-bottom: auto; /* schiebt die Kauf-Buttons aller Karten nach unten (bündig) */
	color: #334155;
}
.cd-package-prices > div { padding: 2px 0; }
.cd-per-deal { color: var(--cd-muted); font-size: 13px; }
.cd-discount {
	color: #059669;
	font-weight: 700;
	font-size: 12px;
}
.cd-surcharge {
	color: #b45309;
	font-weight: 700;
	font-size: 12px;
}
.cd-paypal-buttons { margin-bottom: 8px; }

/* Buttons */
.cd-btn {
	display: inline-block;
	border: 0;
	border-radius: 9px;
	padding: 11px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	width: 100%;
	text-align: center;
	transition: background .15s ease;
}
.cd-btn-bank { background: #f1f5f9; color: #0f172a; }
.cd-btn-bank:hover { background: #e2e8f0; }
.cd-btn-primary { background: var(--cd-accent); color: #fff; width: auto; margin-top: 12px; }
.cd-btn-primary:hover { background: #1d4ed8; }
.cd-btn-primary[disabled] { background: #9ca3af; cursor: not-allowed; }

/* Einreichungs-Formular */
.cd-submit-form {
	background: #fff;
	border: 1px solid var(--cd-border);
	border-radius: 12px;
	padding: 18px 20px 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.cd-submit-form textarea,
.cd-deal-row textarea {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 9px;
	padding: 12px;
	font-family: inherit;
	font-size: 15px;
	resize: vertical;
}
.cd-submit-form textarea:focus,
.cd-deal-row textarea:focus {
	outline: none;
	border-color: var(--cd-accent);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}
.cd-deal-row {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin-bottom: 10px;
}
.cd-deal-row textarea { flex: 1; }
.cd-remove-deal {
	border: 1px solid #cbd5e1;
	background: #fff;
	color: #b91c1c;
	border-radius: 9px;
	width: 40px;
	min-height: 40px;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	flex-shrink: 0;
}
.cd-remove-deal:hover { background: #fee2e2; }
.cd-deal-total {
	margin-left: 12px;
	font-size: 14px;
	color: #334155;
	font-weight: 600;
}
.cd-hint { color: var(--cd-muted); font-size: 14px; margin: 0 0 12px; }

/* Vorab-Kampagnen-Markierung im Einreichungsformular */
.cd-campaign-flag {
	background: #fff7ed;
	border: 1px solid #fdba74;
	color: #9a3412;
	border-radius: 10px;
	padding: 10px 14px;
	margin: 0 0 14px;
	font-size: 14px;
}
.cd-campaign-flag label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

/* Bank-Box */
.cd-bank-box {
	position: relative;
	border: 1px solid #bae6fd;
	background: #f0f9ff;
	border-radius: 12px;
	padding: 18px 20px;
	margin-top: 20px;
}
.cd-bank-close {
	position: absolute;
	top: 8px;
	right: 12px;
	width: 28px;
	height: 28px;
	line-height: 26px;
	text-align: center;
	border-radius: 8px;
	color: var(--cd-muted);
	text-decoration: none;
	font-size: 22px;
	font-weight: 700;
}
.cd-bank-close:hover { background: #e0f2fe; color: #b91c1c; }
.cd-bank-box h3 { border: 0; margin-top: 0; }
.cd-bank-box table { width: 100%; border-collapse: collapse; }
.cd-bank-box th {
	text-align: left;
	width: 190px;
	padding: 6px 8px 6px 0;
	color: #475569;
	font-weight: 500;
	vertical-align: top;
}
.cd-bank-box td { padding: 6px 0; }

/* Tabellen (Historie) */
.cd-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 8px;
	font-size: 14px;
	background: #fff;
	border: 1px solid var(--cd-border);
	border-radius: 10px;
	overflow: hidden;
}
.cd-table thead th {
	background: #f8fafc;
	font-weight: 600;
	text-align: left;
}
.cd-table th, .cd-table td {
	border-bottom: 1px solid var(--cd-border);
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
}
.cd-table tbody tr:last-child td { border-bottom: 0; }
.cd-content-box {
	white-space: pre-wrap;
	word-break: break-word;
	max-width: 420px;
}
/* Links in den Dashboard-Tabellen klar als Links erkennbar machen */
.cd-dashboard .cd-table a,
.cd-dashboard .cd-content-box a {
	color: var(--cd-accent);
	text-decoration: underline;
	font-weight: 500;
	word-break: break-all;
}
.cd-dashboard .cd-table a:hover,
.cd-dashboard .cd-content-box a:hover { color: #1d4ed8; }

/* Kompaktere Dashboard-Tabellen */
.cd-dashboard .cd-table th,
.cd-dashboard .cd-table td { padding: 8px 10px; font-size: 14px; }

/* Aufklappbare Deal-Details (schlanke Zeilen) */
.cd-details > summary {
	cursor: pointer;
	font-size: 14px;
	color: var(--cd-text);
	list-style: none;
	line-height: 1.35;
}
.cd-details > summary::-webkit-details-marker { display: none; }
.cd-details > summary::before { content: "\25B8\00A0"; color: var(--cd-muted); }
.cd-details[open] > summary::before { content: "\25BE\00A0"; }
.cd-details > summary:hover { color: var(--cd-accent); }
.cd-details .cd-content-box { margin-top: 8px; font-size: 13px; color: var(--cd-muted); }

/* CSV-Download-Knopf über der Tabelle */
.cd-table-tools { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: 0 0 10px; }
.cd-perpage { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--cd-muted); }
.cd-perpage select {
	border: 1px solid var(--cd-border);
	border-radius: 8px;
	padding: 6px 8px;
	font-size: 14px;
	background: #fff;
	cursor: pointer;
}
.cd-btn-csv {
	display: inline-block;
	background: #f1f5f9;
	color: #0f172a;
	border: 1px solid var(--cd-border);
	border-radius: 9px;
	padding: 7px 14px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.cd-btn-csv:hover { background: #e2e8f0; }

/* Hinweise / Meldungen */
.cd-notice {
	border-radius: 10px;
	padding: 12px 16px;
	margin-bottom: 18px;
	font-size: 15px;
}
.cd-notice-ok { background: #dcfce7; color: #166534; }
.cd-notice-err { background: #fee2e2; color: #991b1b; }
.cd-reason { color: #b91c1c; }

.cd-pager {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 4px 0 18px;
	font-size: 14px;
}
.cd-pager a { color: var(--cd-accent); text-decoration: none; font-weight: 600; }
.cd-pager a:hover { text-decoration: underline; }
.cd-pager span { color: var(--cd-muted); }

/* Gast-Ansicht (Login) */
.cd-guest { max-width: 420px; }
.cd-guest-forgot { margin: 12px 0 0; font-size: 14px; }
.cd-guest-forgot a { color: var(--cd-accent); text-decoration: underline; }
.cd-guest-partner {
	margin: 18px 0 0;
	padding-top: 14px;
	border-top: 1px solid var(--cd-border);
	font-size: 14px;
	color: var(--cd-muted);
}
.cd-guest-partner a { color: var(--cd-accent); text-decoration: underline; }
.cd-guest-top { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.cd-guest-intro { font-size: 16px; color: var(--cd-text); margin: 0 0 14px; }
.cd-guest .login-username label,
.cd-guest .login-password label { display: block; font-weight: 600; margin-bottom: 4px; }
.cd-guest .login-username input,
.cd-guest .login-password input {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 9px;
	padding: 10px 12px;
	font-size: 15px;
	margin-bottom: 12px;
}
.cd-guest .login-remember { display: block; margin-bottom: 12px; font-size: 14px; color: var(--cd-muted); }
.cd-guest .button-primary,
.cd-guest #wp-submit {
	background: var(--cd-accent);
	border: 0;
	color: #fff;
	border-radius: 9px;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.cd-guest .button-primary:hover,
.cd-guest #wp-submit:hover { background: #1d4ed8; }

/* Front-End-Auth-Formulare (Login / Passwort vergessen / Passwort setzen) */
.cd-auth-form p { margin: 0 0 12px; }
.cd-auth-form label { display: block; font-weight: 600; margin-bottom: 4px; }
.cd-auth-form input[type="text"],
.cd-auth-form input[type="password"] {
	width: 100%;
	border: 1px solid #cbd5e1;
	border-radius: 9px;
	padding: 10px 12px;
	font-size: 15px;
}
.cd-auth-remember { font-weight: 400 !important; font-size: 14px; color: var(--cd-muted); }
.cd-auth-remember input { width: auto; margin-right: 6px; }
.cd-btn-primary {
	background: var(--cd-accent);
	border: 0;
	color: #fff;
	border-radius: 9px;
	padding: 10px 18px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.cd-btn-primary:hover { background: #1d4ed8; }
.cd-auth-error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 8px;
	padding: 8px 12px;
	margin: 0 0 12px;
	font-size: 14px;
}
.cd-auth-ok {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
	border-radius: 8px;
	padding: 8px 12px;
	margin: 0 0 12px;
	font-size: 14px;
}

/* ---------- Status-Badges (geteilt) ---------- */
.cd-status {
	display: inline-block;
	border-radius: 999px;
	padding: 3px 10px;
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
}
.cd-status-submitted { background: #fef9c3; color: #854d0e; }
.cd-status-published { background: #dcfce7; color: #166534; }
.cd-status-rejected  { background: #fee2e2; color: #991b1b; }
.cd-status-pending   { background: #fef9c3; color: #854d0e; }
.cd-status-paid      { background: #dcfce7; color: #166534; }

/* ---------- Admin ---------- */
.cd-wrap .cd-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 8px 16px;
	margin-bottom: 16px;
	max-width: 760px;
}
.cd-wrap .cd-inline label { margin-right: 12px; }
.cd-wrap .cd-balance { color: #2563eb; }
.cd-action-form { display: flex; gap: 6px; margin-bottom: 6px; }
.cd-action-form input[type="url"],
.cd-action-form input[type="text"] { min-width: 220px; }
.cd-claim { color: #9a3412; }

/* Doppelten Theme-Seitentitel auf der Dashboard-Seite ausblenden */
.cd-hide-page-title .entry-title,
.cd-hide-page-title .page-title,
.cd-hide-page-title h1.entry-title,
.cd-hide-page-title .wp-block-post-title {
	display: none !important;
}

/* ---------- Responsiv ---------- */
@media ( max-width: 600px ) {
	.cd-balance-number { font-size: 52px; }
	.cd-topbar { flex-direction: column; align-items: flex-start; }
	.cd-content-box { max-width: 100%; }
}
