/* malware-public-hero.css — PRD-MPI-PUBLIC-003 hero band, pill nav, section styles */

/* ── Hero band ─────────────────────────────────────────────── */
.mp-hero-band {
  background: linear-gradient(135deg, #0f0f1a 0%, #1a0a0a 60%, #1a1025 100%);
  min-height: 180px;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .mp-hero-band,
.dark .mp-hero-band {
  background: linear-gradient(135deg, #0a0a14 0%, #140808 60%, #0e0a1a 100%);
}

:root:not([data-theme="dark"]) .mp-hero-band {
  background: linear-gradient(135deg, #1a0f2e 0%, #2d0a0a 50%, #1a0f2e 100%);
}

.mp-hero-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 1rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.mp-hero-art {
  flex-shrink: 0;
  opacity: 0.85;
  padding-top: 0.25rem;
}

.mp-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

@media (max-width: 1200px) {
  .mp-hero-inner { grid-template-columns: 1fr; }
  .mp-hero-art { display: none; }
}

@media (max-width: 768px) {
  .mp-hero-band { padding: 1.25rem 1rem; }
}

/* ── Stat tiles ─────────────────────────────────────────────── */
.mp-stat-tile {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mp-stat-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.15);
}

.mp-stat-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: #F36717;
  line-height: 1;
  display: block;
}

.mp-stat-lbl {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  display: block;
}

.mp-stat-skeleton { opacity: 0.45; }

.mp-stat-delta {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-weight: 600;
}

.mp-stat-delta.up { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.mp-stat-delta.down { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ── Pill navigation ────────────────────────────────────────── */
.mp-pill-nav {
  position: sticky;
  top: 60px;
  z-index: 90;
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 1.5rem;
  background: var(--color-bg-content, #ffffff);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.mp-pill-nav::-webkit-scrollbar { display: none; }

.mp-pill {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: var(--color-text-secondary, #6b7280);
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.mp-pill:hover {
  color: #F36717;
  background: rgba(243, 103, 23, 0.08);
  border-color: rgba(243, 103, 23, 0.3);
}

.mp-pill.active {
  color: #F36717;
  background: rgba(243, 103, 23, 0.12);
  border-color: rgba(243, 103, 23, 0.4);
}

/* ── Section layout ─────────────────────────────────────────── */
.mp-section {
  padding: 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  scroll-margin-top: 110px;
}

.mp-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-primary, #1f2937);
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mp-section-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(243, 103, 23, 0.12);
  color: #F36717;
  font-weight: 500;
}

.mp-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .mp-two-col { grid-template-columns: 1fr; }
}

.mp-col { min-width: 0; }

/* ── Heatmap placeholder ────────────────────────────────────── */
.mp-heatmap-placeholder {
  background: var(--color-bg-content, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.75rem;
  min-height: 200px;
}

/* ── Recent items ───────────────────────────────────────────── */
.mp-recent-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.mp-recent-item:last-child { border-bottom: none; }

.mp-eco-badge {
  font-size: 0.68rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  white-space: nowrap;
  font-weight: 500;
  text-transform: lowercase;
}

.mp-pkg-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--color-text-primary, #1f2937);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-pkg-name:hover { text-decoration: underline; }

.mp-pkg-date {
  font-size: 0.72rem;
  color: var(--color-text-secondary, #6b7280);
  white-space: nowrap;
}

/* ── News items ─────────────────────────────────────────────── */
.mp-news-item {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.mp-news-item:last-child { border-bottom: none; }

.mp-news-title {
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-primary, #1f2937);
  text-decoration: none;
  line-height: 1.4;
  margin-bottom: 0.2rem;
}

.mp-news-title:hover { text-decoration: underline; }

.mp-news-meta {
  font-size: 0.72rem;
  color: var(--color-text-secondary, #6b7280);
}

.mp-news-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.mp-news-tab {
  border: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-bg-content, #ffffff);
  color: var(--color-text-secondary, #6b7280);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.72rem;
  cursor: pointer;
}

.mp-news-tab.is-active {
  color: #F36717;
  border-color: rgba(243, 103, 23, 0.45);
  background: rgba(243, 103, 23, 0.12);
}

.mp-news-panel { display: none; }
.mp-news-panel.is-active { display: block; }

.mp-heatmap-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mp-heatmap-kpi {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.6rem;
  padding: 0.5rem 0.65rem;
  background: var(--color-bg-content, #ffffff);
}

.mp-heatmap-kpi-label {
  display: block;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.15rem;
}

.mp-heatmap-kpi-value {
  display: block;
  color: var(--color-text-primary, #1f2937);
  font-size: 0.8rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Repeat offenders list ──────────────────────────────────── */
.mp-repeat-list {
  min-height: 60px;
}

.mp-offender-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mp-offender-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  background: var(--color-bg-content, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 0.5rem;
  transition: border-color 0.15s;
}

.mp-offender-row:hover {
  border-color: rgba(239, 68, 68, 0.4);
}

.mp-offender-author {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-primary, #1f2937);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mp-offender-score {
  font-size: 0.68rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  font-weight: 700;
}

.mp-offender-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mp-offender-count {
  font-size: 0.75rem;
  color: var(--color-text-secondary, #6b7280);
}

/* ── Loading / empty states ─────────────────────────────────── */
.mp-loading-text {
  font-style: italic;
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.875rem;
  margin: 0;
}

/* ── Hero section scroll offset fix ────────────────────────── */
#mp-hero, #mp-heatmap, #mp-recent-news, #mp-repeat {
  scroll-margin-top: 110px;
}

/* ── Hero feature card (Last 24h) ───────────────────────────── */
.mp-hero-stats {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
  width: 100%;
}

.mp-hero-feature-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: minmax(11rem, max-content) max-content minmax(12rem, 1fr);
  align-items: center;
  gap: 0.75rem 1.25rem;
  min-width: 0;
  width: 100%;
}

.mp-feature-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mp-feature-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mp-feature-card-body {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.mp-feature-count {
  font-size: 2.5rem;
  font-weight: 700;
  color: #F36717;
  line-height: 1;
}

.mp-feature-delta {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
}

.mp-feature-delta.up   { background: rgba(34, 197, 94, 0.2);  color: #22c55e; }
.mp-feature-delta.down { background: rgba(239, 68, 68, 0.2);  color: #ef4444; }

/* ── Context chip ───────────────────────────────────────────── */
.mp-context-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(243, 103, 23, 0.18);
  color: #F36717;
  border: 1px solid rgba(243, 103, 23, 0.35);
}

.mp-context-chip:empty { display: none; }

.mp-context-chip[data-chip="surge"]          { background: rgba(239,68,68,0.2);  color: #ef4444; border-color: rgba(239,68,68,0.4); }
.mp-context-chip[data-chip="quiet"]          { background: rgba(34,197,94,0.15); color: #22c55e; border-color: rgba(34,197,94,0.3); }
.mp-context-chip[data-chip="npm-dominant"]   { background: rgba(99,102,241,0.2); color: #818cf8; border-color: rgba(99,102,241,0.4); }
.mp-context-chip[data-chip="balanced"]       { background: rgba(156,163,175,0.2);color: #9ca3af; border-color: rgba(156,163,175,0.4); }

/* ── Sparkline SVG ──────────────────────────────────────────── */
.mp-sparkline {
  display: block;
  width: 100%;
  height: 28px;
  margin-top: 0;
  overflow: visible;
}

/* ── Smaller stat tiles row ─────────────────────────────────── */
.mp-stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  min-width: 0;
  width: 100%;
}

.mp-stat-sub {
  display: block;
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1200px) {
  .mp-hero-feature-card {
    grid-template-columns: minmax(10rem, max-content) max-content minmax(10rem, 1fr);
  }
  .mp-stat-tiles   { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .mp-hero-feature-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .mp-feature-card-header {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .mp-feature-card-body { flex-wrap: wrap; }
  .mp-stat-tiles   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mp-heatmap-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Recent sub-blocks ──────────────────────────────────────── */
.mp-recent-block {
  margin-bottom: 1.25rem;
}

.mp-recent-block:last-child { margin-bottom: 0; }

.mp-recent-block-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.mp-tooltip-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--color-border, #e5e7eb);
  color: var(--color-text-secondary, #6b7280);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: help;
  flex-shrink: 0;
}

.mp-rule-chip {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 0.2rem;
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── News category badges ───────────────────────────────────── */
.mp-news-cat {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 0.2rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.mp-news-cat--ransomware {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.mp-news-cat--nation {
  background: rgba(109, 40, 217, 0.18);
  color: #a78bfa;
}

.mp-news-cat--supply {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

/* ── Offender table ─────────────────────────────────────────── */
.mp-offender-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.mp-offender-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
  border-bottom: 2px solid var(--color-border, #e5e7eb);
  white-space: nowrap;
}

.mp-offender-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  color: var(--color-text-primary, #1f2937);
  vertical-align: middle;
}

.mp-offender-table tr:last-child td { border-bottom: none; }

.mp-offender-table tr:hover td {
  background: rgba(243, 103, 23, 0.04);
}

.mp-offender-author-cell code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.82rem;
  color: var(--color-text-primary, #1f2937);
}

.mp-campaign-chip {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(109, 40, 217, 0.15);
  color: #a78bfa;
  font-size: 0.75rem;
  font-weight: 600;
}

.mp-col-campaigns,
.mp-col-trend {
  white-space: nowrap;
}

.mp-trend-spark {
  display: inline-block;
  width: 60px;
  height: 18px;
  vertical-align: middle;
  overflow: visible;
}

.mp-offender-footer {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-secondary, #6b7280);
}

/* ── Light-mode overrides for dark-first hero elements ──────── */
:root:not([data-theme="dark"]) .mp-feature-count { color: #F36717; }
:root:not([data-theme="dark"]) .mp-feature-label { color: rgba(255,255,255,0.75); }
:root:not([data-theme="dark"]) .mp-stat-sub      { color: rgba(255,255,255,0.55); }
