/*
 * Coretria Threat DNA — Stylesheet
 * Obsidian Console theme: dark, amber/cyan accents
 */

/* ─── MINI CHIP ─────────────────────────────────────────────────────── */
.dna-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 12px;
  background: #1a1a2a;
  border: 1px solid #2a2a3a;
  cursor: pointer;
  font-size: 11px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}
.dna-mini-chip:hover { border-color: #00c8ff44; background: #1e1e2e; }
.dna-mini-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dna-mini-label { color: #888; font-weight: 600; letter-spacing: 0.5px; }
.dna-mini-risk  { color: #ccc; font-weight: 700; }
.dna-mini-ts    { color: #666; }
.dna-mini-enforce { color: #ff3b3b; }
.dna-mini-new .dna-mini-label { color: #444; }

/* ─── SIDEBAR CONTAINER ─────────────────────────────────────────────── */
.dna-sidebar-container {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  overflow-y: auto;
  background: #0d0d1a;
  border-left: 1px solid #1e1e30;
  z-index: 9999;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Inter', 'Segoe UI', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: #2a2a3a #0d0d1a;
}
.dna-sidebar-container.open { right: 0; }

.dna-sidebar-loading,
.dna-sidebar-error {
  color: #666;
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
}

/* ─── SIDEBAR CONTENT ───────────────────────────────────────────────── */
.dna-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1e1e30;
  background: #0a0a14;
  position: sticky;
  top: 0;
  z-index: 1;
}
.dna-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #00c8ff;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.dna-icon { font-size: 16px; }
.dna-close-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}
.dna-close-btn:hover { color: #ff3b3b; }

/* ─── SUMMARY CHIP ──────────────────────────────────────────────────── */
.dna-summary-chip {
  margin: 16px 16px 8px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 10px;
  background: #0f0f1f;
}
.dna-summary-ip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #e0e0ff;
  margin-bottom: 12px;
}
.dna-summary-scores {
  display: flex;
  align-items: center;
  gap: 16px;
}
.dna-score-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid var(--ring-color, #666);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dna-score-val { font-size: 18px; font-weight: 800; color: #fff; line-height: 1; }
.dna-score-lbl { font-size: 9px; color: #888; text-transform: uppercase; }
.dna-score-stats {
  font-size: 12px;
  color: #aaa;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dna-score-stats b { color: #e0e0ff; }

/* ─── BADGE ─────────────────────────────────────────────────────────── */
.dna-badge {
  display: inline-block;
  border: 1px solid #444;
  color: #888;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── SECTIONS ──────────────────────────────────────────────────────── */
.dna-section {
  padding: 12px 16px;
  border-bottom: 1px solid #131325;
}
.dna-section-title {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.dna-muted { color: #444; font-size: 12px; }

/* ─── METRIC BARS ───────────────────────────────────────────────────── */
.dna-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: #888;
}
.dna-metric-row > span:first-child { width: 120px; flex-shrink: 0; }
.dna-bar-wrap {
  flex: 1;
  height: 4px;
  background: #1e1e30;
  border-radius: 2px;
  overflow: hidden;
}
.dna-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.dna-pct { width: 32px; text-align: right; color: #666; font-size: 11px; }

/* ─── BADGES ROWS ───────────────────────────────────────────────────── */
.dna-badges-row { display: flex; flex-wrap: wrap; gap: 5px; }
.dna-tech-badge {
  display: inline-block;
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.dna-fw-badge {
  display: inline-block;
  background: #1a1a2a;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: #aaa;
}

/* ─── SIGNATURES ────────────────────────────────────────────────────── */
.dna-sig-list { display: flex; flex-direction: column; gap: 4px; }
.dna-sig-item {
  font-size: 11px;
  color: #cc8800;
  background: #1a1200;
  border: 1px solid #332200;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: monospace;
}

/* ─── INFRA TABLE ───────────────────────────────────────────────────── */
.dna-infra-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dna-infra-table td { padding: 4px 8px 4px 0; color: #888; vertical-align: top; }
.dna-infra-table td:first-child { color: #555; width: 80px; }
.dna-infra-table td:last-child { color: #ccc; }

/* ─── ENFORCEMENT LOG ───────────────────────────────────────────────── */
.dna-enforce-log { display: flex; flex-direction: column; gap: 6px; }
.dna-enforce-entry {
  background: #0f0f1f;
  border: 1px solid #1e1e30;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
}
.dna-enforce-action { color: #ff8c00; font-weight: 700; font-family: monospace; margin-right: 6px; }
.dna-enforce-actor  { color: #00c8ff; margin-right: 6px; }
.dna-enforce-time   { color: #555; }
.dna-enforce-reason { color: #888; margin-top: 3px; font-style: italic; }

/* ─── QUICK ACTIONS ─────────────────────────────────────────────────── */
.dna-actions-section {
  padding: 14px 16px 20px;
}
.dna-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.dna-action-btn {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #2a2a3a;
  background: #0f0f1f;
  color: #ccc;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.dna-action-btn:hover { background: #1a1a2a; }
.dna-action-ban      { border-color: #ff3b3b44; color: #ff3b3b; }
.dna-action-ban:hover { border-color: #ff3b3b; background: #ff3b3b11; }
.dna-action-subnet   { border-color: #ff8c0044; color: #ff8c00; }
.dna-action-subnet:hover { border-color: #ff8c00; background: #ff8c0011; }
.dna-action-quarantine { border-color: #ffc80044; color: #ffc800; }
.dna-action-quarantine:hover { border-color: #ffc800; background: #ffc80011; }
.dna-action-build    { border-color: #00c8ff44; color: #00c8ff; }
.dna-action-build:hover { border-color: #00c8ff; background: #00c8ff11; }
.dna-action-unban    { border-color: #00c89644; color: #00c896; }
.dna-action-unban:hover { border-color: #00c896; background: #00c89611; }

/* ─── PANEL (WORK ROOM TABLE VIEW) ─────────────────────────────────── */
.dna-panel { font-family: 'Inter', sans-serif; }

.dna-stats-bar {
  display: flex;
  gap: 12px;
  padding: 16px 0 8px;
  flex-wrap: wrap;
}
.dna-stat-card {
  background: #0f0f1f;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  padding: 10px 18px;
  min-width: 110px;
  text-align: center;
}
.dna-stat-val  { font-size: 22px; font-weight: 800; color: #e0e0ff; }
.dna-stat-lbl  { font-size: 10px; color: #555; text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }
.dna-stat-badge {
  display: inline-block;
  background: #1a1a2a;
  border: 1px solid #2a2a3a;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11px;
  color: #aaa;
  margin: 2px;
}
.dna-families-bar { padding: 4px 0 8px; }
.dna-families-lbl { font-size: 11px; color: #555; margin-right: 6px; }

.dna-actor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dna-actor-table thead th:last-child {
  position: sticky;
  right: 0;
  background: #0d0d1a;
  z-index: 3;
}
.dna-actor-table thead th {
  text-align: left;
  padding: 8px 10px;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.8px;
  border-bottom: 1px solid #1e1e30;
}
.dna-row {
  cursor: pointer;
  border-bottom: 1px solid #0f0f1f;
  transition: background 0.1s;
}
.dna-row:hover { background: #0f0f1f; }
.dna-row td { padding: 10px 10px; vertical-align: middle; }
.dna-dt-cell { display: inline-flex; flex-direction: column; gap: 2px; min-width: 110px; }
.dna-dt-date { font-size: 11px; color: #d7d7ee; white-space: nowrap; }
.dna-dt-time { font-size: 10px; color: #777; white-space: nowrap; }
.dna-actions-cell {
  position: sticky;
  right: 0;
  white-space: nowrap;
  min-width: 120px;
  background: #0d0d1a;
  box-shadow: -10px 0 14px rgba(13, 13, 26, 0.9);
  z-index: 2;
}
.dna-row:hover .dna-actions-cell { background: #0f0f1f; }
.dna-row-ip  { font-family: monospace; font-size: 13px; color: #e0e0ff; font-weight: 600; }
.dna-row-geo { font-size: 10px; color: #555; margin-top: 2px; }
.dna-risk-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 12px;
}
.dna-risk-pill small { font-size: 9px; font-weight: 600; opacity: 0.8; }
.dna-row-techniques { min-width: 140px; }
.dna-tiny-badge {
  display: inline-block;
  background: #1a1a2a;
  border: 1px solid #2a2a3a;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9px;
  color: #888;
  margin: 1px;
}
.dna-row-action {
  display: inline-flex;
  align-items: center;
  background: #0f0f1f;
  border: 1px solid #2a2a3a;
  color: #888;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  margin-right: 4px;
  transition: border-color 0.15s;
}
.dna-row-action:hover { border-color: #00c8ff44; color: #ccc; }
.dna-empty {
  text-align: center;
  color: #444;
  padding: 40px;
  font-style: italic;
}
.dna-panel-loading,
.dna-panel-error {
  padding: 40px;
  text-align: center;
  color: #555;
  font-size: 14px;
}

/* ─── THREAT BUILDER MODAL ──────────────────────────────────────────── */
.dna-builder-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}
.dna-builder-modal.open { display: flex; }
.dna-builder-overlay {
  position: absolute;
  inset: 0;
  background: #00000088;
}
.dna-builder-panel {
  position: relative;
  width: 480px;
  max-width: 95vw;
  max-height: 90vh;
  background: #0d0d1a;
  border: 1px solid #2a2a3a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px #00000088;
}
.dna-builder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1e1e30;
  background: #0a0a14;
  font-size: 14px;
  font-weight: 700;
  color: #00c8ff;
  letter-spacing: 1px;
}
.dna-builder-header button {
  background: none; border: none; color: #666; cursor: pointer; font-size: 16px; padding: 4px 8px;
}
.dna-builder-header button:hover { color: #ff3b3b; }
.dna-builder-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dna-builder-note {
  font-size: 12px;
  color: #555;
  background: #0f0f1f;
  border: 1px solid #1e1e30;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.dna-builder-body label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dna-input {
  background: #0f0f1f;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  color: #e0e0ff;
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
  font-family: 'Inter', sans-serif;
  width: 100%;
  box-sizing: border-box;
}
.dna-input:focus { border-color: #00c8ff55; }
.dna-textarea { resize: vertical; min-height: 70px; }
select.dna-input { cursor: pointer; }
.dna-builder-autoenforce {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888;
}
.dna-builder-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #1e1e30;
  background: #0a0a14;
}
.dna-btn-cancel {
  background: #1a1a2a; border: 1px solid #2a2a3a; color: #888;
  padding: 8px 18px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.dna-btn-cancel:hover { border-color: #3a3a4a; color: #ccc; }
.dna-btn-build {
  background: #001a22; border: 1px solid #00c8ff44; color: #00c8ff;
  padding: 8px 20px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 600;
}
.dna-btn-build:hover { background: #00c8ff11; border-color: #00c8ff; }

/* ─── THREAT CARDS ──────────────────────────────────────────────────── */
.dna-threat-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.dna-threat-card {
  background: #0f0f1f;
  border: 1px solid #1e1e30;
  border-radius: 8px;
  padding: 14px 16px;
}
.dna-threat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.dna-threat-name { font-size: 14px; font-weight: 700; color: #e0e0ff; }
.dna-threat-meta { display: flex; gap: 5px; flex-shrink: 0; flex-wrap: wrap; }
.dna-threat-desc { font-size: 12px; color: #888; margin-bottom: 8px; }
.dna-threat-details { font-size: 11px; color: #666; display: flex; flex-direction: column; gap: 3px; }
.dna-threat-details b { color: #aaa; }
.dna-threat-notes { font-size: 11px; color: #555; margin-top: 8px; font-style: italic; }
.dna-empty-threats {
  text-align: center;
  color: #444;
  padding: 40px;
  font-size: 14px;
}

/* ─── ERROR MSG ─────────────────────────────────────────────────────── */
.dna-error-msg {
  color: #666;
  font-size: 13px;
  padding: 20px;
  text-align: center;
  line-height: 1.6;
}
