/* ====== FORAGERS UNITE — STYLES ====== */

:root {
  --forest: #1a3c2a;
  --forest-light: #2d5a3f;
  --forest-dark: #0f2419;
  --sage: #7a9e7e;
  --sage-light: #a8c5ab;
  --cream: #f8f5f0;
  --cream-dark: #ede8e0;
  --amber: #c4952a;
  --amber-light: #e8c36a;
  --danger: #c0392b;
  --danger-bg: #fdf0ef;
  --warning: #e67e22;
  --warning-bg: #fef8f0;
  --safe: #27ae60;
  --safe-bg: #f0faf4;
  --text: #2c2c2c;
  --text-light: #6b6b6b;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
}

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

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  line-height: 1.2;
}

/* ====== NAV ====== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(248, 245, 240, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(26, 60, 42, 0.08);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--forest);
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-icon {
  width: 28px;
  height: 28px;
  color: var(--forest);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--forest);
}

/* ====== HERO ====== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 24px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(26, 60, 42, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(122, 158, 126, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(196, 149, 42, 0.04) 0%, transparent 40%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  background: var(--forest);
  color: var(--cream);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--forest);
  margin-bottom: 20px;
  font-weight: 700;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid rgba(26, 60, 42, 0.1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--forest);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ====== BUTTONS ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--forest);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--forest-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(26, 60, 42, 0.3);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--forest);
  border: 2px solid var(--forest);
  padding: 8px 20px;
  font-size: 0.85rem;
}

.btn-outline:hover {
  background: var(--forest);
  color: var(--cream);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-large {
  padding: 18px 40px;
  font-size: 1.05rem;
  width: 100%;
  max-width: 400px;
  margin: 24px auto 0;
  display: flex;
}

.btn-text, .btn-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ====== SECTIONS ====== */
.how-section,
.identify-section,
.explore-section {
  padding: 100px 0;
}

.how-section {
  background: white;
}

.identify-section {
  background: var(--cream);
}

.results-section {
  padding: 60px 0 100px;
  background: var(--cream-dark);
}

.explore-section {
  background: white;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--forest);
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--text-light);
  max-width: 540px;
  margin: 0 auto 48px;
  font-size: 1rem;
}

/* ====== HOW IT WORKS ====== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 48px;
}

.step {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius-lg);
  background: var(--cream);
  position: relative;
}

.step-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--sage-light);
  opacity: 0.5;
  line-height: 1;
  margin-bottom: 16px;
}

.step-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--forest);
}

.step-icon svg {
  width: 100%;
  height: 100%;
}

.step h3 {
  font-size: 1.1rem;
  color: var(--forest);
  margin-bottom: 8px;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* ====== UPLOAD AREA ====== */
.upload-area {
  max-width: 600px;
  margin: 0 auto;
  border: 2px dashed var(--sage-light);
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--forest);
  background: rgba(26, 60, 42, 0.02);
}

.upload-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--sage);
}

.upload-icon svg {
  width: 100%;
  height: 100%;
}

.upload-text {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 4px;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.upload-preview {
  position: relative;
}

.upload-preview img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius);
  object-fit: contain;
}

.upload-preview .btn {
  margin-top: 16px;
}

/* ====== SPINNER ====== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(248, 245, 240, 0.3);
  border-top-color: var(--cream);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ====== RESULTS ====== */
.result-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--forest);
}

.result-badge {
  background: rgba(255,255,255,0.15);
  color: white;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
}

.danger-badge {
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.danger-badge.safe { background: var(--safe); color: white; }
.danger-badge.caution { background: var(--warning); color: white; }
.danger-badge.dangerous { background: var(--danger); color: white; }

.result-body {
  display: flex;
  gap: 32px;
  padding: 32px;
}

.result-image {
  flex: 0 0 280px;
}

.result-image img {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  aspect-ratio: 1;
}

.result-info {
  flex: 1;
}

.result-info h2 {
  text-align: left;
  font-size: 2rem;
  margin-bottom: 4px;
}

.plant-latin {
  font-style: italic;
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 16px;
}

.confidence-bar {
  position: relative;
  height: 8px;
  background: var(--cream-dark);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.confidence-fill {
  height: 100%;
  border-radius: 100px;
  background: var(--forest);
  transition: width 0.8s ease;
}

.confidence-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.plant-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.plant-tag {
  background: var(--cream);
  color: var(--forest);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
}

.plant-tag.edible { background: var(--safe-bg); color: var(--safe); }
.plant-tag.poisonous { background: var(--danger-bg); color: var(--danger); }
.plant-tag.caution { background: var(--warning-bg); color: var(--warning); }

.plant-description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

/* ====== INFO GRID ====== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.info-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.info-card h3 {
  font-size: 1rem;
  color: var(--forest);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cream-dark);
}

.info-card p, .info-card ul {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card ul li {
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.info-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
}

/* ====== LOOKALIKES ====== */
.lookalikes-section,
.related-section {
  margin-top: 40px;
}

.lookalikes-section h3,
.related-section h3 {
  font-size: 1.5rem;
  color: var(--forest);
  text-align: center;
  margin-bottom: 4px;
}

.lookalikes-grid,
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.lookalike-card,
.related-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
}

.lookalike-card:hover,
.related-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--sage-light);
}

.lookalike-card.is-dangerous {
  border-color: var(--danger);
  border-style: solid;
}

.lookalike-card.is-dangerous:hover {
  border-color: var(--danger);
}

.card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--cream-dark);
}

.category-plant-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--cream-dark);
}

.lookalike-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 4px;
}

.lookalike-latin {
  font-style: italic;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.lookalike-safety {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.lookalike-safety.safe { background: var(--safe-bg); color: var(--safe); }
.lookalike-safety.caution { background: var(--warning-bg); color: var(--warning); }
.lookalike-safety.dangerous { background: var(--danger-bg); color: var(--danger); }

.lookalike-diff {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.related-card .lookalike-name { margin-bottom: 8px; }

/* ====== EXPLORE CATEGORIES ====== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.category-card {
  background: var(--cream);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'DM Sans', sans-serif;
}

.category-card:hover {
  border-color: var(--forest);
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.cat-emoji {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.cat-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--forest);
}

/* ====== EXPLORE MORE ====== */
.explore-more {
  text-align: center;
  margin-top: 48px;
}

/* ====== FOOTER ====== */
.footer {
  background: var(--forest-dark);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 32px;
}

.footer-content {
  display: flex;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand {
  flex: 1;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-warning {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.footer-warning strong {
  color: var(--amber-light);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  font-size: 0.8rem;
}

/* ====== CATEGORY RESULTS ====== */
.category-results {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 32px;
}

.category-results h3 {
  text-align: left;
  font-size: 1.3rem;
  color: var(--forest);
  margin-bottom: 20px;
}

.category-plant-list {
  display: grid;
  gap: 16px;
}

.category-plant {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--cream);
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-plant:hover {
  background: var(--cream-dark);
  transform: translateX(4px);
}

.category-plant-info h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--forest);
  margin-bottom: 2px;
}

.category-plant-info .plant-latin {
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.category-plant-info p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 768px) {
  .nav-links { display: none; }

  .hero { min-height: 80vh; padding: 100px 20px 40px; }
  .hero-stats { flex-direction: column; gap: 16px; }

  .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

  .result-body { flex-direction: column; }
  .result-image { flex: none; }

  .info-grid { grid-template-columns: 1fr; }

  .category-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-content { flex-direction: column; gap: 24px; }

  .lookalikes-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .upload-area { padding: 32px 20px; }
}
