/* Fibromyalgia Research Library - Styles */
:root {
  --primary: #2c5282;
  --primary-light: #3b82c4;
  --primary-dark: #1a3a5c;
  --covid: #c05621;
  --covid-light: #ed8936;
  --meno: #702459;
  --meno-light: #b83280;
  --success: #276749;
  --warning: #7b341e;
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #1a202c;
  --text-muted: #4a5568;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --radius: 8px;
  --radius-lg: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* HEADER */
header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: white;
  padding: 1.5rem 0 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
}

.logo { display: flex; align-items: center; gap: 1rem; }
.logo-icon { font-size: 2.5rem; }
.logo h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.subtitle { font-size: 0.85rem; opacity: 0.8; margin-top: 0.2rem; }

.lang-switcher { display: flex; gap: 0.5rem; }
.lang-btn {
  padding: 0.4rem 1rem;
  border: 2px solid rgba(255,255,255,0.5);
  background: transparent;
  color: white;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.lang-btn:hover, .lang-btn.active {
  background: white;
  color: var(--primary);
  border-color: white;
}

.ai-notice {
  background: rgba(0,0,0,0.2);
  padding: 0.75rem 1rem;
  margin: 0 -1.5rem;
  font-size: 0.82rem;
  opacity: 0.95;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.ai-badge {
  white-space: nowrap;
  background: rgba(255,255,255,0.2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.8rem;
}

/* NAV */
.main-nav {
  background: var(--primary-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.main-nav ul { list-style: none; display: flex; overflow-x: auto; scrollbar-width: none; }
.main-nav ul::-webkit-scrollbar { display: none; }
.main-nav a {
  display: block;
  padding: 0.85rem 1.2rem;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.main-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* HERO STATS */
.hero-stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
}
.stat-card {
  flex: 1;
  min-width: 140px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.2rem 1rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}
.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* SECTIONS */
.section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}
.section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border);
}
.section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin: 1.5rem 0 0.75rem;
}
.section p { color: var(--text-muted); margin-bottom: 1rem; line-height: 1.7; }

/* CONTENT GRID */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
}

/* SYMPTOM GRID */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.symptom-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.2rem;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.symptom-card:hover { box-shadow: var(--shadow-md); }
.symptom-icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.symptom-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.symptom-card p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }

/* INFO BOXES */
.info-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.2rem;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}
.info-box.highlight { border-color: var(--primary); background: #ebf4ff; }
.info-box.covid-info { border-color: var(--covid); background: #fffaf0; }
.info-box.meno-info { border-color: var(--meno); background: #fff5f7; }
.info-box h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.6rem; color: var(--text); }
.info-box ul { list-style: none; }
.info-box li {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.2rem 0;
  padding-left: 1rem;
  position: relative;
}
.info-box li::before { content: "→"; position: absolute; left: 0; color: var(--primary); }
.info-box p { font-size: 0.82rem; margin: 0; }

/* FRAMEWORK GRID */
.framework-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
@media (max-width: 768px) { .framework-grid { grid-template-columns: 1fr; } }

.framework-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  color: white;
}
.framework-card.friston { background: linear-gradient(135deg, #2d3748, #4a5568); }
.framework-card.robbins { background: linear-gradient(135deg, #1a365d, #2c5282); }
.framework-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.framework-icon { font-size: 2rem; }
.framework-card h3 { font-size: 1.1rem; margin: 0; color: white; }
.framework-card > p { font-size: 0.85rem; opacity: 0.9; margin-bottom: 1rem; color: rgba(255,255,255,0.9); }
.framework-card ul { list-style: none; }
.framework-card li {
  font-size: 0.82rem;
  padding: 0.25rem 0;
  padding-left: 1.2rem;
  position: relative;
  opacity: 0.9;
}
.framework-card li::before { content: "•"; position: absolute; left: 0; color: rgba(255,255,255,0.6); }

.pathway-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; margin-top: 1rem; }
.pathway {
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 0.75rem;
  text-align: center;
}
.pathway-name { font-size: 0.8rem; font-weight: 700; color: white; }
.pathway-arrow { font-size: 0.65rem; opacity: 0.7; margin: 0.25rem 0; }
.pathway-effect { font-size: 0.75rem; color: #feb2b2; font-weight: 600; }

/* HIGHLIGHT BOXES */
.highlight-box {
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.covid-highlight { background: linear-gradient(135deg, #7b341e, #c05621); color: white; }
.meno-highlight { background: linear-gradient(135deg, #44337a, #702459); color: white; }
.highlight-stat { font-size: 4rem; font-weight: 900; line-height: 1; white-space: nowrap; }
.highlight-box p { font-size: 1rem; opacity: 0.95; margin: 0; color: rgba(255,255,255,0.95); }

/* TABLES */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
}
.data-table th {
  background: var(--primary);
  color: white;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
}
.data-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.highlight-row td { background: #fff3cd; font-weight: 600; color: var(--text); }
.wide { font-size: 0.82rem; }

/* HORMONE GRID */
.hormone-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}
@media (max-width: 600px) { .hormone-grid { grid-template-columns: 1fr; } }
.hormone-card {
  border-radius: var(--radius);
  padding: 1.2rem;
  border: 1px solid var(--border);
  background: var(--bg);
}
.hormone-name { font-size: 1rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; }
.hormone-role { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.hormone-menopause { font-size: 0.78rem; color: var(--meno); font-weight: 600; }

/* FRISTON BOX */
.friston-box {
  background: linear-gradient(135deg, #f0f4ff, #e8eeff);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem;
  margin: 1.5rem 0;
}
.friston-box h4 { color: var(--primary-dark); font-size: 0.95rem; margin-bottom: 0.5rem; }
.friston-box p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

/* TREATMENT */
.treatment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 768px) { .treatment-grid { grid-template-columns: 1fr; } }

.treatment-category h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 1rem;
}
.treatment-items { display: flex; flex-direction: column; gap: 0.75rem; }
.treatment-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  border-left: 4px solid var(--border);
}
.treatment-item.strong { border-color: var(--success); }
.treatment-item.moderate { border-color: var(--primary-light); }
.treatment-item.fda { border-color: #276749; background: #f0fff4; }
.treatment-item.no { border-color: #e53e3e; background: #fff5f5; }
.treatment-item h4 { font-size: 0.9rem; font-weight: 600; margin: 0.3rem 0 0.3rem; }
.treatment-item p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.evidence-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  background: var(--success);
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.evidence-badge.moderate-badge { background: var(--primary-light); }
.evidence-badge.fda-badge { background: #276749; }
.evidence-badge.no-badge { background: #e53e3e; }

/* CONVERGENCE */
.convergence-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
  align-items: start;
}
@media (max-width: 700px) { .convergence-diagram { grid-template-columns: 1fr; } }
.conv-node {
  border-radius: var(--radius);
  padding: 1.2rem;
}
.conv-node.covid-node { background: #fffaf0; border: 1px solid var(--covid-light); }
.conv-node.meno-node { background: #fff5f7; border: 1px solid var(--meno-light); }
.conv-node h4 { font-weight: 700; margin-bottom: 0.5rem; }
.covid-node h4 { color: var(--covid); }
.meno-node h4 { color: var(--meno); }
.conv-node ul { list-style: none; font-size: 0.82rem; color: var(--text-muted); }
.conv-node li { padding: 0.2rem 0; padding-left: 1rem; position: relative; }
.conv-node li::before { content: "•"; position: absolute; left: 0; }

.conv-center {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  min-width: 180px;
}
.conv-center h4 { font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.75rem; }
.pillar {
  font-size: 0.78rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.center-arrow { font-size: 1.5rem; margin: 0.5rem 0; opacity: 0.7; }
.center-result { font-weight: 800; font-size: 0.95rem; color: #fcd34d; }

.double-vulnerability {
  background: linear-gradient(135deg, #f0f4ff, #f5f0ff);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid #c3dafe;
  margin: 1.5rem 0;
}
.double-vulnerability h3 { color: var(--primary-dark); margin-bottom: 0.75rem; }
.double-vulnerability p { margin: 0; color: var(--text-muted); }

/* SOURCES */
.sources-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (max-width: 768px) { .sources-grid { grid-template-columns: 1fr; } }
.source-category h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.source-list { list-style: none; }
.source-list li {
  font-size: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}
.source-list li:last-child { border-bottom: none; }
.source-list a {
  color: var(--primary);
  text-decoration: none;
}
.source-list a:hover { text-decoration: underline; }

/* FOOTER */
footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.85);
  padding: 2rem 0 0;
  margin-top: 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 1.5rem;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; } }
footer h4 { color: white; font-size: 0.9rem; margin-bottom: 0.75rem; }
footer p, footer li { font-size: 0.82rem; }
footer ul { list-style: none; }
footer li { padding: 0.2rem 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 0;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .hero-stats { flex-direction: column; }
  .stat-card { min-width: auto; }
  .highlight-box { flex-direction: column; text-align: center; }
  .highlight-stat { font-size: 3rem; }
  .section { padding: 1.25rem; }
  .section h2 { font-size: 1.3rem; }
  .treatment-grid { grid-template-columns: 1fr; }
  .sources-grid { grid-template-columns: 1fr; }
  .pathway-grid { grid-template-columns: 1fr; }
}
