/* StrainCompass dashboard - dark theme with emerald accent */

:root {
  --bg: #0a0a0f;
  --bg-elev: #111118;
  --bg-elev-2: #16161f;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e7e7ea;
  --text-dim: #a1a1aa;
  --text-faint: #6b6b75;
  --accent: #10b981;
  --accent-dim: #059669;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --indica: #a78bfa;
  --sativa: #f59e0b;
  --hybrid: #10b981;
  --cbd: #38bdf8;
  --radius: 14px;
  --radius-lg: 22px;
  --max: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1.5rem;
  padding-top: 0.85rem; padding-bottom: 0.85rem;
}
.logo { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; }
.logo:hover { color: inherit; }
.logo-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--accent); color: #000;
  border-radius: 9px; font-size: 13px; font-weight: 900;
  letter-spacing: -0.5px;
}
.logo-text { font-size: 1.1rem; }

.header-search {
  flex: 1; max-width: 540px;
  display: flex; align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 0.6rem 0 0.95rem;
}
.header-search:focus-within { border-color: var(--accent); }
.header-search input {
  flex: 1; border: none; background: transparent;
  padding: 0.7rem 0; outline: none; font-size: 0.95rem;
}
.header-search button {
  background: var(--accent); border: none; color: #000;
  padding: 0.5rem 0.7rem; border-radius: 9px;
  display: grid; place-items: center; cursor: pointer;
}
.header-search button:hover { background: #34d399; }

.header-nav { display: flex; gap: 1.4rem; font-size: 0.9rem; font-weight: 600; }
.header-nav .badge {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 9px; font-size: 0.7rem; font-weight: 700; margin-left: 0.25rem;
}
.header-nav .badge.zero { display: none; }

/* ===== Footer ===== */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; max-width: 800px; }

/* ===== Main / sections ===== */
.site-main { padding-top: 2rem; padding-bottom: 2rem; }
section { margin-bottom: 3rem; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 0.6rem; }
h2 { font-size: 1.4rem; margin: 0 0 1.2rem; }
h3 { font-size: 1.1rem; margin: 0 0 0.7rem; }
.lead { color: var(--text-dim); font-size: 1.15rem; margin: 0 0 2rem; max-width: 720px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.2rem; gap: 1rem; }
.section-title h2 { margin: 0; }
.section-title a { color: var(--text-dim); font-size: 0.9rem; }
.section-title a:hover { color: var(--accent); }

/* ===== Hero ===== */
.hero {
  background: radial-gradient(ellipse at top, rgba(16, 185, 129, 0.12), transparent 60%), var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  margin-bottom: 3rem;
}
.hero p { color: var(--text-dim); font-size: 1.1rem; margin: 0.5rem 0 1.6rem; }
.hero-search {
  max-width: 600px; margin: 0 auto;
  display: flex; gap: 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 0.45rem 0.45rem 0.45rem 1.2rem;
}
.hero-search:focus-within { border-color: var(--accent); }
.hero-search input {
  flex: 1; border: none; background: transparent;
  outline: none; font-size: 1.05rem;
}
.hero-search button {
  background: var(--accent); color: #000; border: none;
  padding: 0.7rem 1.4rem; border-radius: 10px;
  font-weight: 700; cursor: pointer;
}
.hero-search button:hover { background: #34d399; }

/* ===== Type tiles ===== */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.type-tile {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: all 0.15s;
}
.type-tile:hover { background: var(--bg-elev-2); border-color: var(--border-strong); transform: translateY(-2px); color: inherit; }
.type-tile .name { font-size: 1.4rem; font-weight: 800; }
.type-tile .count { color: var(--text-dim); font-size: 0.9rem; }
.type-tile.indica .name { color: var(--indica); }
.type-tile.sativa .name { color: var(--sativa); }
.type-tile.hybrid .name { color: var(--hybrid); }
.type-tile.cbd .name { color: var(--cbd); }

/* ===== Chips ===== */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 600;
  transition: all 0.12s;
}
.chip:hover { background: var(--bg-elev-2); color: var(--text); border-color: var(--border-strong); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chip .count { color: var(--text-faint); font-weight: 500; }

/* ===== Strain card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.strain-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: all 0.15s;
  position: relative;
}
.strain-card:hover { background: var(--bg-elev-2); border-color: var(--border-strong); transform: translateY(-2px); color: inherit; }
.strain-card .type-badge {
  position: absolute; top: 0.85rem; right: 0.85rem;
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase;
  padding: 0.2rem 0.5rem; border-radius: 999px;
  letter-spacing: 0.04em;
}
.type-badge.indica { background: rgba(167, 139, 250, 0.14); color: var(--indica); }
.type-badge.sativa { background: rgba(245, 158, 11, 0.14); color: var(--sativa); }
.type-badge.hybrid { background: rgba(16, 185, 129, 0.14); color: var(--hybrid); }
.type-badge.cbd    { background: rgba(56, 189, 248, 0.14); color: var(--cbd); }
.strain-card .name { font-weight: 800; font-size: 1.05rem; padding-right: 4.5rem; }
.strain-card .breeder { color: var(--text-faint); font-size: 0.8rem; margin-top: -0.25rem; }
.strain-card .stats { display: flex; gap: 0.8rem; color: var(--text-dim); font-size: 0.8rem; margin-top: 0.4rem; }
.strain-card .stats strong { color: var(--text); }
.strain-card .effects { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.3rem; }
.strain-card .effects span {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem; color: var(--text-dim);
}

/* ===== Strain detail ===== */
.strain-hero {
  background: radial-gradient(ellipse at top left, rgba(16, 185, 129, 0.12), transparent 50%), var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  margin-bottom: 2rem;
  position: relative;
}
.breadcrumbs { color: var(--text-faint); font-size: 0.85rem; margin-bottom: 1rem; }
.breadcrumbs a:hover { color: var(--accent); }
.strain-hero h1 { margin: 0 0 0.4rem; font-size: clamp(2rem, 5vw, 3.2rem); }
.strain-hero .breeder { color: var(--text-dim); font-size: 1.05rem; margin: 0 0 1.5rem; }
.strain-hero .breeder span { color: var(--accent); }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.stat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}
.stat-card .label { color: var(--text-faint); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.stat-card .value { font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.stat-card .value.dim { color: var(--text-faint); font-size: 1rem; font-weight: 600; }

.strain-actions {
  display: flex; gap: 0.6rem; margin-top: 1.6rem; flex-wrap: wrap;
}
.btn {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 0.65rem 1.1rem;
  border-radius: 10px;
  font-weight: 700; font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.btn:hover { background: var(--bg-elev-2); border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.primary:hover { background: #34d399; color: #000; }
.btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 880px) {
  .detail-grid { grid-template-columns: 1.4fr 1fr; }
}
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.panel h2 { font-size: 1.05rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.panel h2 svg { color: var(--accent); }

.effect-row { margin-bottom: 0.85rem; }
.effect-row:last-child { margin-bottom: 0; }
.effect-row .top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 0.3rem; }
.effect-row .top .name { color: var(--text); }
.effect-row .top .pct { color: var(--text-faint); }
.effect-row .bar { height: 6px; background: rgba(255, 255, 255, 0.05); border-radius: 999px; overflow: hidden; }
.effect-row .bar .fill { height: 100%; background: linear-gradient(to right, var(--accent-dim), var(--accent)); border-radius: 999px; transition: width 0.3s; }

.intensity-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}
.intensity-row:last-child { border-bottom: none; }
.intensity-pill {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  padding: 0.2rem 0.55rem; border-radius: 6px;
  background: rgba(245, 158, 11, 0.18); color: var(--sativa);
}
.intensity-pill.high { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.intensity-pill.medium { background: rgba(245, 158, 11, 0.18); color: var(--sativa); }
.intensity-pill.low { background: rgba(56, 189, 248, 0.18); color: var(--cbd); }

.flavor-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.flavor-grid span {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
}
.condition-grid span { background: rgba(16, 185, 129, 0.1); color: var(--accent); }

.about-text { color: var(--text-dim); white-space: pre-line; line-height: 1.7; }
.lineage-text { color: var(--text-dim); font-style: italic; }
.na-line { color: var(--text-faint); font-style: italic; }

.sources-line { color: var(--text-faint); font-size: 0.8rem; margin-top: 1.5rem; }

/* ===== Search page ===== */
.search-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 980px) {
  .search-layout { grid-template-columns: 260px 1fr; }
}
.filter-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  align-self: start;
}
.filter-panel h3 {
  font-size: 0.7rem; text-transform: uppercase; color: var(--text-faint);
  letter-spacing: 0.08em; margin: 1.4rem 0 0.7rem;
}
.filter-panel h3:first-of-type { margin-top: 0; }
.filter-panel .chip-col { display: flex; flex-direction: column; gap: 0.35rem; }
.filter-panel .chip { justify-content: space-between; }

.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.results-bar .count { color: var(--text-dim); }
.results-bar .clear { color: var(--text-faint); font-size: 0.85rem; }
.results-bar .clear:hover { color: var(--accent); }

.pagination {
  display: flex; gap: 0.4rem; justify-content: center;
  margin-top: 2rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 0.5rem 0.8rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.pagination .gap { background: transparent; border: none; padding: 0.5rem 0.3rem; }

.empty {
  text-align: center; padding: 4rem 1rem;
  color: var(--text-dim);
}
.empty h2 { color: var(--text); }

/* ===== Compare page ===== */
.compare-table {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
.compare-table table { border-collapse: collapse; width: 100%; min-width: 620px; }
.compare-table th, .compare-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.9rem;
}
.compare-table thead th {
  background: var(--bg-elev-2);
  font-weight: 800;
  font-size: 1rem;
}
.compare-table tbody th {
  color: var(--text-faint);
  font-weight: 600; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  width: 140px;
}
.compare-table tbody tr:last-child td,
.compare-table tbody tr:last-child th { border-bottom: none; }
.compare-table .pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.18rem 0.55rem;
  margin: 0.1rem 0.15rem 0.1rem 0;
  border-radius: 999px;
  font-size: 0.75rem;
}

/* ===== 404 ===== */
.notfound { text-align: center; padding: 5rem 1rem; }
.notfound h1 { font-size: 4rem; }
.notfound p { color: var(--text-dim); margin-bottom: 2rem; }

/* ===== Mobile tweaks ===== */
@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: wrap; gap: 0.8rem; }
  .header-search { order: 3; flex-basis: 100%; }
  .header-nav { font-size: 0.8rem; gap: 1rem; }
  .hero { padding: 2rem 1rem; }
  .strain-hero { padding: 1.5rem 1.2rem; }
}
