/* ── ATT&CK Matrix Grid ─────────────────────── */

#matrix-container { padding: 12px 16px; }

#attack-matrix {
  display: grid;
  grid-template-columns: repeat(12, minmax(90px, 1fr));
  gap: 3px;
  min-width: 1100px;
}

.tactic-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Tactic Column Header ────────────────────── */

.tactic-header {
  padding: 8px 6px;
  text-align: center;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  background: var(--surface);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--border);
}

.tactic-header .tactic-count {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.tactic-header .tactic-hit {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 2px;
  transition: color 0.2s;
}

.tactic-header .tactic-hit.has-hits {
  color: var(--danger-text);
  font-weight: 600;
}

/* ── Technique Cell — Idle ───────────────────── */

.tech-cell {
  padding: 5px 6px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
  min-height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 1px solid transparent;
}

.tech-cell:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

.tech-cell.selected {
  border-color: var(--accent);
  background: var(--accent-surface);
}

.tech-id {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.2px;
}

.tech-name {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Technique Cell — Detected (severity colors) ── */

.tech-cell.detected {
  animation: cell-detect 0.5s ease-out;
}

/* Critical — strong red, visible in both themes */
.tech-cell.detected.critical {
  background: var(--danger-surface);
  border-color: var(--red-4, rgba(229,72,77,0.3));
}
.tech-cell.detected.critical .tech-id { color: var(--danger-text); opacity: 0.7; }
.tech-cell.detected.critical .tech-name { color: var(--danger-text); font-weight: 600; }

/* High — orange */
.tech-cell.detected.high {
  background: var(--warning-surface);
  border-color: var(--orange-3, rgba(247,107,21,0.3));
}
.tech-cell.detected.high .tech-id { color: var(--warning-text); opacity: 0.7; }
.tech-cell.detected.high .tech-name { color: var(--warning-text); font-weight: 600; }

/* Medium — amber/yellow */
.tech-cell.detected.medium {
  background: var(--caution-surface);
  border-color: var(--amber-3, rgba(255,197,61,0.3));
}
.tech-cell.detected.medium .tech-id { color: var(--caution-text); opacity: 0.7; }
.tech-cell.detected.medium .tech-name { color: var(--caution-text); font-weight: 600; }

/* Low — green */
.tech-cell.detected.low {
  background: var(--success-surface);
  border-color: var(--green-3, rgba(41,211,146,0.3));
}
.tech-cell.detected.low .tech-id { color: var(--success-text); opacity: 0.7; }
.tech-cell.detected.low .tech-name { color: var(--success-text); font-weight: 600; }

/* ── Hit Counter Badge ───────────────────────── */

.tech-hits {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.15s;
}

.tech-cell.detected .tech-hits { opacity: 1; }

.tech-hits.critical { background: var(--danger); color: white; }
.tech-hits.high { background: var(--warning); color: white; }
.tech-hits.medium { background: var(--caution); color: var(--gray-1); }
.tech-hits.low { background: var(--success); color: white; }
