/* ===== Animations ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}

.animate-fade-up { animation: fadeInUp 0.5s ease-out both; }
.animate-fade-in { animation: fadeIn 0.4s ease-out both; }
.animate-scale-in { animation: scaleIn 0.35s ease-out both; }
.animate-slide-down { animation: slideDown 0.3s ease-out both; }

/* Staggered delays for children */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }

/* ===== Campaign Tabs ===== */
.campaign-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.campaign-tab {
  padding: 12px 30px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--background);
  color: var(--muted);
  border-radius: 100px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
}
.campaign-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}
.campaign-tab.active {
  background: var(--foreground);
  color: #fff;
  border-color: var(--foreground);
  box-shadow: 0 2px 8px hsla(220, 20%, 18%, 0.2);
}

/* ===== Campaign Description ===== */
.campaign-description {
  transition: opacity 0.3s ease;
}

/* ===== Donate Card — Contained White Card ===== */
.donate-card-single {
  background: #fff;
  border: 1px solid hsla(30, 10%, 88%, 0.6);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
}
.donate-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 4px;
}
.donate-card-campaign-name {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 4px 0 2px;
}
.donate-card-subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 24px;
}
.donate-card-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}
.custom-amount-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 8px;
  text-align: left;
}
.donate-card-transfer-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 12px;
}
.donate-card-bank-details {
  background: hsla(220, 10%, 96%, 0.6);
  border-radius: 12px;
  padding: 16px 20px;
}
.bank-inline-name {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 6px;
}
.bank-inline-detail {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.88rem;
  color: var(--muted);
  margin: 2px 0;
  letter-spacing: 0.02em;
}
.bank-inline-detail strong {
  color: var(--foreground);
  font-weight: 600;
}

/* Frequency Tabs */
.freq-tabs {
  display: inline-flex;
  background: hsla(220, 15%, 94%, 0.7);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
  margin-bottom: 32px;
}
.freq-tab {
  padding: 10px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.freq-tab:hover { color: var(--foreground); }
.freq-tab.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-weight: 700;
}

/* Pre-set Amount Buttons — Grid */
.preset-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.preset-btn {
  padding: 14px 12px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--foreground);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
}
.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.preset-btn.active {
  background: var(--foreground);
  color: #fff;
  border-color: var(--foreground);
  box-shadow: 0 2px 8px hsla(220, 20%, 18%, 0.15);
}

/* Custom Amount Input */
.custom-amount-section { margin-bottom: 0; }
.custom-amount-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  overflow: hidden;
  transition: border-color 0.2s;
}
.custom-amount-wrap:focus-within {
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px hsla(220, 20%, 18%, 0.08);
}
.custom-amount-wrap span {
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--muted);
  padding: 12px 0 12px 14px;
}
.custom-amount-wrap input {
  flex: 1;
  width: 100%;
  padding: 12px 14px 12px 4px;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Source Sans 3', sans-serif;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--foreground);
  outline: none;
}
.custom-amount-wrap input::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

/* Fee Toggle */
.fee-toggle,
label.fee-toggle {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.92rem;
  color: var(--foreground);
  user-select: none;
  text-align: left;
  padding: 14px 18px;
  background: hsla(220, 10%, 92%, 0.5);
  border-radius: 10px;
}
.fee-toggle:hover {
  background: none;
}
.fee-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.fee-toggle .fee-toggle-text {
  display: inline;
  line-height: 1.4;
}
.fee-toggle .fee-extra {
  display: none;
}

/* Donate Button — Primary */
.donate-btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 48px;
  background: var(--gold-gradient, linear-gradient(135deg, #2d8a88, #c4956a));
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: 0.03em;
  margin-top: 8px;
  width: 100%;
  box-shadow: 0 4px 16px hsla(38, 85%, 50%, 0.25);
}
.donate-btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px hsla(38, 85%, 50%, 0.35);
}
.donate-btn-primary:active {
  transform: translateY(0);
}

/* End Date Section */
.end-date-section {
  margin: 16px 0;
  overflow: hidden;
}
.end-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: hsla(220, 15%, 94%, 0.5);
  border-radius: 100px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  color: var(--muted);
}
.end-date-wrap strong {
  color: var(--foreground);
  font-weight: 700;
}
.end-date-label {
  display: inline;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: 'Source Sans 3', sans-serif;
  color: var(--muted);
  margin: 0;
}
.end-date-input {
  padding: 6px 12px;
  font-size: 0.85rem;
  font-family: 'Source Sans 3', sans-serif;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--background);
  color: var(--foreground);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  max-width: 160px;
}
.end-date-input:focus {
  border-color: var(--foreground);
  box-shadow: 0 0 0 3px hsla(220, 20%, 18%, 0.08);
}

/* Secure Note */
.donate-secure-note {
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: 'Source Sans 3', sans-serif;
  letter-spacing: 0.01em;
}

/* ===== Bank Transfer — Two Card Layout ===== */
.bank-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}
.bank-card {
  background: #fff;
  border: 1px solid hsla(30, 10%, 88%, 0.6);
  border-radius: 20px;
  padding: 32px 28px;
  text-align: left;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06);
}
.bank-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 2px;
}
.bank-card-subtitle {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 20px;
}
.bank-card-details {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.bank-card-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.bank-card-row:last-child {
  border-bottom: none;
}
.bank-card-label {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.bank-card-value {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--foreground);
  text-align: right;
}
.bank-card-value.mono {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  letter-spacing: 0.03em;
}

@media (max-width: 768px) {
  .bank-cards-grid {
    grid-template-columns: 1fr;
  }
  .bank-card {
    padding: 24px 20px;
  }
}

/* Legacy donation-methods kept for compatibility */
.donation-methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.donation-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.donation-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* ===== Divider between sections ===== */
.donate-section-divider {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 auto;
}

/* Legacy classes kept for compatibility */
.donate-tabs { display: flex !important; flex-direction: row !important; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; justify-content: center; }
.donate-tab,
button.donate-tab,
.donate-tabs > button { display: inline-flex !important; width: auto !important; flex: 0 0 auto !important; padding: 12px 20px; font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; border: 1.5px solid var(--border); background: var(--background); color: var(--muted); border-radius: 100px; white-space: nowrap; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); font-family: 'Source Sans 3', sans-serif; text-align: center; }
.donate-tab:hover,
button.donate-tab:hover { color: var(--foreground); border-color: var(--foreground); }
.donate-tab.active,
button.donate-tab.active { background: var(--foreground); color: #fff; border-color: var(--foreground); }
.donate-panel { display: none; }
.donate-panel.active { display: block; }

.payment-box { background: var(--background); border: 1px solid var(--border); border-radius: 20px; padding: 40px; text-align: center; max-width: 500px; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 32px rgba(0,0,0,0.06); }
.payment-box h3 { font-size: 1.6rem; font-weight: 700; margin-bottom: 8px; }
.payment-box .amount { font-family: 'Playfair Display', serif; font-size: 2.8rem; font-weight: 700; color: var(--foreground); margin: 20px 0; }
.payment-box .donate-btn { display: inline-block; padding: 14px 40px; background: var(--foreground); color: #fff; font-weight: 700; font-size: 1rem; border-radius: 14px; text-decoration: none; transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); font-family: 'Source Sans 3', sans-serif; }
.payment-box .donate-btn:hover { background: hsl(220, 20%, 25%); transform: translateY(-2px); }

@media (max-width: 768px) {
  .donate-card-single { padding: 28px 20px; }
  .donate-card-title { font-size: 1.5rem; }
  .freq-tabs { flex-wrap: wrap; }
  .freq-tab { padding: 8px 16px; font-size: 0.78rem; }
  .preset-btn { padding: 12px 8px; font-size: 0.92rem; }
  .donate-btn-primary { padding: 14px 36px; font-size: 0.95rem; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
  .donation-methods { grid-template-columns: 1fr !important; }
}

/* ===== Checkout Modal Overlay (Embedded Stripe) ===== */
.checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease-out;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.checkout-modal {
  position: relative;
  width: 94vw;
  max-width: 520px;
  height: 85vh;
  max-height: 700px;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
  animation: scaleIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
}
.checkout-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0,0,0,0.06);
  color: #333;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
}
.checkout-close:hover { background: rgba(0,0,0,0.12); }
.checkout-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: #888;
}
.embedded-checkout-container {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

@media (max-width: 480px) {
  .checkout-modal {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
}

/* ── Hadith Takeover (Rawdha) ── */
.rawdha-hadith-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--primary, #2d8a88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 32px;
  text-align: center;
  transition: opacity 0.8s ease;
}
.rawdha-hadith-modal .hadith-arabic {
  font-family: 'Noto Naskh Arabic', serif;
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  color: #fff;
  direction: rtl;
  line-height: 2;
  padding: 0 32px;
  max-width: 880px;
  transition: opacity 1s ease;
}
.rawdha-hadith-modal .hadith-translation {
  font-family: 'Source Sans 3', 'Helvetica Neue', sans-serif;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.82);
  font-style: italic;
  max-width: 620px;
  padding: 0 32px;
  margin-top: 20px;
  line-height: 1.7;
  transition: opacity 1s ease;
}
.rawdha-hadith-modal .hadith-ref {
  font-family: 'Source Sans 3', 'Helvetica Neue', sans-serif;
  font-size: 0.8rem;
  color: rgba(253, 235, 210, 0.8);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 28px;
  transition: opacity 1s ease;
}
.rawdha-hadith-skip {
  position: absolute;
  top: 20px; right: 24px;
  background: none; border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1.2rem; cursor: pointer;
  line-height: 1; padding: 6px 8px;
  transition: color 0.2s;
}
.rawdha-hadith-skip:hover { color: rgba(255, 255, 255, 0.65); }
.rawdha-hadith-modal.is-fading .hadith-arabic,
.rawdha-hadith-modal.is-fading .hadith-translation,
.rawdha-hadith-modal.is-fading .hadith-ref { opacity: 0.15; }
.rawdha-hadith-modal.is-dismissed {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.rawdha-donations-body {
  opacity: 0;
  transform: translateY(36px);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.85s ease;
}
.rawdha-donations-body.is-revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .rawdha-hadith-modal { display: none !important; }
  .rawdha-donations-body { transform: none; opacity: 1; transition: none; }
}
.takeover-continue {
  margin-top: 36px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.75);
  font-family: 'Source Sans 3', 'Helvetica Neue', sans-serif;
  font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 10px 36px; border-radius: 4px; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.takeover-continue:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
