@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

.donation-container {
  width: 100%;
  max-width: 600px;
  background: transparent;
  border: 1px solid #443735;
  border-radius: 12px;
  margin: 20px auto;
  position: relative;
  transition: border-color 0.3s ease;
}

.donation-container:hover {
  border-color: #443735;
}

.donation-header {
  padding: 20px;
  text-align: center;
  background: #ffffff;
  border-bottom: 1px solid #e9ecef;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.donation-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 15px;
  color: #1a1a1a;
}

.toggle-container {
  display: inline-flex;
  background: #f1f3f5;
  border-radius: 20px;
  padding: 4px;
  margin: 0 auto;
}

.toggle-btn {
  padding: 8px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  transition: all 0.3s ease;
}

.toggle-btn.active {
  background: linear-gradient(135deg, #5c4b46, #443735);
  color: white;
  border-radius: 16px;
}

.donation-body {
  padding: 20px;
  background: #ffffff;
}

.donation-text {
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
  color: #555;
  font-weight: 400;
}

.project-selection {
  margin-bottom: 20px;
}

.project-selection label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.project-selection select {
  width: 100%;
  padding: 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.project-selection select:focus {
  border-color: #443735;
  outline: none;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.amount-btn {
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
  text-align: center;
  transition: all 0.3s ease;
}

.amount-btn:hover {
  background: #f8f9fa;
  border-color: #443735;
  color: black;
}

.amount-btn.selected {
  background: linear-gradient(135deg, #5c4b46, #443735);
  color: white;
  border-color: #443735;
}

.custom-amount {
  display: flex;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
}

.currency {
  padding: 12px;
  background: #f8f9fa;
  font-weight: 600;
  color: #333;
  flex: 0 0 60px;
  text-align: center;
  border-right: 1px solid #dee2e6;
}

.custom-input {
  display: flex;
  flex: 1;
  align-items: center;
  padding: 0 12px;
}

.custom-input span {
  font-size: 14px;
  font-weight: 600;
  margin-right: 8px;
  color: #333;
}

.custom-input input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  padding: 12px 0;
  color: #333;
}

.donation-footer {
  padding: 20px;
  border-top: 1px solid #e9ecef;
  background: #ffffff;
}

.continue-btn {
  background: linear-gradient(135deg, #5c4b46, #443735);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.continue-btn:hover {
  background: linear-gradient(135deg, #443735, #5c4b46);
}

.payment-options {
  margin-bottom: 20px;
}

.payment-options label {
  display: flex;
  align-items: center;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.payment-options label:hover {
  border-color: #443735;
}

.payment-options input[type="radio"] {
  margin-right: 8px;
}

.payment-options img {
  width: 40px;
  margin-left: 8px;
}

#card-element {
  margin-bottom: 15px;
  padding: 12px;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
}

#paypal-button-container {
  margin-top: 15px;
}

.loading-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #443735;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Ensure topmost positioning */
  opacity: 1;
  transition: opacity 0.5s ease;
  cursor: pointer; /* Indicate the overlay is clickable */
}

.modal-content {
  max-width: 400px; /* Slightly smaller for modal */
  margin: 0; /* Override default margin */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  animation: fadeIn 0.5s ease;
  cursor: default; /* Prevent cursor change on the modal content */
}

.modal-overlay.fade-out {
  opacity: 0;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .donation-container {
    margin: 10px;
    border-radius: 8px;
  }

  .donation-header {
    padding: 15px;
  }

  .donation-header h1 {
    font-size: 20px;
  }

  .donation-body {
    padding: 15px;
  }

  .amount-grid {
    grid-template-columns: 1fr;
  }

  .payment-options label {
    padding: 6px;
  }

  .modal-content {
    max-width: 90%;
  }
}