/* =========================================================================
   CORE STYLING FOR AAJAY'S 40TH BIRTHDAY TRAIN CONTRIBUTION APP
   Visual Theme: West Coast Nature, Sleek, Bright, & Train-Themed
   ========================================================================= */

/* 1. Design Tokens & Root Variables */
:root {
  /* Nature Colors (Sleek, Bright, Harmonious) */
  --color-primary: #1b4332;       /* Deep Pine Green */
  --color-primary-light: #2d6a4f; /* Bright Sequoia Green */
  --color-primary-soft: #d8f3dc;  /* Pastel Sage Green */
  
  --color-accent: #f77f00;        /* Sunset Orange */
  --color-accent-bright: #fcbf49; /* Golden Hour Yellow */
  --color-accent-dark: #d62828;   /* Redwood Red */
  
  --color-sky-blue: #00b4d8;      /* Pacific Ocean Blue */
  --color-sky-light: #caf0f8;     /* Coastal Mist Blue */
  
  --color-dark: #0f172a;          /* Slate Charcoal */
  --color-light: #f8fafc;         /* Crisp White */
  --color-cream: #fdfaf2;         /* Vintage Ticket Cream */
  
  /* Layout & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(27, 67, 50, 0.12), 0 8px 10px -6px rgba(27, 67, 50, 0.12);
  
  /* Fonts */
  --font-family-sans: 'Outfit', sans-serif;
  --font-family-serif: 'Playfair Display', serif;
}

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

body {
  font-family: var(--font-family-sans);
  background-color: #f1f5f9; /* Warm grey body background */
  /* Topographic traveler map dot-grid texture */
  background-image: radial-gradient(rgba(27, 67, 50, 0.04) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  color: var(--color-dark);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* 3. Background Decor (Mountains, Trees, Sunrise Glow) */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* Sunset gradient glow in the top-right corner */
  background: radial-gradient(circle at 85% 15%, rgba(254, 243, 199, 0.4) 0%, rgba(241, 245, 249, 0) 65%);
}

.mountain {
  position: absolute;
  bottom: 0;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Layer 1: Distant sun-kissed peaks */
.mountain-distant-1 {
  left: 15%;
  width: 60%;
  height: 60vh;
  background: linear-gradient(180deg, rgba(247, 127, 0, 0.02) 0%, rgba(252, 191, 73, 0.05) 100%);
}

.mountain-distant-2 {
  right: 5%;
  width: 50%;
  height: 50vh;
  background: linear-gradient(180deg, rgba(247, 127, 0, 0.015) 0%, rgba(252, 191, 73, 0.04) 100%);
}

/* Layer 2: Midground Sequoia ridges */
.mountain-mid-left {
  left: -15%;
  width: 55%;
  height: 40vh;
  background: linear-gradient(180deg, rgba(45, 106, 79, 0.04) 0%, rgba(27, 67, 50, 0.08) 100%);
}

.mountain-mid-right {
  right: -10%;
  width: 50%;
  height: 33vh;
  background: linear-gradient(180deg, rgba(45, 106, 79, 0.03) 0%, rgba(27, 67, 50, 0.07) 100%);
}

/* Layer 3: Foreground foothills */
.mountain-fore-left {
  left: 5%;
  width: 30%;
  height: 22vh;
  background: linear-gradient(180deg, rgba(27, 67, 50, 0.06) 0%, rgba(15, 37, 28, 0.12) 100%);
}

.mountain-fore-right {
  right: 20%;
  width: 35%;
  height: 18vh;
  background: linear-gradient(180deg, rgba(27, 67, 50, 0.05) 0%, rgba(15, 37, 28, 0.1) 100%);
}

/* 4. App Container */
.app-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 5. Header / Hero Section */
.hero-header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInDown 0.8s ease-out;
}

.celebration-badge {
  display: inline-flex;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: white;
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 2px;
  box-shadow: 0 4px 10px rgba(247, 127, 0, 0.3);
  margin-bottom: 20px;
  transform: rotate(-1.5deg);
  transition: transform 0.3s ease;
}

.celebration-badge:hover {
  transform: rotate(0deg) scale(1.05);
}

.hero-title {
  font-family: var(--font-family-serif);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 15px;
}

.accent-text {
  color: var(--color-accent);
  font-style: italic;
  font-family: var(--font-family-serif);
  font-weight: 600;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: #475569;
  max-width: 750px;
  margin: 0 auto;
  font-weight: 300;
}

/* 6. Overall Tracker Card (Train Track!) */
.overall-tracker-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-lg);
  padding: 35px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 60px;
  position: relative;
  overflow: visible;
  animation: fadeInUp 0.8s ease-out;
}

.card-header {
  margin-bottom: 30px;
}

.card-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--color-accent);
  text-transform: uppercase;
}

.card-title {
  font-family: var(--font-family-serif);
  font-size: 2rem;
  color: var(--color-primary);
}

/* The Train Track Container */
.train-track-container {
  position: relative;
  padding: 50px 20px 40px 20px;
  margin-bottom: 25px;
  background: rgba(241, 245, 249, 0.5);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(27, 67, 50, 0.1);
}

.train-track {
  position: relative;
  height: 6px;
  background-color: #cbd5e1; /* Track sleeper line base */
  border-radius: 10px;
  /* Dotted railroad ties look */
  background-image: repeating-linear-gradient(90deg, #94a3b8 0px, #94a3b8 2px, transparent 2px, transparent 12px);
}

.track-progress-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light) 0%, var(--color-sky-blue) 100%);
  border-radius: 10px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* Milestones along the track */
.milestone {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  text-align: center;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
}

/* Beautiful Tooltips */
.milestone::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background-color: var(--color-dark);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-md);
  z-index: 10;
  pointer-events: none;
}

.milestone::before {
  content: '';
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: var(--color-dark) transparent transparent;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  pointer-events: none;
}

.milestone:hover::after,
.milestone:hover::before,
.milestone:focus-visible::after,
.milestone:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.milestone-dot {
  display: block;
  width: 14px;
  height: 14px;
  background-color: white;
  border: 3px solid var(--color-primary-light);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.milestone:hover .milestone-dot,
.milestone:focus-visible .milestone-dot {
  background-color: var(--color-accent-bright);
  transform: scale(1.3);
}

.milestone:focus-visible {
  outline: none;
}

.milestone:focus-visible .milestone-dot {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

.milestone-label {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  transition: color 0.3s ease;
}

.milestone:hover .milestone-label {
  color: var(--color-primary);
}

/* Train Locomotive Icon on the track */
.train-locomotive {
  position: absolute;
  top: -24px;
  transform: translateX(-50%);
  z-index: 3;
  transition: left 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-accent);
}

.train-icon {
  font-size: 2.2rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
  animation: trainJiggle 0.4s infinite alternate;
}

/* Steam Animation */
.steam-chimney {
  position: absolute;
  top: -2px;
  right: 6px;
  width: 4px;
  height: 4px;
}

.steam-bubble {
  position: absolute;
  background: rgba(226, 232, 240, 0.8);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.bubble-1 {
  width: 8px;
  height: 8px;
  top: -8px;
  right: 4px;
  animation: puffSteam 1.6s infinite ease-out;
}

.bubble-2 {
  width: 12px;
  height: 12px;
  top: -15px;
  right: 0px;
  animation: puffSteam 1.6s infinite ease-out 0.8s;
}

/* Stats Row */
.funding-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  border-top: 1px solid rgba(27, 67, 50, 0.08);
  padding-top: 25px;
}

.stat-box {
  text-align: center;
  flex: 1;
  min-width: 150px;
}

.stat-val {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary);
}

.stat-lbl {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background-color: rgba(27, 67, 50, 0.08);
}

@media (max-width: 640px) {
  .stat-divider {
    display: none;
  }
  .funding-stats {
    flex-direction: column;
    gap: 15px;
  }
}

/* 7. Activities Section */
.activities-section {
  margin-bottom: 60px;
}

.section-header {
  text-align: center;
  margin-bottom: 35px;
}

.section-title {
  font-family: var(--font-family-serif);
  font-size: 2.2rem;
  color: var(--color-primary);
  margin-bottom: 10px;
}

.section-subtitle {
  color: #64748b;
  font-size: 1rem;
}

/* Loader */
.loading-spinner {
  text-align: center;
  padding: 40px;
  font-size: 1.1rem;
  color: var(--color-primary-light);
}
.loading-spinner i {
  margin-right: 8px;
}

/* Grid of Activities */
.activities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* Activity Card */
.activity-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(27, 67, 50, 0.04);
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.activity-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.card-img-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.activity-card:hover .card-img-wrapper img {
  transform: scale(1.08);
}

.category-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: white;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Category colors */
.badge-transportation { background-color: var(--color-sky-blue); }
.badge-lodging { background-color: var(--color-accent-dark); }
.badge-dining { background-color: #8338ec; }
.badge-excursion { background-color: var(--color-accent); }
.badge-general { background-color: var(--color-primary-light); }

.card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.activity-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.activity-desc {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 20px;
  flex-grow: 1;
  font-weight: 300;
}

/* Card Progress Bar */
.card-progress-wrapper {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #64748b;
}

.progress-pct {
  color: var(--color-primary);
  font-weight: 700;
}

.progress-bar-rail {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent-bright) 50%, var(--color-primary-light));
  background-size: 200% auto;
  border-radius: 10px;
  transition: width 1s ease-in-out;
  animation: progressShimmer 4s linear infinite;
}

@keyframes progressShimmer {
  0% { background-position: 0% center; }
  100% { background-position: -200% center; }
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 18px;
}

.funding-details {
  display: flex;
  flex-direction: column;
}

.fund-raised {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
}

.fund-goal {
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Button Classes */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  font-family: var(--font-family-sans);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: white;
  box-shadow: 0 4px 6px -1px rgba(247, 127, 0, 0.2);
}

.btn-primary:hover {
  background-color: #e07200;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px -2px rgba(247, 127, 0, 0.3);
}

.btn-secondary {
  background-color: #e2e8f0;
  color: #475569;
}

.btn-secondary:hover {
  background-color: #cbd5e1;
}

.btn-block {
  width: 100%;
  padding: 12px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Fully funded status badge in card */
.funded-badge {
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 8. Gratitude Section & Tickets Board */
.gratitude-section {
  margin-bottom: 60px;
}

.tickets-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

/* Ticket Aesthetic Board */
/* 8. Passenger Train Board styling */
.train-board-wrapper {
  width: 100%;
  overflow: hidden;
  height: 340px; /* Taller height to prevent vertical tooltip cutoff */
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: var(--shadow-md);
  margin-bottom: 30px;
  position: relative;
}

.train-board-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.train-assembly {
  display: flex;
  align-items: flex-end;
  position: absolute;
  bottom: 25px; /* Sits just above track sleepers */
  left: 0;
  width: max-content;
  z-index: 2;
  /* Looping translation animation */
  animation: trainScrollLoop 30s linear infinite;
}

/* Pause train and wheels when user hovers to read wishes */
.train-board-wrapper:hover .train-assembly,
.train-board-wrapper:hover .carriage-wheel {
  animation-play-state: paused;
}

@keyframes trainScrollLoop {
  0% {
    transform: translate3d(-100%, 0, 0);
  }
  100% {
    transform: translate3d(100vw, 0, 0);
  }
}

.track-sleeper-line {
  height: 8px;
  background-color: #64748b;
  background-image: repeating-linear-gradient(90deg, #475569 0px, #475569 4px, transparent 4px, transparent 18px);
  border-radius: 4px;
  width: 100%;
  position: absolute;
  bottom: 21px; /* Aligned under the wheels */
  left: 0;
  z-index: 1;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* The Locomotive (Engine) cab */
.train-locomotive-front {
  position: relative;
  width: 140px;
  height: 70px;
  background-color: var(--color-primary);
  border-radius: 12px 28px 4px 4px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.2), 0 4px 6px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 8px;
  flex-shrink: 0;
  animation: carriageChug 0.25s ease-in-out infinite alternate;
  z-index: 5;
}

/* Engine detail elements */
.locomotive-cab-window {
  position: absolute;
  top: 15px;
  left: 20px;
  width: 26px;
  height: 22px;
  background-color: #fef08a;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(254, 240, 138, 0.6);
  border: 1px solid #e2e8f0;
}

.locomotive-cowcatcher {
  position: absolute;
  bottom: 0;
  right: -12px;
  width: 16px;
  height: 20px;
  background-color: #334155;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.locomotive-chimney {
  position: absolute;
  top: -15px;
  right: 32px;
  width: 12px;
  height: 18px;
  background-color: #1e293b;
  border-radius: 2px 2px 0 0;
}

.locomotive-chimney::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  width: 16px;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px;
}

/* Big steam clouds for locomotive */
.steam-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.steam-1 {
  width: 14px;
  height: 14px;
  top: -22px;
  right: 30px;
  animation: steamRise 1.8s infinite ease-out;
}
.steam-2 {
  width: 20px;
  height: 20px;
  top: -35px;
  right: 25px;
  animation: steamRise 1.8s infinite ease-out 0.9s;
}
@keyframes steamRise {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: translateY(-35px) translateX(-12px) scale(1.6); opacity: 0; }
}

/* Passenger Carriages */
.train-carriage-car {
  position: relative;
  width: 120px;
  height: 52px;
  border-radius: 6px 6px 2px 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.25), 0 3px 5px rgba(0,0,0,0.1);
  margin-right: 12px; /* gap for coupling connector */
  flex-shrink: 0;
  animation: carriageChug 0.25s ease-in-out infinite alternate;
}

/* Coupler connection line */
.train-carriage-car::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: -13px;
  width: 14px;
  height: 4px;
  background-color: #475569;
}

/* Rotating wheels on everything */
.carriage-wheel {
  position: absolute;
  bottom: -10px;
  width: 18px;
  height: 18px;
  background-color: #1e293b;
  border: 2px dashed #94a3b8;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  animation: wheelRotate 1.2s linear infinite;
  z-index: 10;
}
.wheel-left { left: 16px; }
.wheel-right { right: 16px; }

@keyframes wheelRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes carriageChug {
  0% { transform: translateY(0); }
  100% { transform: translateY(-1.5px); }
}

/* Category Specific Carriage Body Colors */
.carriage-body-element {
  width: 100%;
  height: 100%;
  border-radius: 6px 6px 2px 2px;
  border-bottom: 4px solid rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carriage-transportation .carriage-body-element { background-color: var(--color-sky-blue); }
.carriage-lodging .carriage-body-element { background-color: var(--color-accent-dark); }
.carriage-dining .carriage-body-element { background-color: #8338ec; }
.carriage-excursion .carriage-body-element { background-color: var(--color-accent); }
.carriage-general .carriage-body-element { background-color: var(--color-primary-light); }

/* Windows of carriages */
.carriage-window {
  width: 12px;
  height: 14px;
  background-color: #faeed1;
  border-radius: 3px;
  position: absolute;
  top: 10px;
  border: 1px solid rgba(0,0,0,0.15);
}
.window-1 { left: 12px; }
.window-2 { right: 12px; }

/* Contributor's stencil lettering inside carriage */
.carriage-stencil-label {
  font-size: 0.52rem; /* Slightly smaller for fitting wrapped words */
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  max-width: 68px; /* Fits exactly between the windows */
  overflow: hidden;
  white-space: normal; /* Allow wrapping */
  word-break: break-word;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit to 3 lines max */
  -webkit-box-orient: vertical;
  font-family: monospace;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 1px 3px;
  border-radius: 3px;
  background-color: rgba(0,0,0,0.12);
  z-index: 5;
}

/* Passenger Birds perched on roof */
.passenger-bird-perch {
  position: absolute;
  top: -38px; /* shifted up slightly to center the bird visually at the original spot */
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Reset button styles & Tap target optimization */
  background: none;
  border: none;
  padding: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.passenger-bird-perch:hover {
  transform: translateX(-50%) scale(1.3);
}

.passenger-bird-perch:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 50%;
  transform: translateX(-50%) scale(1.3);
}

.passenger-bird-image {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
  animation: birdBob 1.2s infinite alternate;
}

@keyframes birdBob {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-2px) rotate(2deg); }
  100% { transform: translateY(0) rotate(-2deg); }
}

/* Per-bird tooltip popup */
.bird-tooltip {
  position: absolute;
  bottom: 48px; /* adjusted from 35px since perch height is now 48px */
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: var(--color-cream);
  color: var(--color-dark);
  border: 2px solid #e9dfc6;
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  width: 240px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 1000;
  text-align: left;
}

.bird-tooltip::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0;
  border-style: solid;
  border-color: #e9dfc6 transparent transparent;
}

/* Hovering over bird shows tooltip */
.passenger-bird-perch:hover .bird-tooltip,
.passenger-bird-perch:focus-within .bird-tooltip,
.passenger-bird-perch.active .bird-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip internal elements */
.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.tooltip-name {
  font-family: var(--font-family-serif);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-primary);
}

.tooltip-amount {
  font-size: 0.75rem;
  font-weight: 700;
  background-color: #faeed1;
  border: 1px solid #e2d2ae;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--color-primary-light);
}

.tooltip-divider {
  border: 0;
  border-top: 1px dashed #cbd5e1;
  margin: 6px 0;
}

.tooltip-wish {
  font-size: 0.8rem;
  font-style: italic;
  color: #475569;
  line-height: 1.3;
  margin-bottom: 6px;
  white-space: normal; /* wrap text */
}

.tooltip-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
}

.empty-feed-msg {
  text-align: center;
  padding: 50px;
  background-color: white;
  border-radius: var(--radius-md);
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

/* 9. Footer Styling */
.app-footer {
  text-align: center;
  padding: 40px 0 20px 0;
  border-top: 1px solid #cbd5e1;
  color: #64748b;
  font-size: 0.85rem;
}

.footer-note {
  margin-top: 5px;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* 10. Modern native dialog modal styling */
.modern-dialog {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  background: white;
  max-width: 580px;
  width: 90%;
  margin: auto; /* Centered natively vertically and horizontally by the browser */
  overflow: hidden;
}

.modern-dialog[open] {
  animation: dialogAppear 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dialogAppear {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modern-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeInBackdrop 0.3s ease-out;
}

.dialog-content {
  position: relative;
  padding: 35px;
}

.close-dialog-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f1f5f9;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s ease;
}

.close-dialog-btn:hover {
  background: #e2e8f0;
  color: var(--color-dark);
  transform: scale(1.05);
}

.close-dialog-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.dialog-header {
  margin-bottom: 25px;
  padding-right: 20px;
}

.dialog-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.dialog-title {
  font-family: var(--font-family-serif);
  font-size: 1.8rem;
  color: var(--color-primary);
  line-height: 1.2;
}

.dialog-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 5px;
  font-weight: 300;
}

/* Multi-step progress tracker */
.modal-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.step-dot.active {
  background-color: var(--color-primary-light);
  color: white;
  box-shadow: 0 0 0 4px var(--color-primary-soft);
}

.step-dot.completed {
  background-color: var(--color-primary);
  color: white;
}

.step-line {
  height: 3px;
  background-color: #e2e8f0;
  flex-grow: 1;
  max-width: 60px;
  margin: 0 10px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}

.form-group label .note {
  font-size: 0.75rem;
  font-weight: 400;
  color: #94a3b8;
}

.form-group label .required {
  color: var(--color-accent-dark);
}

.input-with-icon {
  position: relative;
}

.input-with-icon i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.input-with-icon input,
textarea {
  width: 100%;
  padding: 14px 16px 14px 42px;
  min-height: 48px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font-family-sans);
  color: var(--color-dark);
  transition: all 0.2s ease;
  background-color: #f8fafc;
}

textarea {
  padding-left: 16px;
  min-height: 80px;
  resize: vertical;
}

.input-with-icon input:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary-light);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

/* Preset Amount Selection Grid */
.preset-amount-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.preset-btn {
  background-color: #f1f5f9;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 10px 5px;
  min-height: 48px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family-sans);
}

.preset-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.preset-btn:hover {
  background-color: #e2e8f0;
}

.preset-btn.selected {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary-light);
  color: var(--color-primary);
}

.amount-input-container {
  position: relative;
}

.currency-prefix {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--color-primary);
}

.amount-input-container input {
  padding-left: 32px;
}

.form-group-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 15px 0 25px 0;
}

.form-group-checkbox input[type="checkbox"] {
  margin-top: 4px;
  cursor: pointer;
}

.form-group-checkbox label {
  font-size: 0.8rem;
  color: #64748b;
  user-select: none;
  cursor: pointer;
}

/* Error States */
.error-msg {
  display: none;
  color: var(--color-accent-dark);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 5px;
}

.form-group.has-error input {
  border-color: var(--color-accent-dark);
  background-color: #fff5f5;
}

.form-group.has-error .error-msg {
  display: block;
}

/* Step 2 Payment Layout */
.payment-intro {
  text-align: center;
  background-color: var(--color-primary-soft);
  border-radius: var(--radius-sm);
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid rgba(45, 106, 79, 0.1);
  color: var(--color-primary);
}

.payment-sub {
  font-size: 0.8rem;
  color: #2d6a4f;
  margin-top: 4px;
}

.payment-methods-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.tab-btn {
  flex: 1;
  padding: 10px 5px;
  min-height: 48px;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-sm);
  background-color: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-family-sans);
  text-align: center;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.tab-btn:hover {
  background-color: #cbd5e1;
}

.tab-btn.active {
  background-color: var(--color-dark);
  border-color: var(--color-dark);
  color: white;
}

.payment-instruction-box {
  background-color: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-bottom: 25px;
  text-align: center;
}

.qr-code-img {
  max-width: 150px;
  max-height: 150px;
  margin: 10px auto;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  display: block;
}

.pay-handle-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-dark);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: white;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  margin: 10px 0;
}

.pay-btn-link {
  display: inline-flex;
  margin-top: 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  margin-top: 10px;
}

/* Step 3 Success screen */
.success-screen {
  text-align: center;
  padding: 20px 0;
}

.success-icon-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px auto;
}

.success-icon-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-primary-soft);
  border-radius: 50%;
  animation: scaleUp 0.5s ease-out;
}

.success-ticket-icon {
  position: relative;
  font-size: 2.5rem;
  line-height: 80px;
  color: var(--color-primary-light);
  z-index: 2;
  animation: floatCheck 0.6s ease-out 0.2s forwards;
  opacity: 0;
  transform: translateY(10px) rotate(-10deg);
}

.success-title {
  font-family: var(--font-family-serif);
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

.success-desc {
  font-size: 0.95rem;
  color: #475569;
  max-width: 400px;
  margin: 0 auto 25px auto;
}

.receipt-card {
  background-color: var(--color-cream);
  border: 1px solid #e9dfc6;
  border-radius: var(--radius-sm);
  padding: 20px;
  max-width: 400px;
  margin: 0 auto 25px auto;
  text-align: left;
  position: relative;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.receipt-row:last-child {
  margin-bottom: 0;
  border-top: 1px dashed #cbd5e1;
  padding-top: 8px;
  margin-top: 8px;
}

.receipt-lbl {
  color: #64748b;
  font-weight: 600;
}

.receipt-val {
  color: var(--color-dark);
  font-weight: 700;
}

.status-badge-pending {
  background-color: #fef3c7;
  color: #d97706;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.success-footer {
  font-size: 0.8rem;
  color: #64748b;
  max-width: 380px;
  margin: 0 auto;
}

/* Animations */
@keyframes trainJiggle {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-1.5px) rotate(1deg); }
}

@keyframes puffSteam {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }
  20% {
    opacity: 0.8;
  }
  100% {
    transform: translateY(-25px) translateX(-10px) scale(1.8);
    opacity: 0;
  }
}

@keyframes fadeInBackdrop {
  from { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
}

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

@keyframes floatCheck {
  to {
    opacity: 1;
    transform: translateY(0) rotate(-15deg);
  }
}

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

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 11. Confetti Animations for Success Screen */
.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.confetti-particle {
  position: absolute;
  top: -15px;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 1;
  animation: fallAndSpin 3.5s linear forwards;
}

@keyframes fallAndSpin {
  0% {
    transform: translateY(0) rotate(0deg) translateX(0);
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(500px) rotate(900deg) translateX(15px);
    opacity: 0;
  }
}

/* 12. Mobile Responsiveness & Swipeable Carousels */
@media (max-width: 768px) {
  /* Scale headings down for smaller mobile screens */
  .hero-title {
    font-size: 2.3rem;
  }
  .section-title {
    font-size: 1.7rem;
  }
  
  /* Horizontal scroll snapping for Activities Grid */
  .activities-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 20px;
    padding: 10px 20px 25px 20px;
    margin: 0 -20px; /* Bleed to the edges of the screen */
    width: calc(100% + 40px); /* Center perfectly and bleed edge-to-edge */
    scrollbar-width: none; /* Hide standard scrollbar */
  }
  .activities-grid::-webkit-scrollbar {
    display: none;
  }
  .activities-grid .activity-card {
    min-width: 290px;
    width: 85%;
    scroll-snap-align: center;
  }

  /* Horizontal scroll for Train Board on mobile */
  .train-board-wrapper {
    padding: 35px 15px 15px 15px;
    margin: 0 -20px;
    width: calc(100% + 40px); /* Center perfectly and bleed edge-to-edge */
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  
  /* Add visual swipe hint text indicator */
  .activities-section::after,
  .gratitude-section::after {
    content: 'Swipe to explore ↔';
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulseHint 2s infinite alternate;
  }
  
  @keyframes pulseHint {
    from { opacity: 0.4; }
    to { opacity: 0.9; }
  }
}

/* 13. Screen-Wide Smoke Puffs from Locomotive */
.global-smoke-puff {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 100000; /* Float over EVERYTHING on the page */
  filter: blur(3.5px);
  animation: globalSmokeRise 3.5s cubic-bezier(0.1, 0.7, 0.3, 1) forwards;
}

@keyframes globalSmokeRise {
  0% {
    transform: translateY(0) scale(0.4) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.75;
  }
  100% {
    transform: translateY(-300px) translateX(var(--drift-x, -25px)) scale(3.8) rotate(120deg);
    opacity: 0;
  }
}

/* 14. Overall Contribute Button and Category Filters */
.overall-contribute-container {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.contribute-overall-btn {
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(247, 127, 0, 0.25);
}

.category-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 25px;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(27, 67, 50, 0.15);
  color: var(--color-primary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--color-primary-light);
}

.filter-btn.active {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.2);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
