/* === CoreScope — intel-hub.css === */
/* Tactical SHTF Intelligence Hub & Threat Beacon */

.intel-wrapper {
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(16px, 2vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Global DEFCON Beacon Bar */
.intel-beacon-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  background: var(--surface-1);
}

.intel-beacon-bar.defcon-5 {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  color: var(--status-green, #22c55e);
}

.intel-beacon-bar.defcon-3 {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: var(--status-yellow, #f59e0b);
}

.intel-beacon-bar.defcon-1 {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.12);
  color: var(--status-red, #ef4444);
  animation: defconPulse 2s infinite ease-in-out;
}

@keyframes defconPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.intel-beacon-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.intel-defcon-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
}

.defcon-5 .intel-defcon-badge { background: var(--status-green, #22c55e); }
.defcon-3 .intel-defcon-badge { background: var(--status-yellow, #f59e0b); color: #000; }
.defcon-1 .intel-defcon-badge { background: var(--status-red, #ef4444); }

/* Header */
.intel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.intel-title-area {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intel-title-area h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-xl, 22px);
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.02em;
}

.intel-subtitle {
  font-size: var(--fs-sm, 13px);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.intel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intel-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
}

.intel-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.intel-btn-primary {
  background: var(--accent);
  color: var(--text-on-accent, #fff);
  border-color: var(--accent);
}

.intel-btn-primary:hover {
  filter: brightness(1.1);
}

.intel-btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--status-red, #ef4444);
}

.intel-btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* Strategic Status Hero */
.intel-hero {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 28px;
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
}

@media (max-width: 960px) {
  .intel-hero {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.intel-status-orb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 4px solid var(--border);
  background: var(--surface-2);
  position: relative;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.08);
}

.intel-status-orb.defcon-5 {
  border-color: var(--status-green, #22c55e);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.25);
}

.intel-status-orb.defcon-3 {
  border-color: var(--status-yellow, #f59e0b);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.intel-status-orb.defcon-1 {
  border-color: var(--status-red, #ef4444);
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.35);
  animation: defconPulse 2s infinite ease-in-out;
}

.intel-orb-level {
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.intel-orb-text {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.intel-hero-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intel-hero-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.intel-hero-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.intel-hero-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  flex-wrap: wrap;
}

.intel-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.intel-stat-pills {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

@media (max-width: 960px) {
  .intel-stat-pills {
    flex-direction: row;
    flex-wrap: wrap;
    min-width: 0;
  }
}

.intel-pill-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.intel-pill-badge.crit {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
  color: var(--status-red, #ef4444);
}

.intel-pill-badge.elev {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  color: var(--status-yellow, #f59e0b);
}

.intel-pill-badge.nom {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.08);
  color: var(--status-green, #22c55e);
}

.intel-pill-badge strong {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Sections */
.intel-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.intel-sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.intel-sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

/* Threat Matrix Cards */
.intel-threat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.intel-threat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-left: 4px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.intel-threat-card:hover {
  transform: translateY(-1px);
}

.intel-threat-card.defcon-1 { border-left-color: var(--status-red, #ef4444); }
.intel-threat-card.defcon-3 { border-left-color: var(--status-yellow, #f59e0b); }
.intel-threat-card.defcon-5 { border-left-color: var(--status-green, #22c55e); }

.intel-threat-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.intel-threat-name {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.intel-threat-cat {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.intel-threat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.intel-threat-badge.defcon-1 {
  background: rgba(239, 68, 68, 0.14);
  color: var(--status-red, #ef4444);
}

.intel-threat-badge.defcon-3 {
  background: rgba(245, 158, 11, 0.14);
  color: var(--status-yellow, #f59e0b);
}

.intel-threat-badge.defcon-5 {
  background: rgba(34, 197, 94, 0.14);
  color: var(--status-green, #22c55e);
}

.intel-threat-obs {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
  background: var(--surface-0);
  border: 1px solid var(--border);
  padding: 9px 12px;
  border-radius: 8px;
  font-variant-numeric: tabular-nums;
}

.intel-countermeasure {
  background: rgba(14, 165, 233, 0.06);
  border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.intel-cm-title {
  font-weight: 800;
  color: var(--link-color);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.intel-cm-text {
  color: var(--text);
  line-height: 1.4;
}

/* Strategic Canaries */
.intel-canary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 14px;
}

.intel-canary-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intel-canary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.intel-canary-name {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text);
}

.intel-canary-stat {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.intel-canary-stat strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .intel-wrapper {
    padding: 12px;
    gap: 16px;
    padding-bottom: 72px;
  }

  .intel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .intel-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .intel-btn {
    justify-content: center;
    padding: 10px;
  }

  .intel-threat-grid {
    grid-template-columns: 1fr;
  }

  .intel-canary-grid {
    grid-template-columns: 1fr;
  }

  .intel-culprits-section .intel-sec-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .intel-culprits-section .intel-sec-header #btnCopyAllBlacklist {
    width: 100%;
    justify-content: center;
  }
}

/* Persistent Header DEFCON Beacon */
.nav-defcon-beacon {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: 6px;
}

.defcon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.defcon-pill.defcon-5 {
  background: rgba(34, 197, 94, 0.12);
  color: var(--status-green, #22c55e);
  border-color: rgba(34, 197, 94, 0.3);
}

.defcon-pill.defcon-5:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.5);
}

.defcon-pill.defcon-3 {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-yellow, #f59e0b);
  border-color: rgba(245, 158, 11, 0.35);
}

.defcon-pill.defcon-3:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.6);
}

.defcon-pill.defcon-1 {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-red, #ef4444);
  border-color: rgba(239, 68, 68, 0.5);
  animation: defconPulse 2s infinite ease-in-out;
}

.defcon-pill.defcon-1:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.8);
}

/* === Active Threat Culprits Section === */
.intel-culprits-section {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: var(--surface-1);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.08);
}

.intel-culprit-badge-pulse {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--status-red, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  animation: defconPulse 2s infinite ease-in-out;
}

.intel-culprit-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.intel-culprit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.intel-culprit-table th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.intel-culprit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.culprit-row:hover td {
  background: var(--surface-2);
}

.culprit-row.defcon-1 td {
  background: rgba(239, 68, 68, 0.03);
}

.culprit-row.defcon-3 td {
  background: rgba(245, 158, 11, 0.03);
}

.culprit-id-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
}

.culprit-id-tag:hover {
  border-color: var(--accent);
  background: var(--surface-3, rgba(0, 0, 0, 0.05));
}

.culprit-id-tag code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.culprit-sev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.culprit-sev-dot.defcon-1 { background: var(--status-red, #ef4444); box-shadow: 0 0 6px var(--status-red); }
.culprit-sev-dot.defcon-3 { background: var(--status-yellow, #f59e0b); box-shadow: 0 0 6px var(--status-yellow); }

.culprit-evidence-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  word-break: break-all;
}

.culprit-actions-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.intel-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.intel-btn-sm:hover {
  background: var(--surface-2);
  border-color: var(--border-hover, var(--border));
}

.intel-btn-sm.intel-btn-copy {
  color: var(--status-red, #ef4444);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.05);
}

.intel-btn-sm.intel-btn-copy:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: var(--status-red, #ef4444);
}

/* Threat Card Culprits Tag */
.intel-threat-culprits {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.intel-culprit-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.intel-culprit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.intel-culprit-chip:hover {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.6);
}

.intel-culprit-chip code {
  color: var(--status-red, #ef4444);
  font-size: 11px;
}
