/**
 * Styling untuk Creatoku Donation Plugin
 * Scoped under .cd-donation-wrap to prevent theme conflicts
 */

.cd-donation-wrap {
	--cd-primary: #0E4D3C;
	--cd-primary-dark: #0A3A2D;
	--cd-accent: #C9A227;
	--cd-accent-light: #E4C860;
	--cd-bg: #F6F5EF;
	--cd-surface: #FFFFFF;
	--cd-surface-alt: #E9EFE9;
	--cd-text: #16241D;
	--cd-text-muted: #5B6B62;
	--cd-success: #2E7D4F;
	--cd-pending: #B8860B;
	--cd-danger: #C1442E;
	--cd-line: #DDE3DA;

	font-family: 'Manrope', sans-serif;
	color: var(--cd-text);
	line-height: 1.55;
	background: var(--cd-bg);
	padding-bottom: 40px;
}

.cd-donation-wrap * {
	box-sizing: border-box;
}

.cd-donation-wrap h1,
.cd-donation-wrap h2,
.cd-donation-wrap .cd-hero-title,
.cd-donation-wrap .cd-collected {
	font-family: 'Fraunces', serif;
}

/* Lattice Divider */
.cd-lattice-divider {
	height: 14px;
	background-image:
		linear-gradient(45deg, transparent 45%, var(--cd-line) 45%, var(--cd-line) 55%, transparent 55%),
		linear-gradient(-45deg, transparent 45%, var(--cd-line) 45%, var(--cd-line) 55%, transparent 55%);
	background-size: 14px 14px;
	background-repeat: repeat-x;
	background-position: center;
	opacity: .6;
	margin: 20px 0;
}

/* Top bar */
.cd-topbar {
	background: var(--cd-primary);
	color: #fff;
	padding: 14px 24px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.cd-topbar .cd-brand {
	font-family: 'Fraunces', serif;
	font-weight: 600;
	font-size: 20px;
	letter-spacing: .3px;
}
.cd-topbar .cd-brand span {
	color: var(--cd-accent-light);
}
.cd-topbar nav {
	display: flex;
	gap: 24px;
	font-size: 14px;
	font-weight: 500;
	opacity: .9;
}
.cd-topbar nav a {
	color: #fff;
	text-decoration: none;
}
.cd-topbar nav a:hover {
	color: var(--cd-accent-light);
}

/* Hero */
.cd-hero {
	position: relative;
	background: linear-gradient(180deg, var(--cd-primary-dark), var(--cd-primary));
	color: #fff;
}
.cd-hero-img {
	height: 280px;
	background:
		radial-gradient(circle at 20% 30%, rgba(201,162,39,.35), transparent 45%),
		linear-gradient(120deg, #0A3A2D, #0E4D3C 60%, #123f31);
	position: relative;
	display: flex;
	align-items: flex-end;
}
.cd-hero-img::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(circle, rgba(255,255,255,.08) 1.5px, transparent 1.5px);
	background-size: 22px 22px;
}
.cd-hero-badges {
	padding: 20px 24px;
	position: relative;
	z-index: 1;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.cd-badge {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .4px;
	text-transform: uppercase;
	padding: 5px 12px;
	border-radius: 100px;
	display: inline-block;
}
.cd-badge-cat {
	background: var(--cd-accent);
	color: var(--cd-primary-dark);
}
.cd-badge-urgent {
	background: rgba(255,255,255,.15);
	color: #fff;
	border: 1px solid rgba(255,255,255,.3);
}

.cd-hero-title-wrap {
	background: var(--cd-primary-dark);
	padding: 20px 24px 28px;
}
.cd-hero-title {
	font-size: 26px;
	font-weight: 600;
	max-width: 640px;
	margin: 0;
}
.cd-hero-meta {
	margin-top: 10px;
	font-size: 13px;
	color: rgba(255,255,255,.7);
}

/* Layout */
.cd-container {
	max-width: 1080px;
	margin: 0 auto;
	padding: 28px 20px 60px;
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 28px;
}
@media(max-width:860px){
	.cd-container {
		grid-template-columns: 1fr;
	}
}

.cd-card {
	background: var(--cd-surface);
	border: 1px solid var(--cd-line);
	border-radius: 14px;
	padding: 22px;
	margin-bottom: 18px;
}
.cd-card:last-child {
	margin-bottom: 0;
}

.cd-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--cd-line);
	margin-bottom: 16px;
}
.cd-tab {
	padding: 10px 4px;
	margin-right: 20px;
	font-size: 14px;
	font-weight: 700;
	color: var(--cd-text-muted);
	border-bottom: 2px solid transparent;
	cursor: pointer;
	background: none;
	border-top: none;
	border-left: none;
	border-right: none;
}
.cd-tab.active {
	color: var(--cd-primary);
	border-color: var(--cd-accent);
}

.cd-story p {
	margin-bottom: 12px;
	color: var(--cd-text);
	font-size: 14.5px;
}
.cd-story p:first-child::first-letter {
	font-family: 'Fraunces', serif;
	font-size: 42px;
	font-weight: 600;
	color: var(--cd-primary);
	float: left;
	line-height: .8;
	margin: 4px 8px 0 0;
}

.cd-tab-content-item {
	display: none;
}
.cd-tab-content-item.active {
	display: block;
}

/* Prayer Feed */
.cd-prayer-feed {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.cd-prayer-item {
	background: var(--cd-surface-alt);
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 13.5px;
}
.cd-prayer-item .who {
	font-weight: 700;
	color: var(--cd-primary);
	font-size: 12.5px;
	margin-bottom: 3px;
}
.cd-prayer-item .when {
	color: var(--cd-text-muted);
	font-size: 11.5px;
	margin-top: 4px;
}

/* Sticky donation panel */
.cd-donate-panel {
	position: sticky;
	top: 20px;
}
.cd-progress-wrap {
	margin-bottom: 6px;
}
.cd-progress-numbers {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-bottom: 8px;
}
.cd-collected {
	font-size: 24px;
	font-weight: 600;
	color: var(--cd-primary);
}
.cd-target {
	font-size: 12.5px;
	color: var(--cd-text-muted);
}
.cd-progress-bar-track {
	height: 10px;
	background: var(--cd-surface-alt);
	border-radius: 100px;
	overflow: hidden;
}
.cd-progress-bar-fill {
	height: 100%;
	width: 0%;
	border-radius: 100px;
	background: linear-gradient(90deg, var(--cd-accent), var(--cd-accent-light));
	position: relative;
	transition: width 0.8s ease-in-out;
}
.cd-stat-row {
	display: flex;
	justify-content: space-between;
	margin-top: 10px;
	font-size: 12.5px;
	color: var(--cd-text-muted);
}
.cd-stat-row strong {
	color: var(--cd-text);
	font-family: 'IBM Plex Mono', monospace;
	font-weight: 500;
}

hr.cd-thin {
	border: none;
	border-top: 1px solid var(--cd-line);
	margin: 18px 0;
}

.cd-section-label {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .6px;
	text-transform: uppercase;
	color: var(--cd-primary);
	margin-bottom: 10px;
	display: flex;
	align-items: center;
	gap: 8px;
}
.cd-section-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--cd-line);
}

.cd-quick-amounts {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
	margin-bottom: 10px;
}
.cd-qa-btn {
	padding: 10px 6px;
	border: 1.5px solid var(--cd-line);
	border-radius: 10px;
	background: var(--cd-surface);
	font-weight: 700;
	font-size: 13px;
	text-align: center;
	cursor: pointer;
	font-family: 'IBM Plex Mono', monospace;
	transition: all 0.2s ease;
}
.cd-qa-btn:hover {
	border-color: var(--cd-accent);
}
.cd-qa-btn.selected {
	border-color: var(--cd-accent);
	background: #FBF4DE;
	color: var(--cd-primary-dark);
}

.cd-field {
	margin-bottom: 12px;
}
.cd-field label {
	display: block;
	font-size: 12.5px;
	font-weight: 700;
	margin-bottom: 5px;
	color: var(--cd-text);
}
.cd-field input[type=text],
.cd-field input[type=email],
.cd-field input[type=tel],
.cd-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid var(--cd-line);
	border-radius: 9px;
	font-family: 'Manrope', sans-serif;
	font-size: 13.5px;
	background: var(--cd-bg);
}
.cd-field input:focus,
.cd-field textarea:focus {
	outline: none;
	border-color: var(--cd-primary);
	background: #fff;
}
.cd-field .cd-prefix-input {
	position: relative;
}
.cd-field .cd-prefix-input span {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-weight: 700;
	color: var(--cd-text-muted);
	font-family: 'IBM Plex Mono', monospace;
}
.cd-field .cd-prefix-input input {
	padding-left: 34px;
	font-family: 'IBM Plex Mono', monospace;
	font-weight: 600;
}

.cd-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: var(--cd-surface-alt);
	padding: 10px 12px;
	border-radius: 9px;
	margin-bottom: 12px;
}
.cd-toggle-row .label {
	font-size: 13px;
	font-weight: 700;
}
.cd-toggle-row .sub {
	font-size: 11.5px;
	color: var(--cd-text-muted);
	font-weight: 400;
}
.cd-switch {
	width: 38px;
	height: 22px;
	background: var(--cd-line);
	border-radius: 100px;
	position: relative;
	flex-shrink: 0;
	margin-left: 10px;
	cursor: pointer;
	transition: background 0.3s;
}
.cd-switch::after {
	content: "";
	position: absolute;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	top: 2px;
	left: 2px;
	box-shadow: 0 1px 2px rgba(0,0,0,.2);
	transition: left 0.3s;
}
.cd-switch.on {
	background: var(--cd-primary);
}
.cd-switch.on::after {
	left: 18px;
}

.cd-zakat-box {
	background: var(--cd-surface-alt);
	border: 1px dashed var(--cd-primary);
	border-radius: 10px;
	padding: 12px 14px;
	margin-bottom: 14px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.cd-zakat-box .txt {
	font-size: 12.5px;
	color: var(--cd-text);
}
.cd-zakat-box .txt strong {
	display: block;
	font-size: 13.5px;
	color: var(--cd-primary-dark);
}
.cd-btn-link {
	font-size: 12.5px;
	font-weight: 800;
	color: var(--cd-primary);
	border: 1.5px solid var(--cd-primary);
	padding: 7px 12px;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: all 0.2s;
}
.cd-btn-link:hover {
	background: var(--cd-primary);
	color: #fff;
}

.cd-channel-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 16px;
}
.cd-channel {
	border: 1.5px solid var(--cd-line);
	border-radius: 9px;
	padding: 10px;
	font-size: 12.5px;
	font-weight: 700;
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition: border-color 0.2s;
}
.cd-channel:hover {
	border-color: var(--cd-primary);
}
.cd-channel.selected {
	border-color: var(--cd-primary);
	background: #EEF5F0;
}
.cd-channel .dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cd-line);
	display: inline-block;
}
.cd-channel.selected .dot {
	background: var(--cd-primary);
}

.cd-btn-donate {
	width: 100%;
	padding: 14px;
	background: var(--cd-primary);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 15px;
	font-weight: 800;
	letter-spacing: .2px;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(14,77,60,.25);
	transition: all 0.2s;
}
.cd-btn-donate:hover {
	background: var(--cd-primary-dark);
}
.cd-btn-donate span {
	color: var(--cd-accent-light);
}
.cd-trust-line {
	display: flex;
	align-items: center;
	gap: 6px;
	justify-content: center;
	margin-top: 10px;
	font-size: 11.5px;
	color: var(--cd-text-muted);
}

/* Modal Zakat Calculator */
.cd-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}
.cd-modal-overlay.active {
	opacity: 1;
	pointer-events: auto;
}
.cd-modal {
	background: #fff;
	width: 90%;
	max-width: 500px;
	border-radius: 14px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.2);
	overflow: hidden;
	transform: scale(0.9);
	transition: transform 0.3s;
}
.cd-modal-overlay.active .cd-modal {
	transform: scale(1);
}
.cd-modal-header {
	background: var(--cd-primary);
	color: #fff;
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.cd-modal-header h3 {
	margin: 0;
	font-family: 'Fraunces', serif;
	font-size: 18px;
}
.cd-modal-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
}
.cd-modal-body {
	padding: 20px;
}
.cd-modal-footer {
	padding: 16px 20px;
	background: var(--cd-bg);
	border-top: 1px solid var(--cd-line);
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}
.cd-modal-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	border-bottom: 1.5px solid var(--cd-line);
	margin-bottom: 16px;
}
.cd-modal-tab {
	text-align: center;
	padding: 8px 0;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--cd-text-muted);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	background: none;
	border-top: none;
	border-left: none;
	border-right: none;
}
.cd-modal-tab.active {
	color: var(--cd-primary);
	border-color: var(--cd-primary);
}
.cd-calc-panel {
	display: none;
}
.cd-calc-panel.active {
	display: block;
}
.cd-calc-result-box {
	background: var(--cd-surface-alt);
	border-radius: 8px;
	padding: 12px;
	margin-top: 14px;
	text-align: center;
}
.cd-calc-result-box .label {
	font-size: 12px;
	font-weight: 700;
	color: var(--cd-text-muted);
	text-transform: uppercase;
}
.cd-calc-result-box .val {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 20px;
	font-weight: 800;
	color: var(--cd-primary-dark);
	margin-top: 4px;
}

/* Campaign Grid / List shortcode */
.cd-campaign-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	padding: 10px 0;
}
.cd-campaign-card {
	background: #fff;
	border: 1px solid var(--cd-line);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s, box-shadow 0.2s;
}
.cd-campaign-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.cd-campaign-card-img {
	height: 180px;
	background-size: cover;
	background-position: center;
	position: relative;
}
.cd-campaign-card-content {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}
.cd-campaign-card-title {
	font-family: 'Fraunces', serif;
	font-size: 18px;
	font-weight: 600;
	margin: 8px 0 12px;
	line-height: 1.4;
	color: var(--cd-text);
}
.cd-campaign-card-title a {
	color: inherit;
	text-decoration: none;
}
.cd-campaign-card-title a:hover {
	color: var(--cd-primary);
}
.cd-campaign-card-footer {
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--cd-line);
}
.cd-btn-secondary {
	width: 100%;
	padding: 10px;
	background: var(--cd-surface-alt);
	color: var(--cd-primary);
	border: none;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 800;
	cursor: pointer;
	text-align: center;
	display: block;
	text-decoration: none;
	transition: background 0.2s;
}
.cd-btn-secondary:hover {
	background: var(--cd-line);
}

/* Accessibility Focus Outline */
.cd-donation-wrap *:focus-visible,
.cd-modal *:focus-visible {
	outline: 2px solid var(--cd-accent);
	outline-offset: 2px;
}

/* Reduced Motion preference */
@media (prefers-reduced-motion: reduce) {
	.cd-progress-bar-fill {
		transition: none;
	}
	.cd-campaign-card {
		transition: none;
	}
	.cd-campaign-card:hover {
		transform: none;
	}
}

/* Upload Area styles */
.cd-upload-area {
	border: 2px dashed var(--cd-line);
	border-radius: 10px;
	padding: 20px;
	text-align: center;
	background: var(--cd-bg);
	cursor: pointer;
	position: relative;
	transition: border-color 0.2s, background 0.2s;
}
.cd-upload-area:hover {
	border-color: var(--cd-primary);
	background: var(--cd-surface-alt);
}
.cd-upload-icon {
	font-size: 24px;
	margin-bottom: 6px;
}
.cd-upload-text {
	font-size: 12.5px;
	font-weight: 700;
	color: var(--cd-text-muted);
}

/* Textbox Input Styles Overrides (Main form and Calculator Modal) */
.cd-field input[type=text],
.cd-field input[type=email],
.cd-field input[type=tel],
.cd-field input[type=number],
.cd-field textarea {
	border: 1.5px solid #C4C9C1 !important;
	background: #F4F5F0 !important; /* Soft grey/cream different from card background #fff */
	color: var(--cd-text) !important;
	transition: all 0.2s ease !important;
	width: 100% !important;
	border-radius: 9px !important;
	padding: 12px 14px !important;
	font-family: 'Manrope', sans-serif !important;
	font-size: 13.5px !important;
	box-shadow: none !important;
	height: auto !important;
	display: block !important;
}

.cd-field input[type=text]:focus,
.cd-field input[type=email]:focus,
.cd-field input[type=tel]:focus,
.cd-field input[type=number]:focus,
.cd-field textarea:focus {
	border-color: var(--cd-primary) !important;
	background: #EDF1EC !important; /* Soft green-grey different from card background #fff */
	outline: none !important;
}

/* Fix nominal text overlapping Rp prefix */
.cd-field .cd-prefix-input input[type=text] {
	padding-left: 38px !important;
}

/* Modal Calculator Style Overrides for Compatibility */
.cd-modal-footer .cd-btn-donate {
	border: 1.5px solid var(--cd-accent) !important;
	background: #FBF4DE !important; /* Matches selected nominal button (.cd-qa-btn.selected) */
	color: var(--cd-primary-dark) !important;
	font-weight: 800 !important;
	border-radius: 10px !important;
	cursor: pointer !important;
	box-shadow: none !important;
	width: auto !important;
	padding: 10px 20px !important;
	font-size: 13px !important;
	display: inline-block !important;
	transition: all 0.2s ease !important;
}
.cd-modal-footer .cd-btn-donate:hover:not(:disabled) {
	background: var(--cd-accent-light) !important;
	border-color: var(--cd-accent) !important;
	color: var(--cd-primary-dark) !important;
}
.cd-modal-footer .cd-btn-donate:disabled {
	background: var(--cd-bg) !important;
	color: var(--cd-text-muted) !important;
	border-color: var(--cd-line) !important;
	opacity: 0.6 !important;
	cursor: not-allowed !important;
}
