/* ==========================================================================
   SARVSEVA FOUNDATION - Liquid Editorial Stylesheet
   Color Palette derived from official Sarvseva Foundation Logo:
   - Deep Teal: #164644
   - Accent Leaf Green: #367965 / #43927B
   - Warm Canvas: #FAFAF6
   - Cream Surface: #F3F0E6
   - Charcoal Typography: #1C2523
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --color-primary: #164644;
  --color-primary-dark: #0F3331;
  --color-primary-light: #205D5B;

  --color-accent: #367965;
  --color-accent-light: #43927B;
  --color-accent-sage: #86B3A0;
  --color-accent-soft: rgba(67, 146, 123, 0.12);

  --color-bg-canvas: #FAFAF6;
  --color-bg-surface: #F3F0E6;
  --color-bg-card: #FFFFFF;
  --color-bg-alt: #F0EEE4;

  --color-text-main: #1C2523;
  --color-text-muted: #4A5854;
  --color-text-light: #768682;
  --color-border: #E5E2D5;

  --color-gold-warm: #D4A359;
  --color-success: #2A7D58;

  --shadow-soft: 0 10px 30px -10px rgba(22, 70, 68, 0.08);
  --shadow-elevated: 0 20px 40px -15px rgba(22, 70, 68, 0.14);
  --shadow-liquid: 0 25px 50px -12px rgba(54, 121, 101, 0.2);

  --radius-liquid-1: 30% 70% 70% 30% / 30% 30% 70% 70%;
  --radius-liquid-2: 60% 40% 30% 70% / 60% 30% 70% 40%;
  --radius-liquid-3: 40% 60% 60% 40% / 70% 30% 70% 30%;
  --radius-card: 24px;
  --radius-pill: 9999px;
}

/* --- Base Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg-canvas);
  color: var(--color-text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Container & Utilities --- */
.container-custom {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.liquid-bg-blob-1 {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(67, 146, 123, 0.15) 0%, rgba(250, 250, 246, 0) 70%);
  border-radius: var(--radius-liquid-1);
  animation: morphBlob 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

.liquid-bg-blob-2 {
  position: absolute;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(212, 163, 89, 0.12) 0%, rgba(250, 250, 246, 0) 70%);
  border-radius: var(--radius-liquid-2);
  animation: morphBlob 18s ease-in-out infinite alternate-reverse;
  pointer-events: none;
  z-index: 0;
}

/* --- Keyframe Animations --- */
@keyframes morphBlob {
  0% {
    border-radius: 40% 60% 60% 40% / 70% 30% 70% 30%;
    transform: rotate(0deg) scale(1);
  }
  50% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(180deg) scale(1.05);
  }
  100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transform: rotate(360deg) scale(0.95);
  }
}

@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(67, 146, 123, 0.4);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(67, 146, 123, 0);
  }
}

.animate-float {
  animation: floatSlow 6s ease-in-out infinite;
}

/* --- Header Styles --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  background-color: rgba(250, 250, 246, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(229, 226, 213, 0.6);
}

.site-header.scrolled {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  background-color: rgba(250, 250, 246, 0.94);
  box-shadow: var(--shadow-soft);
}

.nav-link {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text-main);
  position: relative;
  transition: color 0.2s ease;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
  border-radius: var(--radius-pill);
}

.nav-link:hover {
  color: var(--color-accent);
}

.nav-link:hover::after {
  width: 100%;
}

/* --- Button Styles --- */
.btn-primary-liquid {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(22, 70, 68, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
}

.btn-primary-liquid:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(22, 70, 68, 0.35);
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-accent) 100%);
}

.btn-secondary-liquid {
  background-color: rgba(22, 70, 68, 0.06);
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.875rem 1.875rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  border: 1px solid var(--color-border);
  cursor: pointer;
}

.btn-secondary-liquid:hover {
  background-color: rgba(22, 70, 68, 0.12);
  transform: translateY(-2px);
  color: var(--color-primary-dark);
}

/* --- Liquid Image Frame --- */
.liquid-frame {
  position: relative;
  border-radius: 40% 60% 50% 50% / 50% 50% 60% 40%;
  overflow: hidden;
  box-shadow: var(--shadow-liquid);
  transition: border-radius 10s ease-in-out infinite alternate;
}

.liquid-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.liquid-frame:hover img {
  transform: scale(1.04);
}

/* --- Primary Donation Card --- */
.donation-card {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  padding: 2.5rem;
  box-shadow: var(--shadow-elevated);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.donation-tier-btn {
  background-color: var(--color-bg-surface);
  border: 2px solid transparent;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.875rem 1rem;
  border-radius: 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donation-tier-btn:hover {
  background-color: var(--color-accent-soft);
  border-color: var(--color-accent-sage);
}

.donation-tier-btn.selected {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary-dark);
  box-shadow: 0 4px 12px rgba(22, 70, 68, 0.25);
  transform: scale(1.02);
}

.custom-amount-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.custom-amount-symbol {
  position: absolute;
  left: 1.25rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.custom-amount-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  background-color: var(--color-bg-surface);
  border: 2px solid var(--color-border);
  border-radius: 16px;
  transition: all 0.2s ease;
  outline: none;
}

.custom-amount-input:focus {
  border-color: var(--color-accent);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(67, 146, 123, 0.15);
}

.custom-amount-input.has-value {
  border-color: var(--color-primary);
}

/* --- Form Fields --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-main);
  margin-bottom: 0.375rem;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text-main);
  background-color: var(--color-bg-canvas);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--color-accent);
  background-color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(67, 146, 123, 0.15);
}

.form-input.is-invalid {
  border-color: #DC2626;
  background-color: #FEF2F2;
}

.error-hint {
  font-size: 0.775rem;
  color: #DC2626;
  margin-top: 0.25rem;
  display: none;
}

.error-hint.visible {
  display: block;
}

/* --- Card Grids & Organic Cards --- */
.cause-card {
  background: #FFFFFF;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.cause-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-elevated);
  border-color: var(--color-accent-sage);
}

.cause-card-img-wrap {
  height: 240px;
  overflow: hidden;
  position: relative;
}

.cause-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.cause-card:hover .cause-card-img-wrap img {
  transform: scale(1.06);
}

/* --- Toast Notifications --- */
.recent-donation-toast {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 40;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 0.875rem 1.25rem;
  box-shadow: 0 12px 30px rgba(22, 70, 68, 0.18);
  border: 1px solid rgba(67, 146, 123, 0.25);
  display: flex;
  align-items: center;
  gap: 0.875rem;
  max-width: 340px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.recent-donation-toast.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
}

.recent-donation-toast.show {
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Floating Donate Button --- */
.floating-donate-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 45;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: #FFFFFF;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 25px rgba(22, 70, 68, 0.35);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}

.floating-donate-btn:hover {
  transform: scale(1.05) translateY(-2px);
  box-shadow: 0 12px 30px rgba(22, 70, 68, 0.45);
}

.floating-donate-btn.hidden {
  opacity: 0;
  transform: translateY(30px);
  pointer-events: none;
}

/* --- Modal Overlay & Dialog --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(15, 51, 49, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #FFFFFF;
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 520px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  text-align: center;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

/* --- Gallery Styling --- */
.gallery-filter-btn {
  background-color: var(--color-bg-surface);
  color: var(--color-text-main);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.gallery-filter-btn.active, .gallery-filter-btn:hover {
  background-color: var(--color-primary);
  color: #FFFFFF;
  border-color: var(--color-primary);
}

.gallery-item {
  transition: all 0.4s ease;
}

.gallery-item.hidden-item {
  display: none;
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
  .donation-card {
    padding: 1.5rem;
  }
  .recent-donation-toast {
    left: 1rem;
    right: 1rem;
    bottom: 5rem;
    max-width: none;
  }
  .floating-donate-btn {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
  }
}
