/* ══════════════════════════════════════════
   FOOD LOOP — Design System & Styles
   ══════════════════════════════════════════ */

/* ─── Tokens ───────────────────────────── */
:root {
  --bg-deep: #0b0f14;
  --bg-surface: #111820;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e4e8ef;
  --text-dim: #8892a4;
  --accent: #34d399;
  --accent-alt: #22d3ee;
  --accent-blue: #3b82f6;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --gradient: linear-gradient(135deg, #34d399, #22d3ee);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, sans-serif;
  --shadow-glow: 0 0 60px rgba(52, 211, 153, .15);
}

/* ─── Reset ────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── Gradient helper ──────────────────── */
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════ NAVBAR ═══════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(11, 15, 20, .75);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 90%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.25rem;
}

.logo-icon {
  font-size: 1.4rem;
}

.logo-highlight {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .25s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-cta {
  padding: 10px 22px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  background: var(--gradient);
  color: #0b0f14;
  transition: transform .2s, box-shadow .2s;
}

.nav-cta:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(52, 211, 153, .35);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
}

.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .3s;
}

/* ═══════════ HERO ═══════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px 80px;
  text-align: center;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
}

.hero-tag {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(52, 211, 153, .1);
  border: 1px solid rgba(52, 211, 153, .25);
  font-size: .8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: fadeUp .8s both;
}

.hero-title {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: 22px;
  animation: fadeUp .8s .15s both;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fadeUp .8s .3s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp .8s .45s both;
}

/* glow orbs */
.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  pointer-events: none;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -10%;
  left: -8%;
}

.glow-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-alt);
  bottom: -12%;
  right: -6%;
}

/* floating emojis */
.hero-deco {
  position: absolute;
  font-size: 2.2rem;
  opacity: .25;
  pointer-events: none;
  animation: floatEmoji 6s ease-in-out infinite alternate;
}

.deco-1 {
  top: 14%;
  left: 8%;
  animation-delay: 0s;
}

.deco-2 {
  top: 22%;
  right: 10%;
  animation-delay: 1s;
}

.deco-3 {
  bottom: 18%;
  left: 14%;
  animation-delay: 2s;
}

.deco-4 {
  bottom: 28%;
  right: 12%;
  animation-delay: .5s;
}

.deco-5 {
  top: 48%;
  left: 3%;
  animation-delay: 1.5s;
}

.deco-6 {
  top: 55%;
  right: 5%;
  animation-delay: 2.5s;
}

/* ═══════════ BUTTONS ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: transform .25s, box-shadow .25s;
}

.btn-icon {
  font-size: 1.15rem;
}

.btn-primary {
  background: var(--gradient);
  color: #0b0f14;
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 30px rgba(52, 211, 153, .35);
}

.btn-primary:disabled {
  opacity: .6;
  pointer-events: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.04);
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(52, 211, 153, .12);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-sm {
  padding: 10px 20px;
  font-size: .85rem;
  border-radius: 999px;
  width: 100%;
  justify-content: center;
  margin-top: 12px;
  background: rgba(245, 158, 11, .15);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, .25);
}

.btn-sm:hover {
  background: rgba(245, 158, 11, .25);
  transform: translateY(-2px);
}

/* ═══════════ HOW IT WORKS ═══════════ */
.how-section {
  padding: 100px 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.section-tag {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(52, 211, 153, .08);
  border: 1px solid rgba(52, 211, 153, .2);
  font-size: .75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 56px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  backdrop-filter: blur(10px);
  transition: transform .3s, border-color .3s, box-shadow .3s;
  position: relative;
}

.step-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 211, 153, .3);
  box-shadow: var(--shadow-glow);
}

.step-number {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 3.5rem;
  font-weight: 900;
  color: rgba(52, 211, 153, .07);
  line-height: 1;
}

.step-icon {
  font-size: 2.4rem;
  margin-bottom: 18px;
}

.step-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-card p {
  color: var(--text-dim);
  font-size: .92rem;
}

/* ═══════════ STATS ═══════════ */
.stats-section {
  padding: 100px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 38px 28px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}

.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 211, 153, .3);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
}

.stat-value {
  font-size: 2.6rem;
  font-weight: 900;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.stat-label {
  font-size: .88rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* ═══════════ MAP ═══════════ */
.map-section {
  padding: 100px 0 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.map-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .9rem;
  color: var(--text-dim);
  margin-bottom: 36px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.green {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.legend-dot.blue {
  background: var(--accent-blue);
  box-shadow: 0 0 8px var(--accent-blue);
}

.map-wrapper {
  width: 100%;
  height: 520px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-bottom: none;
}

#foodMap {
  width: 100%;
  height: 100%;
}

.leaflet-tile-pane {
  filter: brightness(.85) contrast(1.15) saturate(.9);
}

.leaflet-control-attribution {
  display: none !important;
}

/* ═══════════ FOOD CARDS ═══════════ */
.food-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.food-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(10px);
  transition: transform .3s, border-color .3s, box-shadow .3s, opacity .4s;
}

.food-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, .2);
  box-shadow: var(--shadow-glow);
}

.food-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.food-type-icon {
  font-size: 2rem;
}

.food-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.food-card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.food-detail {
  font-size: .88rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-icon {
  font-size: 1rem;
}

/* ─── Badges ───────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .3px;
}

.badge-available {
  background: rgba(52, 211, 153, .12);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, .25);
}

.badge-accepted {
  background: rgba(245, 158, 11, .12);
  color: var(--accent-orange);
  border: 1px solid rgba(245, 158, 11, .25);
}

.badge-delivered {
  background: rgba(148, 163, 184, .1);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, .15);
}

/* ═══════════ PAGE LAYOUT ═══════════ */
.page-main {
  padding: 120px 0 80px;
  min-height: calc(100vh - 200px);
}

.page-header {
  margin-bottom: 48px;
}

.page-desc {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 560px;
  margin-top: 12px;
}

.section-cta {
  text-align: center;
  margin-top: 40px;
}

/* ═══════════ DONATE FORM ═══════════ */
.donate-form {
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-group input {
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color .25s, box-shadow .25s;
  outline: none;
}

.form-group input::placeholder {
  color: var(--text-dim);
  opacity: .6;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .15);
}

/* ═══════════ FILTER TABS ═══════════ */
.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all .25s;
}

.filter-tab:hover {
  border-color: rgba(52, 211, 153, .3);
  color: var(--text);
}

.filter-tab.active {
  background: var(--gradient);
  color: #0b0f14;
  border-color: transparent;
}

/* ═══════════ EMPTY STATE ═══════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-dim);
}

/* ═══════════ TOAST ═══════════ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 16px 28px;
  border-radius: var(--radius-sm);
  font-size: .92rem;
  font-weight: 600;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: all .4s cubic-bezier(.16, 1, .3, 1);
  backdrop-filter: blur(12px);
  max-width: 90%;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.success {
  background: rgba(52, 211, 153, .15);
  border: 1px solid rgba(52, 211, 153, .3);
  color: var(--accent);
}

.toast.error {
  background: rgba(239, 68, 68, .15);
  border: 1px solid rgba(239, 68, 68, .3);
  color: var(--accent-red);
}

/* ═══════════ LOADING SPINNER ═══════════ */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 60px auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ═══════════ AVAILABLE SECTION (HOMEPAGE) ═══════════ */
.available-section {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: 800;
}

.footer-copy {
  font-size: .82rem;
  color: var(--text-dim);
}

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floatEmoji {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  100% {
    transform: translateY(-18px) rotate(8deg);
  }
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-cta {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(11, 15, 20, .95);
    backdrop-filter: blur(16px);
    padding: 24px 0;
    gap: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }

  .hero {
    padding: 110px 16px 60px;
  }

  .hero-title {
    font-size: 2rem;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .food-grid {
    grid-template-columns: 1fr;
  }

  .map-wrapper {
    height: 380px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}