/* Plant ID — Nature Dark Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg: #0a120a;
  --bg-card: #111c11;
  --bg-surface: #162016;
  --bg-hover: #1a2a1a;
  --border: #1e3a1e;
  --border-subtle: #162816;
  --text: #e8f0e8;
  --text-muted: #7a9a7a;
  --text-bright: #f0f8f0;
  --green: #4ade80;
  --green-dim: rgba(74,222,128,0.1);
  --green-border: rgba(74,222,128,0.2);
  --emerald: #34d399;
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36,0.1);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.1);
  --coral: #fb923c;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--green); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--emerald); }

.container { max-width: 900px; margin: 0 auto; padding: 0 1.25rem; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10,18,10,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 56px; display: flex; align-items: center;
  padding: 0 1.25rem;
}
.nav-inner { max-width: 900px; margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-weight: 700; font-size: 1.1rem; color: var(--text-bright); display: flex; align-items: center; gap: 0.5rem; }
.nav-logo .leaf { color: var(--green); }
.nav-links { display: flex; gap: 1rem; list-style: none; }
.nav-links a { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.nav-links a:hover { color: var(--text-bright); }

/* Hero */
.hero {
  text-align: center;
  padding: 5rem 1.25rem 3rem;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; left: 50%; transform: translateX(-50%);
  width: 500px; height: 400px;
  background: radial-gradient(ellipse, rgba(74,222,128,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 600; color: var(--green);
  background: var(--green-dim); border: 1px solid var(--green-border);
  padding: 5px 14px; border-radius: 20px;
  margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 0.03em;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800; line-height: 1.1;
  margin-bottom: 1.25rem; letter-spacing: -0.04em;
}
.hero h1 .accent { color: var(--green); }
.hero-sub {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 500px; margin: 0 auto 2.5rem; line-height: 1.6;
}

/* Upload Zone */
.upload-zone {
  max-width: 520px; margin: 0 auto;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
  background: var(--bg-card);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--green);
  background: var(--green-dim);
}
.upload-zone .uz-icon { margin-bottom: 1rem; color: var(--green); }
.upload-zone .uz-text { font-size: 1rem; font-weight: 600; margin-bottom: 0.35rem; }
.upload-zone .uz-sub { font-size: 0.82rem; color: var(--text-muted); }
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-zone .uz-or { display: block; margin: 1rem 0; font-size: 0.78rem; color: var(--text-muted); }
.camera-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 10px 20px; background: var(--green); color: var(--bg);
  font-weight: 600; font-size: 0.9rem; border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
}
.camera-btn:hover { background: var(--emerald); }

/* Loading / Processing */
.processing { display: none; text-align: center; padding: 3rem 1rem; }
.processing.active { display: block; }
.spinner {
  width: 48px; height: 48px; border: 3px solid var(--border);
  border-top-color: var(--green); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results */
.result { display: none; max-width: 600px; margin: 0 auto; }
.result.active { display: block; }
.result-header {
  text-align: center; padding: 2rem 0;
}
.result-header .common-name { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
.result-header .sci-name { font-style: italic; color: var(--text-muted); font-size: 0.95rem; margin-top: 0.25rem; }
.result-header .plant-type {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 600; color: var(--green);
  background: var(--green-dim); border: 1px solid var(--green-border);
  padding: 3px 12px; border-radius: 12px; margin-top: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.confidence-badge {
  display: inline-flex; margin-left: 0.5rem;
  font-size: 0.65rem; padding: 2px 8px; border-radius: 10px; font-weight: 600;
}
.confidence-badge.high { background: var(--green-dim); color: var(--green); }
.confidence-badge.medium { background: var(--amber-dim); color: var(--amber); }
.confidence-badge.low { background: var(--red-dim); color: var(--red); }

.result-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem;
}
.result-card h3 {
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.result-card h3 svg { color: var(--green); }
.result-card p { font-size: 0.9rem; color: var(--text); line-height: 1.7; }

.care-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.75rem;
}
.care-item {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm); padding: 0.85rem;
}
.care-item .cl { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.25rem; }
.care-item .cv { font-size: 0.85rem; font-weight: 600; }

.toxicity-safe { color: var(--green); }
.toxicity-danger { color: var(--red); }
.toxicity-mild { color: var(--amber); }

.fun-fact {
  background: var(--green-dim); border: 1px solid var(--green-border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
  font-size: 0.9rem; line-height: 1.6;
}
.fun-fact strong { color: var(--green); }

.try-again {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 12px 24px; background: var(--green); color: var(--bg);
  font-weight: 700; font-size: 0.95rem; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
  margin: 1.5rem auto; transition: background var(--transition);
}
.try-again:hover { background: var(--emerald); }

/* Feature cards */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 3rem auto; max-width: 900px; padding: 0 1.25rem; }
.feat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: border-color var(--transition); }
.feat-card:hover { border-color: var(--green-border); }
.feat-card .fi { margin-bottom: 0.75rem; color: var(--green); }
.feat-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.feat-card p { font-size: 0.82rem; color: var(--text-muted); line-height: 1.6; }

/* FAQ */
.faq-section { max-width: 680px; margin: 3rem auto; padding: 0 1.25rem; }
.faq-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; background: none; border: none; text-align: left;
  padding: 1rem 0; color: var(--text-bright); font-size: 0.92rem;
  font-weight: 600; cursor: pointer; font-family: var(--font);
  display: flex; justify-content: space-between; align-items: center;
}
.faq-q:hover { color: var(--green); }
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); transition: transform 0.2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); color: var(--green); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { color: var(--text-muted); font-size: 0.85rem; line-height: 1.7; padding-bottom: 1rem; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 2rem 1.25rem; max-width: 900px; margin: 4rem auto 0; text-align: center; }
.footer-tools { margin-bottom: 1.5rem; }
.footer-tools-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.75rem; }
.footer-tools-links { display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center; font-size: 0.85rem; }
.footer-tools-links a { color: var(--green); font-weight: 600; }
.footer-tools-links a span { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; }
.footer-copy { font-size: 0.75rem; color: var(--text-muted); margin-top: 1rem; }

@media (max-width: 768px) {
  .features { grid-template-columns: 1fr; }
  .care-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .hero { padding: 3.5rem 1rem 2rem; }
  .upload-zone { padding: 2rem 1.25rem; }
  .care-grid { grid-template-columns: 1fr; }
}
