/* Donation Map Frontend Styles */

/* Modal Styles */
.donation-map-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 100000;
}

.donation-map-modal.active {
	display: flex;
	align-items: center;
	justify-content: center;
}

.donation-map-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(2px);
}

.donation-map-modal-content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	padding: 30px;
	max-width: 750px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	z-index: 100001;
	animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.donation-map-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #666;
	line-height: 1;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.donation-map-modal-close:hover {
	color: #000;
}

.donation-map-modal-content h2 {
	margin-top: 0;
	margin-bottom: 20px;
}

/* Form Styles */
.donation-map-form {
	margin-top: 20px;
}

.donation-mode-toggle {
	display: flex;
	gap: 0;
	margin-bottom: 25px;
	padding: 4px;
	background: #f0f0f1;
	border-radius: 6px;
	width: 100%;
}

.mode-toggle-btn {
	flex: 1;
	padding: 12px 20px;
	background: transparent;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	font-weight: 600;
	color: #666;
	transition: all 0.2s;
	text-align: center;
	width: 50%;
	min-width: 0;
}

.mode-toggle-btn[data-mode="distance"] {
	border-radius: 0px 40px 40px 0px;
}

.mode-toggle-btn:hover {
	color: #2271b1;
	background: rgba(34, 113, 177, 0.1);
}

.mode-toggle-btn.active {
	background: #2271b1;
	color: #fff;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-toggle-btn.active[data-mode="amount"] {
	border-radius: 40px 0px 0px 40px;
}

.donation-amount-section {
	margin-bottom: 30px;
}

.donation-amount-section label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
}

.preset-amounts {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 8px;
	margin-bottom: 15px;
	width: 100%;
}

.preset-amount-btn {
	padding: 10px 8px;
	background: #f0f0f1;
	border: 2px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 600;
	transition: all 0.2s;
	white-space: nowrap;
	text-align: center;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.preset-amount-btn:hover {
	background: #e0e0e1;
	border-color: #2271b1;
}

.preset-amount-btn.active {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

.custom-amount-input {
	width: 100%;
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	margin-top: 10px;
}

.donation-explanation {
	background: #f0f7ff;
	border-left: 4px solid #2271b1;
	padding: 12px 15px;
	margin-bottom: 20px;
	border-radius: 4px;
}

.explanation-text {
	margin: 0;
	font-size: 15px;
	color: #1e3a5f;
	font-weight: 500;
	line-height: 1.5;
}

.distance-travelled-display {
	margin-top: 12px;
	margin-bottom: 8px;
	padding: 15px;
	background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
	border-radius: 6px;
	border: 2px solid #4caf50;
}

.meters-info {
	margin: 0;
	font-size: 18px;
	color: #1b5e20;
	font-weight: 600;
	text-align: center;
	line-height: 1.4;
}

.distance-prefix {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #2e7d32;
	margin-bottom: 8px;
}

.distance-number {
	font-size: 32px;
	font-weight: 700;
	color: #1b5e20;
	display: inline-block;
	text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.distance-detail {
	font-size: 16px;
	font-weight: 500;
	color: #2e7d32;
	margin-left: 8px;
}

.custom-amount-input:focus {
	outline: none;
	border-color: #2271b1;
}

.description {
	font-size: 14px;
	color: #666;
	margin-top: 5px;
}

.donation-distance-section {
	margin-bottom: 30px;
}

.donation-distance-section label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
}

.distance-input-wrapper {
	display: flex;
	gap: 10px;
	margin-top: 10px;
}

.custom-distance-input {
	flex: 1;
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
}

.distance-unit-select {
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	background: #fff;
	cursor: pointer;
	min-width: 140px;
}

.custom-distance-input:focus,
.distance-unit-select:focus {
	outline: none;
	border-color: #2271b1;
}

.amount-display {
	margin-top: 12px;
	margin-bottom: 8px;
	padding: 15px;
	background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
	border-radius: 6px;
	border: 2px solid #2196f3;
}

.amount-info {
	margin: 0;
	font-size: 18px;
	color: #0d47a1;
	font-weight: 600;
	text-align: center;
	line-height: 1.4;
}

.amount-prefix {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: #1565c0;
	margin-bottom: 8px;
}

.amount-number {
	font-size: 32px;
	font-weight: 700;
	color: #0d47a1;
	display: inline-block;
	text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.donor-info-section {
	margin-bottom: 30px;
}

.form-row {
	margin-bottom: 20px;
}

.form-row label {
	display: block;
	margin-bottom: 5px;
	font-weight: 600;
}

.form-row .required {
	color: #d63638;
}

.form-row input,
.form-row textarea {
	width: 100%;
	padding: 12px;
	border: 2px solid #ddd;
	border-radius: 4px;
	font-size: 16px;
	font-family: inherit;
}

.form-row input:focus,
.form-row textarea:focus {
	outline: none;
	border-color: #2271b1;
}

.form-actions {
	margin-top: 30px;
}

.donation-submit-btn {
	width: 100%;
	padding: 15px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.donation-submit-btn:hover {
	background: #135e96;
}

.donation-submit-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.form-messages {
	margin-top: 15px;
	padding: 10px;
	border-radius: 4px;
	display: none;
}

.form-messages.error {
	background: #fce8e6;
	color: #d63638;
	border: 1px solid #d63638;
	display: block;
}

.form-messages.success {
	background: #e8f5e9;
	color: #2e7d32;
	border: 1px solid #2e7d32;
	display: block;
}

/* Map Styles */
#donation-map-container {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Donate Button */
.donation-map-donate-button,
.donate,
.donate-button {
	cursor: pointer;
	text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
	.donation-map-modal-content {
		padding: 20px;
		width: 95%;
		max-width: 95%;
	}

	.preset-amounts {
		grid-template-columns: repeat(5, 1fr);
		gap: 6px;
	}

	.preset-amount-btn {
		font-size: 12px;
		padding: 8px 6px;
	}

	.distance-number {
		font-size: 28px;
	}

	.meters-info {
		font-size: 16px;
	}

	.distance-input-wrapper {
		flex-direction: column;
	}

	.distance-unit-select {
		min-width: 100%;
	}

	.mode-toggle-btn {
		font-size: 14px;
		padding: 10px 15px;
	}

	.amount-number {
		font-size: 28px;
	}
}

@media (max-width: 480px) {
	.preset-amounts {
		grid-template-columns: repeat(3, 1fr);
	}
	
	.preset-amounts .preset-amount-btn:nth-child(4),
	.preset-amounts .preset-amount-btn:nth-child(5) {
		grid-column: span 1;
	}
	
	.preset-amounts .preset-amount-btn:nth-child(4) {
		grid-column: 1;
	}
	
	.preset-amounts .preset-amount-btn:nth-child(5) {
		grid-column: 2;
	}
}

/* Prevent body scroll when modal is open */
body.modal-open {
	overflow: hidden;
}

/* Map Markers */
.donation-progress-marker {
	background: transparent;
	border: none;
}

.progress-marker-inner {
	width: 20px;
	height: 20px;
	background: #17AA5C;
	border: 4px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.4);
	position: relative;
}

.progress-marker-inner::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 8px;
	height: 8px;
	background: #fff;
	border-radius: 50%;
}

.donation-target-marker {
	background: transparent;
	border: none;
}

.target-marker-inner {
	width: 24px;
	height: 24px;
	background: #d63638;
	border: 4px solid #fff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0,0,0,0.4);
	position: relative;
}

.target-marker-inner::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 10px;
	background: #fff;
	border-radius: 50%;
}
