/* ─────────────────────────────────────────────────────────────────────────────
   research.css — Research Evidence Hub styles
   Owns: all styles for /research page (nav overrides, header, filter bar, cards).
   Does NOT own: global theme tokens (theme.css), game cards (app.css), quiz (assessment.css).
───────────────────────────────────────────────────────────────────────────── */

/* ── Nav (extends app-nav from app.css; redefine here to avoid coupling) ── */
.app-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 0;
  background: rgba(10, 10, 18, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.06);
}

.nav-link--active {
  color: var(--fg);
  background: rgba(124, 58, 237, 0.15);
}

/* ── Page header ── */
.research-header {
  position: relative;
  padding: 80px 0 72px;
  overflow: hidden;
  text-align: center;
}

.header-bg-shapes {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hshape {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.2;
}

.hshape-1 {
  width: 600px;
  height: 400px;
  background: var(--accent-primary);
  top: -120px;
  right: -100px;
}

.hshape-2 {
  width: 400px;
  height: 300px;
  background: var(--accent-secondary);
  bottom: -80px;
  left: -80px;
}

.research-header .container {
  position: relative;
  z-index: 1;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.header-badge {
  display: inline-block;
  padding: 5px 16px;
  border-radius: 100px;
  background: rgba(6, 214, 160, 0.12);
  border: 1px solid rgba(6, 214, 160, 0.3);
  color: #06d6a0;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.header-count {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--fg-dim);
}

.header-title {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(36px, 5.5vw, 58px);
  font-weight: 400;
  line-height: 1.15;
  color: var(--fg);
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.header-title em {
  font-style: italic;
  /* Gradient text */
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-sub {
  font-size: 17px;
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

/* ── Subscribe block ── */
.subscribe-block {
  max-width: 460px;
  margin: 0 auto;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.subscribe-label {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 14px;
}

.subscribe-form {
  display: flex;
  gap: 8px;
}

.subscribe-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
}

.subscribe-input::placeholder {
  color: var(--fg-dim);
}

.subscribe-input:focus {
  border-color: rgba(6, 214, 160, 0.5);
}

.subscribe-btn {
  padding: 10px 20px;
  background: var(--accent-secondary);
  color: #0a0a12;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s;
}

.subscribe-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.subscribe-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.subscribe-feedback {
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}

.subscribe-feedback--ok  { color: var(--accent-secondary); }
.subscribe-feedback--err { color: #f87171; }

/* ── Filter bar ── */
.filter-section {
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 60px;
  z-index: 90;
  background: rgba(10, 10, 18, 0.9);
  backdrop-filter: blur(8px);
}

.filter-bar {
  display: flex;
  gap: 6px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.filter-pill:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

.filter-pill--active {
  color: var(--accent-secondary);
  background: rgba(6, 214, 160, 0.1);
  border-color: rgba(6, 214, 160, 0.3);
}

/* ── Main content ── */
.studies-main {
  padding: 60px 0 100px;
}

/* ── Category group (all-view) ── */
.category-group {
  margin-bottom: 72px;
}

.category-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.group-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Color map matching game card dots */
.dot-stress-relief      { background: #10b981; box-shadow: 0 0 8px rgba(16,185,129,0.5); }
.dot-anxiety-support    { background: #60a5fa; box-shadow: 0 0 8px rgba(96,165,250,0.5); }
.dot-social-connection  { background: #a78bfa; box-shadow: 0 0 8px rgba(167,139,250,0.5); }
.dot-emotional-processing { background: #f472b6; box-shadow: 0 0 8px rgba(244,114,182,0.5); }
.dot-cognitive-therapy  { background: #fbbf24; box-shadow: 0 0 8px rgba(251,191,36,0.5); }

.group-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
}

.group-count {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--fg-dim);
  margin-left: auto;
}

/* ── Studies grid ── */
.studies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ── Study card ── */
.study-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition: border-color 0.25s, transform 0.2s, box-shadow 0.25s;
}

.study-card:hover {
  border-color: rgba(124, 58, 237, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.12);
}

.study-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.study-year {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  letter-spacing: 0.5px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
}

.study-journal {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--fg-dim);
  font-style: italic;
  text-align: right;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.study-title {
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  font-weight: 400;
  color: var(--fg);
  line-height: 1.45;
  margin-bottom: 8px;
}

.study-authors {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--fg-dim);
  margin-bottom: 0;
}

.study-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 18px 0;
}

.study-finding {
  flex: 1;
  margin-bottom: 18px;
}

.finding-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.finding-text {
  font-size: 15px;
  color: var(--fg-muted);
  line-height: 1.65;
}

.study-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.meta-chip {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-dim);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 9px;
}

.study-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-secondary);
  text-decoration: none;
  padding: 8px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  transition: color 0.2s, gap 0.2s;
}

.study-link:hover {
  color: #2ee8b8;
  gap: 8px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--fg-muted);
}

.empty-state p {
  margin-bottom: 20px;
  font-size: 18px;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Footer (shared style) ── */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--fg);
}

.footer-tagline {
  font-size: 14px;
  color: var(--fg-dim);
  flex: 1;
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.footer-nav a {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--fg-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--fg-muted);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .research-header {
    padding: 60px 0 48px;
  }

  .header-title {
    font-size: 32px;
  }

  .subscribe-form {
    flex-direction: column;
  }

  .subscribe-btn {
    width: 100%;
  }

  .studies-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-link {
    font-size: 12px;
    padding: 5px 10px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-tagline {
    flex: unset;
  }
}
