/* ── HerbaLog Global Styles ── */

:root {
  --green-dark:  #1b4332;
  --green-mid:   #2d6a4f;
  --green-light: #52b788;
  --green-pale:  #d8f3dc;
  --purple:      #6a1b9a;
  --gold:        #f9a825;
  --blue:        #1565c0;
  --red-warn:    #b71c1c;
  --text-dark:   #1a1a1a;
  --text-muted:  #555;
  --border:      #d0e8d8;
}

* { box-sizing: border-box; }

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #f5f9f5;
  color: var(--text-dark);
  margin: 0; padding: 0; margin-bottom: 0 !important;
}

/* ── SCROLLING STATS TICKER ── */
.stats-ticker {
  background: linear-gradient(90deg, #3a006f, #6a1b9a, #3a006f);
  color: #fff;
  overflow: hidden;
  padding: 9px 0;
  position: sticky; top: 0;
  z-index: 1100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.ticker-wrap { display: flex; width: 100%; overflow: hidden; }
.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 45s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: inline-block;
  padding: 0 56px;
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.ticker-item.s1 { color: #ffd54f; }
.ticker-item.s2 { color: #80cbc4; }
.ticker-item.s3 { color: #f48fb1; }
.ticker-sep { color: rgba(255,255,255,0.3); padding: 0 16px; font-size: 1.2em; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── PERMANENT DISCLAIMER BAR ── */
.disclaimer-bar {
  background: var(--red-warn);
  color: #fff;
  text-align: center;
  padding: 6px 20px;
  font-size: 0.84em;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: sticky; top: 41px;
  z-index: 1090;
}

/* ── NAVIGATION ── */
.navbar-herbalog {
  background: var(--green-dark) !important;
  padding: 0 20px;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
}
.navbar-herbalog .navbar-brand {
  color: #fff !important;
  font-size: 1.45em;
  font-weight: 800;
  letter-spacing: 1px;
}
.navbar-herbalog .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
  padding: 15px 13px !important;
}
.navbar-herbalog .nav-link:hover { color: var(--green-light) !important; }
.navbar-herbalog .navbar-toggler { border-color: rgba(255,255,255,0.3); }
.navbar-herbalog .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── PAGE WRAPPER: CONTENT + AD SIDEBAR ── */
.page-wrapper {
  display: flex;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  gap: 24px;
  align-items: flex-start;
}
.content-area { flex: 1 1 0; min-width: 0; }

/* ── COMMUNITY PANEL ── */
.community-panel {
  flex: 0 0 220px;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 102px;
}
.panel-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.panel-heading {
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 0.8em;
  font-weight: 700;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
}
.panel-body {
  min-height: 110px;
  padding: 8px 12px;
}
.panel-empty {
  padding: 32px 12px;
  font-size: 0.76em;
  color: #bbb;
  text-align: center;
  font-style: italic;
}
.panel-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f4f0;
  font-size: 0.79em;
  color: var(--text-dark);
  line-height: 1.4;
}
.panel-item:last-child { border-bottom: none; }
.panel-item strong { display: block; color: var(--green-dark); margin-bottom: 2px; }
.panel-item .pi-meta { color: var(--text-muted); font-size: 0.85em; margin-top: 3px; }
.panel-view-all {
  display: block;
  text-align: center;
  font-size: 0.75em;
  padding: 7px;
  color: var(--green-mid);
  border-top: 1px solid var(--border);
  text-decoration: none;
  background: #fafcfa;
}
.panel-view-all:hover { background: var(--green-pale); }

/* ── AD ZONE ── */
.ad-zone {
  flex: 0 0 192px;
  width: 192px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  position: sticky;
  top: 102px;
}
.ad-zone-label {
  font-size: 0.68em;
  color: #aaa;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}
.ad-placeholder {
  background: #f0f4f0;
  border: 2px dashed #ccc;
  border-radius: 6px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 0.78em;
  text-align: center;
  margin-bottom: 12px;
}

/* ── A–Z LETTER NAV ── */
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.alpha-nav a {
  display: inline-block;
  width: 34px; height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 5px;
  background: var(--green-pale);
  border: 1px solid var(--border);
  color: var(--green-mid);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.12s;
}
.alpha-nav a:hover,
.alpha-nav a.active {
  background: var(--green-mid);
  color: #fff;
  border-color: var(--green-mid);
}
.alpha-nav a.empty { color: #ccc; pointer-events: none; background: #fafafa; }

/* ── ENTRY CARDS ── */
.entry-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 15px 18px;
  margin-bottom: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  display: block;
  color: var(--text-dark);
}
.entry-card:hover {
  box-shadow: 0 3px 12px rgba(44,106,79,0.14);
  border-color: var(--green-light);
  text-decoration: none;
  color: var(--text-dark);
}
.entry-card h3 { margin: 0 0 3px; font-size: 1.05em; color: var(--green-dark); }
.entry-card .botanical { font-style: italic; color: var(--text-muted); font-size: 0.88em; }
.entry-card .tag {
  display: inline-block;
  font-size: 0.75em;
  background: var(--green-pale);
  color: var(--green-mid);
  border-radius: 20px;
  padding: 2px 9px;
  font-weight: 600;
  margin-top: 4px;
}

/* ── SECTION LETTER HEADING ── */
.section-letter {
  font-size: 1.8em;
  font-weight: 800;
  color: var(--green-mid);
  border-bottom: 3px solid var(--green-light);
  padding-bottom: 4px;
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-letter .letter-count {
  font-size: 0.5em;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── PAGE HEADER ── */
.page-title { font-size: 1.55em; font-weight: 700; color: var(--green-dark); margin-bottom: 4px; }
.page-subtitle { color: var(--text-muted); margin-bottom: 20px; font-size: 0.93em; }

/* ── HOMEPAGE HERO ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: #fff;
  padding: 36px 28px;
  border-radius: 10px;
  margin-bottom: 24px;
}
.hero h1 { font-size: 1.9em; margin: 0 0 8px; font-weight: 800; }
.hero p  { opacity: 0.88; margin: 0 0 20px; font-size: 1em; }
.search-box { display: flex; gap: 8px; max-width: 480px; }
.search-box input {
  flex: 1; padding: 10px 14px;
  border-radius: 6px; border: none;
  font-size: 0.95em; outline: none;
}
.search-box button {
  padding: 10px 18px;
  background: var(--gold); color: var(--green-dark);
  border: none; border-radius: 6px;
  font-weight: 700; cursor: pointer;
  white-space: nowrap;
}
.search-box button:hover { background: #fbc02d; }

/* ── HOMEPAGE SECTION CARDS ── */
.section-cards { display: flex; gap: 18px; margin-bottom: 24px; flex-wrap: wrap; }
.section-card {
  flex: 1 1 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 18px;
  text-decoration: none;
  color: var(--text-dark);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.section-card:hover {
  box-shadow: 0 4px 16px rgba(44,106,79,0.15);
  border-color: var(--green-light);
  text-decoration: none;
}
.section-card .icon { font-size: 1.8em; margin-bottom: 10px; }
.section-card h2 { font-size: 1.1em; color: var(--green-dark); margin: 0 0 5px; }
.section-card p  { font-size: 0.85em; color: var(--text-muted); margin: 0; }

/* ── FOOTER ── */
footer.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.72);
  padding: 28px 32px 20px;
  font-size: 0.83em;
  margin-top: 0;
}
.medic-note {
  background: rgba(255,255,255,0.07);
  border-left: 4px solid var(--green-light);
  padding: 12px 16px;
  border-radius: 4px;
  color: rgba(255,255,255,0.88);
  font-size: 0.92em;
  margin-bottom: 14px;
  line-height: 1.6;
}
footer.site-footer a { color: var(--green-light); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 2.8em; margin-bottom: 10px; }

/* ── AUTHORITY LINKS ── */
.authority-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.78em;
  font-weight: 700;
  text-decoration: none;
  margin-right: 5px;
  margin-top: 4px;
  transition: opacity 0.12s;
}
.authority-link:hover { opacity: 0.8; text-decoration: none; }
.authority-link.pubmed  { background: #e3f2fd; color: #1565c0; }
.authority-link.nih     { background: #e8f5e9; color: #2d6a4f; }
.authority-link.cdc     { background: #fce4ec; color: #c62828; }
.authority-link.medscape{ background: #f3e5f5; color: #6a1b9a; }
.authority-link.who     { background: #fff8e1; color: #e65100; }
.authority-link.africa  { background: #fbe9e7; color: #bf360c; }

/* ── TREATMENT SECTIONS ── */
.treatment-section { margin-bottom: 28px; }
.treatment-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.15em;
  font-weight: 700;
  color: var(--green-dark);
  border-bottom: 3px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.herbal-heading { color: var(--green-mid); border-bottom-color: var(--green-light); }
.treatment-count { font-size: 0.7em; color: var(--text-muted); font-weight: 400; }
.herbal-note {
  background: var(--green-pale);
  border-left: 4px solid var(--green-light);
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 0.83em;
  color: var(--green-dark);
  margin-bottom: 14px;
  line-height: 1.6;
}

/* ── TREATMENT CARD ── */
.treatment-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.herbal-card {
  border-color: var(--green-light);
  border-left: 4px solid var(--green-light);
}
.tc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.tc-name { font-size: 1.05em; font-weight: 700; color: var(--green-dark); }
.tc-type-badge {
  display: inline-block;
  font-size: 0.72em;
  background: #f0f4f0;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}
.feedback-count { font-size: 0.75em; color: var(--text-muted); white-space: nowrap; }
.tc-desc { font-size: 0.9em; color: var(--text-muted); line-height: 1.6; margin: 0 0 8px; }
.tc-mode {
  font-size: 0.88em;
  background: #f8faf8;
  border-radius: 5px;
  padding: 8px 12px;
  margin-bottom: 10px;
  line-height: 1.6;
}

/* ── OUTCOME BAR ── */
.outcome-bar-wrap { margin: 10px 0; }
.outcome-bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: #eee;
}
.ob-yes     { background: #4caf50; }
.ob-partial { background: #ff9800; }
.ob-no      { background: #f44336; }
.outcome-labels {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.75em;
}
.ol-yes     { color: #4caf50; font-weight: 600; }
.ol-partial { color: #ff9800; font-weight: 600; }
.ol-no      { color: #f44336; font-weight: 600; }

/* ── SOURCE CHIPS ── */
.tc-sources { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tc-sources-label { font-size: 0.75em; color: var(--text-muted); font-weight: 600; }
.source-chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 0.74em;
  font-weight: 600;
  background: #f0f4f0;
  color: var(--text-muted);
  text-decoration: none;
}
a.source-chip:hover { opacity: 0.8; }
.source-chip.pubmed   { background: #e3f2fd; color: #1565c0; }
.source-chip.nih      { background: #e8f5e9; color: #2d6a4f; }
.source-chip.cdc      { background: #fce4ec; color: #c62828; }
.source-chip.youtube  { background: #ffebee; color: #b71c1c; }
.source-chip.journal  { background: #f3e5f5; color: #6a1b9a; }
.source-chip.book     { background: #fff8e1; color: #e65100; }

/* ── LAB BUTTONS + FEEDBACK ── */
.tc-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f4f0;
}
.lab-buttons { display: flex; gap: 5px; flex-wrap: wrap; }
.lab-btn {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 0.74em;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.12s;
}
.lab-btn:hover { opacity: 0.85; text-decoration: none; }
.lab-published { background: #e3f2fd; color: #1565c0; }
.lab-clinical  { background: #e8f5e9; color: #2d6a4f; }
.lab-upload    { background: #fff8e1; color: #e65100; }
.feedback-trigger {
  background: var(--green-mid);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.82em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.feedback-trigger:hover { background: var(--green-dark); }

/* ── OUTCOME BUTTONS (modal) ── */
.outcome-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-weight: 700;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.12s;
}
.yes-btn.selected     { background: #e8f5e9; border-color: #4caf50; color: #2e7d32; }
.partial-btn.selected { background: #fff8e1; border-color: #ff9800; color: #e65100; }
.no-btn.selected      { background: #ffebee; border-color: #f44336; color: #c62828; }

/* ── COMMENTS ── */
.tc-comments { margin-top: 10px; font-size: 0.85em; }
.tc-comments summary {
  cursor: pointer;
  color: var(--green-mid);
  font-weight: 600;
  padding: 4px 0;
}
.comment-item {
  padding: 8px 10px;
  border-left: 3px solid var(--border);
  margin: 6px 0;
  font-size: 0.9em;
  line-height: 1.5;
}
.comment-outcome {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 0.8em;
  font-weight: 700;
  margin-right: 6px;
}
.comment-outcome.yes     { background: #e8f5e9; color: #2e7d32; }
.comment-outcome.partial { background: #fff8e1; color: #e65100; }
.comment-outcome.no      { background: #ffebee; color: #c62828; }
.comment-date { float: right; color: var(--text-muted); font-size: 0.85em; }

/* ── ALTERNATE NAMES BUTTON ── */
.alt-names-toggle {
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 0.82em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.alt-names-toggle:hover { background: rgba(255,255,255,0.28); }

/* ── UTILITY ── */
.btn-green {
  background: var(--green-mid); color: #fff;
  border: none; border-radius: 6px;
  padding: 8px 18px; font-weight: 600; cursor: pointer;
}
.btn-green:hover { background: var(--green-dark); color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .page-wrapper { flex-direction: column; padding: 16px; }
  .community-panel { width: 100%; position: static; flex-direction: row; flex-wrap: wrap; }
  .panel-section { flex: 1 1 200px; }
  .ad-zone { width: 100%; position: static; }
  .section-cards { flex-direction: column; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 1.35em; }
  .stats-ticker { top: 0; }
  .disclaimer-bar { position: static; }
}
