/* Public Fundraiser Page Styles */

.public-fundraiser-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Campaign image section */
.public-fundraiser-page .fundraiser-image-wrapper {
  position: relative;
  border: 8px solid #e5e7eb;
  background: #f3f4f6;
}

.public-fundraiser-page .bg-gradient {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
}

/* Banner image responsive sizing */
.public-fundraiser-page .fundraiser-banner-image {
  height: 350px;
  object-fit: cover;
}

.public-fundraiser-page .fundraiser-banner-placeholder {
  height: 350px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Mobile banner adjustments */
@media (max-width: 767px) {
  .public-fundraiser-page .fundraiser-banner-image {
    height: 250px;
    object-fit: cover;
  }
  
  .public-fundraiser-page .fundraiser-banner-placeholder {
    height: 250px;
  }
  
  .public-fundraiser-page .fundraiser-image-wrapper {
    border-width: 4px;
  }
  
  /* Adjust text sizes on mobile for banner placeholder */
  .public-fundraiser-page .fundraiser-banner-placeholder h2 {
    font-size: 1.75rem;
  }
  
  /* Reduce title size on mobile */
  .public-fundraiser-page .fundraiser-title {
    font-size: 2rem;
  }
  
  /* Compact organization header on mobile */
  .public-fundraiser-page .text-center.mb-5 {
    margin-bottom: 1.5rem !important;
  }
}

/* Form styling */
.public-fundraiser-page .form-control {
  border-radius: 0.375rem;
  border-color: #e5e7eb;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

.public-fundraiser-page .form-control:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.public-fundraiser-page .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.public-fundraiser-page .input-group-text {
  background-color: #f9fafb;
  border-color: #e5e7eb;
  font-weight: 500;
}

/* Payment button */
.public-fundraiser-page .btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  border: none;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  transition: all 0.2s ease;
}

.public-fundraiser-page .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(139, 92, 246, 0.2);
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

/* Social share buttons */
.public-fundraiser-page .btn-sm.rounded-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.public-fundraiser-page .btn-sm.rounded-circle:hover {
  transform: scale(1.1);
}

/* Progress bar styling (if needed) */
.public-fundraiser-page .progress {
  height: 0.75rem;
  background-color: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.public-fundraiser-page .progress-bar {
  background: linear-gradient(to right, #8b5cf6 0%, #ec4899 100%);
  transition: width 0.8s cubic-bezier(0.4, 0.0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Add subtle animation to progress bar */
.public-fundraiser-page .progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Typography adjustments */
.public-fundraiser-page .display-5 {
  font-weight: 700;
  line-height: 1.2;
}

.public-fundraiser-page .campaign-description p {
  font-size: 1rem;
  line-height: 1.75;
  color: #4b5563;
}

.public-fundraiser-page .campaign-description strong {
  color: #111827;
  font-weight: 600;
}

/* Hide number spinners */
.public-fundraiser-page input[type="number"]::-webkit-inner-spin-button,
.public-fundraiser-page input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.public-fundraiser-page input[type="number"] {
  -moz-appearance: textfield;
}

/* Desktop layout with proper margins */
@media (min-width: 992px) {
  body.public-fundraiser-page {
    background-color: #f5f5f5;
    padding: 2rem;
    min-height: 100vh;
  }
  
  .public-fundraiser-page .main-container {
    max-width: 1140px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    min-height: calc(100vh - 4rem);
  }
  
  .public-fundraiser-page .container-fluid {
    width: 100%;
    height: 100%;
  }
  
  .public-fundraiser-page .row {
    height: 100%;
  }
  
  #campaign-content {
    background: white;
    overflow-y: auto;
    max-height: calc(100vh - 4rem);
  }
  
  #payment-sidebar {
    background: #fafafa;
    border-left: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    height: calc(100vh - 4rem);
    overflow-y: auto;
  }
  
  /* Add padding to content containers */
  #campaign-content .container {
    padding: 2.5rem 3rem;
  }
  
  #payment-sidebar .container {
    padding: 2.5rem 2rem;
    padding-top: 7rem; /* Align with the fundraiser title */
  }
  
  /* Hide mobile donate button on desktop */
  #mobile-donate-button {
    display: none !important;
  }
  
  /* Ensure full height columns */
  .public-fundraiser-page .col-lg-7,
  .public-fundraiser-page .col-lg-5 {
    display: flex;
    flex-direction: column;
  }
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
  html, body {
    height: auto !important;
    min-height: 100% !important;
  }
  
  body.public-fundraiser-page {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto !important;
    min-height: 100vh !important;
    position: relative;
  }
  
  .public-fundraiser-page .min-vh-100 {
    min-height: auto !important;
  }
  
  .public-fundraiser-page .col-lg-7,
  .public-fundraiser-page .col-lg-5 {
    padding: 1.5rem 1rem;
  }
  
  /* Reduce padding on mobile for more content space */
  .public-fundraiser-page .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  /* Special padding for main content container on mobile */
  .public-fundraiser-page #campaign-content .container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }
  
  /* Adjust spacing between elements on mobile */
  .public-fundraiser-page .mb-5 {
    margin-bottom: 2rem !important;
  }
  
  .public-fundraiser-page .mb-4 {
    margin-bottom: 1.5rem !important;
  }
  
  /* Ensure fixed-bottom button is visible on mobile */
  #mobile-donate-button {
    z-index: 9999 !important; /* Very high z-index */
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  /* Override Bootstrap's d-lg-none to ensure it shows on mobile */
  #mobile-donate-button.d-lg-none {
    display: block !important;
  }
  
  /* Bottom sheet modal styles */
  #mobile-payment-modal .modal-dialog {
    position: fixed;
    margin: 0;
    width: 100%;
    max-width: 100%;
    bottom: 0;
    transform: translate(0, 100%);
  }
  
  #mobile-payment-modal.show .modal-dialog {
    transform: translate(0, 0);
    transition: transform 0.3s ease-out;
  }
  
  #mobile-payment-modal .modal-content {
    border-radius: 20px 20px 0 0;
    border: none;
    max-height: 85vh;
    overflow-y: auto;
  }
  
  #mobile-payment-modal .modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    border-radius: 20px 20px 0 0;
  }
  
  #mobile-payment-modal .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(85vh - 60px); /* Account for header height */
  }
  
  /* Add a drag handle indicator */
  #mobile-payment-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background-color: #dee2e6;
    border-radius: 2px;
  }
  
  /* Override Bootstrap modal backdrop for bottom sheet */
  #mobile-payment-modal.modal {
    align-items: flex-end;
  }
  
  /* Make modal dialog a bottom sheet */
  #mobile-payment-modal .modal-dialog.modal-bottom-sheet {
    margin: 0;
    max-width: 100%;
    margin-bottom: 0;
  }
  
  /* Hide donate button when modal is showing */
  body.modal-open #mobile-donate-button {
    display: none !important;
    visibility: hidden !important;
  }
}

/* Payment result pages styling */
.payment-result-page .main-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 2rem 0;
}

.payment-result-page .bg-success {
  background-color: #10b981 !important;
}

.payment-result-page .bg-danger {
  background-color: #ef4444 !important;
}

.payment-result-page .text-monospace {
  font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
  font-size: 0.875rem;
}

/* Success page specific */
.payment-result-page .btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
}

.payment-result-page .btn-primary:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Social share buttons on success page */
.payment-result-page .btn-sm.rounded-circle {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Custom scrollbar for the form section */
.public-fundraiser-page .col-lg-5 {
  overflow-y: auto;
}

.public-fundraiser-page .col-lg-5::-webkit-scrollbar {
  width: 6px;
}

.public-fundraiser-page .col-lg-5::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.public-fundraiser-page .col-lg-5::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.public-fundraiser-page .col-lg-5::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}