/* styles.css */

/* THEME TOKENS */
:root {
  --bg: #0b1110;
  --bg-soft: #111917;
  --bg-softer: #131e1b;
  --accent: #64c27b;
  --accent-soft: rgba(100, 194, 123, 0.15);
  --accent-strong: #46a45d;
  --text: #f5f7f5;
  --text-muted: #9ba9a2;
  --border-subtle: #24322c;
  --danger: #d76a6a;
  --shadow-soft: 0 18px 40px rgba(0,0,0,0.45);
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;
}

/* GLOBAL */

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #18352b, #050706 55%);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* HEADER */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px 12px;
  margin: -10px -12px 0;
  background: linear-gradient(to bottom, rgba(5,8,7,0.95), rgba(5,8,7,0.8));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #b4ffd3, #3b8051 40%, #06120b 70%);
  box-shadow: 0 0 0 1px rgba(60, 128, 91, 0.6), 0 0 30px rgba(79, 189, 124, 0.7);
  position: relative;
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  border: 1.4px solid rgba(5, 15, 9, 0.7);
}

.brand-mark::before {
  inset: 16% 24% 34% 14%;
  transform: rotate(-24deg);
}

.brand-mark::after {
  inset: 36% 10% 18% 28%;
  transform: rotate(18deg);
}

.brand-text-main {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.98rem;
}

.brand-text-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.86rem;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,16,13,0.8);
  color: var(--text);
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 10px;
}

.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
}

.nav-link {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  border: 1px solid transparent;
}

.nav-link--active,
.nav-link:hover {
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
  background: rgba(9, 20, 15, 0.8);
}

.nav-cta {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #021108;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(66, 171, 97, 0.45);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.nav-cta span.icon {
  font-size: 1rem;
}

@media (max-width: 720px) {
  header {
    flex-wrap: wrap;
  }
  .nav-toggle {
    display: inline-flex;
  }
  nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 8px;
    background: rgba(9, 14, 12, 0.92);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-lg);
    padding: 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
  }
  nav.nav-open {
    display: flex;
  }
  .nav-link,
  .nav-cta {
    width: 100%;
    text-align: left;
  }
  .nav-cta {
    justify-content: center;
  }
}

/* HERO + SUBHERO */

.hero,
.subhero {
  background: radial-gradient(circle at top left, rgba(115, 212, 145, 0.14), rgba(2,5,3,0.95));
  border-radius: var(--radius-xl);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255,255,255,0.02);
  position: relative;
  overflow: hidden;
}

.hero::before,
.subhero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% -10%, rgba(171, 255, 188, 0.25), transparent 55%);
  pointer-events: none;
  opacity: 0.8;
}

.hero-inner,
.subhero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-tagline {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.23em;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-tagline-pill {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(100, 194, 123, 0.9);
}

.hero-title,
.subhero-title {
  font-size: 1.9rem;
  line-height: 1.15;
  max-width: 620px;
}

.hero-title span.accent,
.subhero-title span.accent {
  color: var(--accent);
}

.hero-subtitle,
.subhero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 620px;
}

/* LAYOUT GRIDS */

.top-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 1.4fr);
  gap: 20px;
  align-items: flex-start;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .top-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1.3fr);
  gap: 20px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* SEARCH + FILTERS */

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2px;
}

.chip {
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(6,12,10,0.8);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.search-panel {
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: rgba(5,9,8,0.9);
  border: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-field {
  position: relative;
  flex: 1 1 220px;
}

.search-field input {
  width: 100%;
  padding: 10px 11px 10px 30px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.06);
  background: #070d0b;
  color: var(--text);
  font-size: 0.9rem;
}

.search-field input::placeholder {
  color: rgba(153, 170, 160, 0.8);
}

.search-field-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.search-submit {
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #021108;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(60, 174, 98, 0.42);
  white-space: nowrap;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-size: 0.75rem;
  padding: 6px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-muted);
  background: rgba(8,14,11,0.9);
  cursor: pointer;
}

.pill.active {
  color: var(--accent);
  border-color: rgba(111, 206, 140, 0.8);
  background: rgba(100, 194, 123, 0.08);
}

.search-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* SIDE LLM PANEL */

.side-panel {
  background: linear-gradient(150deg, #07130e, #050807);
  border-radius: var(--radius-xl);
  padding: 16px 16px 18px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.side-panel::before {
  content: "";
  position: absolute;
  inset: -40% 20% 40% -40%;
  background: radial-gradient(circle at top, rgba(100, 194, 123, 0.15), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

.side-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.side-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-title-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  border: 1px solid rgba(100, 194, 123, 0.55);
  background: rgba(4, 12, 7, 0.9);
  color: var(--accent);
}

.side-text {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.qa-box {
  margin-top: 4px;
  border-radius: var(--radius-lg);
  background: rgba(4,10,7,0.9);
  border: 1px solid rgba(255,255,255,0.03);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: hidden;
}

.qa-stream {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.qa-message {
  font-size: 0.8rem;
  margin-bottom: 8px;
  line-height: 1.45;
}

.qa-message.user {
  color: var(--accent);
}

.qa-message.bot {
  color: var(--text-muted);
}

.qa-message .qa-sources {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.qa-sources .source-pill {
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(100, 194, 123, 0.12);
  color: var(--text);
  border: 1px solid rgba(100, 194, 123, 0.3);
}

.qa-message-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.75;
  display: inline-block;
  margin-bottom: 2px;
}

.qa-input-row {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.qa-input-row textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  max-height: 60px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #050a08;
  color: var(--text);
  padding: 6px 8px;
  font-size: 0.8rem;
}

.qa-input-row textarea::placeholder {
  color: rgba(145, 161, 152, 0.8);
}

.qa-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.04);
}

.qa-voice-btn {
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(100, 194, 123, 0.15);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.76rem;
  cursor: pointer;
}

.qa-send {
  border-radius: 12px;
  border: none;
  padding: 0 10px;
  font-size: 0.8rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #021108;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-weight: 600;
}

.side-footer {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  opacity: 0.8;
}

.placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.vector-console {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(6, 12, 9, 0.9);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vector-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}

.vector-chip {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(100, 194, 123, 0.15);
  border: 1px solid rgba(100, 194, 123, 0.3);
}

.vector-console-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.vector-console-row input {
  flex: 1;
  border-radius: 10px;
  padding: 10px 12px;
  background: #050a08;
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text);
}

.vector-console-row button {
  border-radius: 12px;
  border: none;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #021108;
  cursor: pointer;
  font-weight: 600;
}

.vector-console-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.vector-console-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

/* PANELS, GRIDS, CARDS */

.panel {
  background: var(--bg-soft);
  border-radius: var(--radius-xl);
  padding: 14px 14px 16px;
  border: 1px solid rgba(255,255,255,0.04);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.panel-tabs {
  display: flex;
  gap: 6px;
  font-size: 0.75rem;
  flex-wrap: wrap;
}

.panel-tab {
  padding: 5px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
}

.panel-tab.active {
  border-color: rgba(255,255,255,0.08);
  background: rgba(7,14,11,0.9);
  color: var(--accent);
}

/* Herb grid */

.herb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.herb-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.04);
  background: linear-gradient(145deg, #101915, #050807);
  padding: 9px 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.herb-card::before {
  content: "";
  position: absolute;
  inset: -40% 40% 60% -40%;
  background: radial-gradient(circle at top, rgba(100, 194, 123, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease-out;
  pointer-events: none;
}

.herb-card:hover::before {
  opacity: 1;
}

.herb-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.herb-latin {
  font-size: 0.75rem;
  font-style: italic;
  color: var(--text-muted);
}

.herb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: rgba(4, 12, 8, 0.95);
  border: 1px solid rgba(255,255,255,0.03);
  color: var(--text-muted);
}

.herb-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.herb-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

/* Article cards */

.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.article-card {
  border-radius: 12px;
  background: var(--bg-softer);
  border: 1px solid rgba(255,255,255,0.02);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.article-title {
  font-size: 0.85rem;
  font-weight: 500;
}

.article-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.article-tag {
  font-size: 0.68rem;
  padding: 3px 6px;
  border-radius: var(--radius-pill);
  background: rgba(100, 194, 123, 0.12);
  color: var(--accent);
}

/* Simple lists / badges for subpages */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.badge {
  font-size: 0.75rem;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(8, 14, 11, 0.9);
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--text-muted);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* DETAIL PAGE */

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.2fr);
  gap: 20px;
  margin-top: 10px;
}

@media (max-width: 900px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.detail-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-name {
  font-size: 1.6rem;
  font-weight: 600;
}

.detail-latin {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-muted);
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.section-body {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FORM BASICS */

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
textarea {
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #050a08;
  color: var(--text);
  padding: 7px 9px;
  font-size: 0.85rem;
}

textarea {
  resize: vertical;
}

.button-primary {
  border-radius: var(--radius-pill);
  border: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #021108;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(60, 174, 98, 0.42);
}

/* FOOTER */

footer {
  margin-top: 20px;
  padding: 14px 2px 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255,255,255,0.04);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.footer-links a {
  opacity: 0.7;
}

.footer-links a:hover {
  opacity: 1;
}
