/* ============================================
   RESEARCH PAGE STYLES
   ============================================ */

/* Hero */
.research-hero { padding: 120px 0 60px; background: var(--bg2); }
.research-hero .section-title { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 12px; color: var(--text); }
.research-hero .section-subtitle { font-size: 1rem; color: var(--text2); max-width: 640px; margin-bottom: 0; }
.hero-stats { display: flex; gap: 24px; justify-content: center; margin-top: 32px; }
.hero-stat { text-align: center; padding: 20px 32px; background: var(--surface); border: 1px solid var(--surface2); border-radius: var(--radius); }
.hero-stat-number { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 700; color: var(--accent); }
.hero-stat-label { font-size: .75rem; color: var(--text2); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

/* Search */
.search-section { padding: 48px 0 32px; background: var(--bg); position: sticky; top: 56px; z-index: 50; }
.search-bar-wrap { display: flex; gap: 12px; max-width: 720px; margin: 0 auto 20px; }
.search-input { flex: 1; background: var(--surface); border: 1px solid var(--surface2); border-radius: 50px; padding: 14px 24px; color: var(--text); font-family: 'Outfit', sans-serif; font-size: .95rem; outline: none; transition: border-color .3s, box-shadow .3s; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(110,231,183,0.1); }
.search-input::placeholder { color: var(--text3); }
.search-btn { background: var(--accentG); color: var(--bg); border: none; border-radius: 50px; padding: 14px 32px; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: .9rem; cursor: pointer; transition: opacity .3s; white-space: nowrap; }
.search-btn:hover { opacity: .9; }

/* Filter Chips */
.filter-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.chip { background: var(--surface); border: 1px solid var(--surface2); color: var(--text2); padding: 8px 18px; border-radius: 30px; font-family: 'Outfit', sans-serif; font-size: .8rem; font-weight: 500; cursor: pointer; transition: all .3s; }
.chip:hover { color: var(--text); border-color: var(--surface2); }
.chip.active { background: rgba(110,231,183,0.1); color: var(--accent); border-color: rgba(110,231,183,0.3); }

/* Search Stats */
.search-stats { text-align: center; font-size: .8rem; color: var(--text3); min-height: 20px; }

/* Results */
.results-section { padding: 16px 0 60px; min-height: 200px; }
.results-grid { display: flex; flex-direction: column; gap: 16px; }

/* Passage Card */
.passage-card { background: var(--surface); border: 1px solid var(--surface2); border-radius: var(--radius); padding: 24px; transition: transform .3s, box-shadow .3s; }
.passage-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.passage-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.passage-source { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 4px 12px; border-radius: 20px; }
.passage-score { font-size: .7rem; font-weight: 600; color: var(--accent); padding: 4px 12px; border-radius: 20px; background: rgba(110,231,183,0.08); }
.passage-section { font-size: .75rem; color: var(--text3); margin-bottom: 8px; }
.passage-text { font-size: .88rem; line-height: 1.65; color: var(--text2); margin-bottom: 14px; }
.passage-text mark { background: rgba(110,231,183,0.15); color: var(--accent); border-radius: 2px; padding: 0 2px; }
.passage-footer { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.result-citation { font-size: .72rem; font-weight: 500; color: var(--blue2); text-decoration: none; transition: all .2s; padding: 3px 8px; border-radius: 6px; background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.2); }
.result-citation:hover { color: #fff; background: rgba(59,130,246,0.35); border-color: rgba(59,130,246,0.5); }
.result-topic { font-size: .65rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 20px; background: var(--bg3); color: var(--text3); }
.result-entity { font-size: .7rem; font-weight: 500; padding: 3px 10px; border-radius: 20px; background: rgba(59,130,246,0.1); color: var(--blue2); cursor: pointer; transition: background .3s; text-decoration: none; }
.result-entity:hover { background: rgba(59,130,246,0.2); }
.result-citation-inline { color: var(--blue2); text-decoration: none; font-size: .82em; font-weight: 500; transition: color .2s; }
.result-citation-inline:hover { color: var(--accent); text-decoration: underline; }
.passage-citations { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.passage-topics { display: flex; gap: 4px; flex-wrap: wrap; }
.passage-entities { display: flex; gap: 4px; flex-wrap: wrap; }

/* No Results */
.no-results { text-align: center; padding: 48px 24px; color: var(--text3); font-size: .9rem; }

/* Loading */
.loading { text-align: center; padding: 48px; }
.loading-spinner { width: 36px; height: 36px; border: 3px solid var(--surface2); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Knowledge Graph */
.graph-section { padding: 80px 0; background: var(--bg2); }
.graph-controls { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 24px 0; }
.graph-btn { background: var(--surface); border: 1px solid var(--surface2); color: var(--text2); padding: 8px 18px; border-radius: 30px; font-family: 'Outfit', sans-serif; font-size: .8rem; font-weight: 500; cursor: pointer; transition: all .3s; }
.graph-btn:hover { color: var(--text); border-color: var(--surface2); }
.graph-btn.active { background: rgba(59,130,246,0.1); color: var(--blue2); border-color: rgba(59,130,246,0.3); }
.knowledge-canvas { width: 100%; height: 500px; background: var(--bg); border: 1px solid var(--surface2); border-radius: var(--radius); cursor: grab; display: block; }
.knowledge-canvas:active { cursor: grabbing; }
.graph-info { margin-top: 16px; min-height: 80px; padding: 20px; background: var(--surface); border: 1px solid var(--surface2); border-radius: var(--radius); }
.graph-hint { color: var(--text3); font-size: .85rem; text-align: center; }
.graph-info-title { font-family: 'Playfair Display', serif; font-size: 1.2rem; color: var(--text); margin-bottom: 4px; }
.graph-info-type { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: 20px; display: inline-block; margin-bottom: 8px; }
.graph-info-desc { font-size: .85rem; color: var(--text2); line-height: 1.5; margin-bottom: 12px; }
.graph-info-connections { display: flex; gap: 6px; flex-wrap: wrap; }
.graph-info-conn { font-size: .7rem; padding: 3px 10px; border-radius: 20px; background: rgba(110,231,183,0.08); color: var(--accent); cursor: pointer; }
.graph-info-conn:hover { background: rgba(110,231,183,0.15); }

/* Insights / Hypotheses */
.insights-section { padding: 80px 0; }
.insights-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 32px; }
.insight-card { background: var(--surface); border: 1px solid var(--surface2); border-radius: var(--radius); padding: 24px; transition: transform .3s, box-shadow .3s; }
.insight-card:hover { transform: translateY(-2px); box-shadow: var(--glow); }
.insight-tag { display: inline-block; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 12px; border-radius: 20px; margin-bottom: 12px; }
.insight-tag.cross-reference { background: rgba(59,130,246,0.1); color: var(--blue2); }
.insight-tag.research-gap { background: rgba(251,191,36,0.1); color: var(--amber); }
.insight-tag.proposed-experiment { background: rgba(45,212,191,0.1); color: var(--teal); }
.insight-title { font-family: 'Playfair Display', serif; font-size: 1.05rem; color: var(--text); margin-bottom: 8px; line-height: 1.3; }
.insight-text { font-size: .82rem; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }
.insight-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.src-badge { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 12px; background: var(--bg3); color: var(--text3); }
.insight-entity { font-size: .65rem; padding: 3px 8px; border-radius: 12px; background: rgba(167,139,250,0.1); color: var(--purple); }

/* Responsive */
@media(max-width:900px) {
  .insights-grid { grid-template-columns: 1fr; }
  .knowledge-canvas { height: 400px; }
  .hero-stats { flex-wrap: wrap; }
}
@media(max-width:600px) {
  .research-hero { padding: 100px 0 40px; }
  .search-section { position: relative; top: 0; }
  .search-bar-wrap { flex-direction: column; }
  .search-btn { width: 100%; }
  .filter-chips { overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .chip { white-space: nowrap; flex-shrink: 0; }
  .knowledge-canvas { height: 300px; }
  .hero-stat { padding: 14px 20px; }
  .hero-stat-number { font-size: 1.5rem; }
}
