/* --- Novich0k Traffic & Simulation redesign additions --- */

/* Traffic: section markers */
.section-marker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 10px;
}

/* Traffic: stream timeline */
.traffic-timeline {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 18px 0 24px;
}
.timeline-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.timeline-title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.timeline-sub { font-size: 13px; color: var(--dim); margin: 0; }
.timeline-track {
  position: relative;
  height: 56px;
  border-bottom: 1px solid var(--hairline-strong);
  margin-bottom: 16px;
}
.timeline-tick {
  position: absolute;
  bottom: -6px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  transform: translateX(-50%);
}
.timeline-event {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.timeline-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--azure);
  box-shadow: 0 0 10px rgba(65,255,255,0.35);
}
.timeline-event.legit .timeline-dot { background: var(--mint); box-shadow: 0 0 10px rgba(110,214,201,0.25); }
.timeline-event.conventional .timeline-dot { background: var(--warning); box-shadow: 0 0 10px rgba(240,199,94,0.25); }
.timeline-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

/* Traffic: stream table */
.stream-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.stream-table th,
.stream-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
}
.stream-table th {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  font-weight: 500;
}
.stream-table td { color: var(--read); }
.stream-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Traffic: comparison tabs */
.comp-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 18px;
}
.comp-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.comp-tab:hover { border-color: var(--hairline-strong); color: var(--ink); }
.comp-tab.active { background: var(--azure); color: var(--on-azure); border-color: var(--azure); font-weight: 700; }

/* Traffic: identification challenge */
.id-challenge {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .id-challenge { grid-template-columns: 1fr; } }
.id-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
}
.id-card h4 { margin: 0 0 14px; font-size: 15px; color: var(--ink); }
.id-card select {
  width: 100%;
  background: var(--void-soft);
  border: 1px solid var(--hairline-strong);
  border-radius: 8px;
  color: var(--ink);
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
}
.id-card .verdict {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  min-height: 20px;
}

/* Traffic: aggregate endpoints */
.aggregate-controls {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin: 18px 0;
}
.aggregate-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 260px 1fr;
}
@media (max-width: 900px) { .aggregate-grid { grid-template-columns: 1fr; } }
.endpoint-stack {
  display: flex; flex-direction: column; gap: 10px;
}
.endpoint-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}
.endpoint-chip:hover { border-color: var(--hairline-strong); }
.endpoint-chip.active { border-color: var(--azure); background: rgba(65,255,255,0.05); }
.endpoint-chip .ep-dot { width: 8px; height: 8px; border-radius: 50%; }
.endpoint-chip .ep-name { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.endpoint-chip .ep-status { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--dim); }

/* Traffic: analyst views */
.analyst-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 20px;
}
.analyst-tab {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all .2s;
}
.analyst-tab:hover { color: var(--ink); }
.analyst-tab.active { color: var(--azure); border-bottom-color: var(--azure); font-weight: 700; }
.analyst-panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 280px;
}

/* Traffic: correlation matrix */
.corr-matrix {
  display: grid;
  grid-template-columns: auto repeat(4, 1fr);
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.corr-matrix .corr-cell {
  padding: 8px;
  background: var(--void-soft);
  border-radius: 4px;
  text-align: center;
  color: var(--muted);
}
.corr-matrix .corr-cell.head { background: transparent; color: var(--dim); }
.corr-matrix .corr-cell.high { background: rgba(110,214,201,0.16); color: var(--mint); }
.corr-matrix .corr-cell.med { background: rgba(143,208,224,0.16); color: var(--info); }
.corr-matrix .corr-cell.low { background: rgba(133,130,143,0.12); color: var(--dim); }

/* Simulation: choose side */
.side-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 900px) { .side-grid { grid-template-columns: 1fr; } }
.side-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 30px;
  cursor: pointer;
  transition: border-color .25s, transform .25s var(--ease-out-exp), background .25s;
}
.side-card:hover { border-color: var(--hairline-strong); transform: translateY(-3px); }
.side-card.active.blue { border-color: var(--info); background: rgba(143,208,224,0.06); }
.side-card.active.red { border-color: var(--warning); background: rgba(240,199,94,0.06); }
.side-card .side-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.side-card .side-icon svg { width: 28px; height: 28px; }
.side-card.blue .side-icon { background: rgba(143,208,224,0.12); color: var(--info); }
.side-card.red .side-icon { background: rgba(240,199,94,0.12); color: var(--warning); }
.side-card h3 { margin: 0 0 10px; font-size: 1.4rem; }
.side-card p { margin: 0 0 20px; color: var(--read); font-size: 15.5px; }

/* Simulation: mode switcher */
.mode-switcher {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 24px 0;
}
.mode-switcher button {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
}
.mode-switcher button:hover { color: var(--ink); border-color: var(--hairline-strong); }
.mode-switcher button.active { background: var(--azure); color: var(--on-azure); border-color: var(--azure); font-weight: 700; }

/* Simulation: dashboard grid */
.sim-dashboard {
  display: grid;
  gap: 18px;
  grid-template-columns: 280px 1fr;
}
@media (max-width: 1000px) { .sim-dashboard { grid-template-columns: 1fr; } }
.sim-panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 22px;
}
.sim-panel h4 {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}

/* Telemetry list */
.tele-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 70px 1fr 100px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--hairline);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  align-items: center;
}
.tele-row .t-time { color: var(--dim); }
.tele-row .t-detail { color: var(--read); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tele-row .t-tag { text-align: right; }
.tele-row.mal .t-detail { color: var(--warning); }

/* Action panel */
.action-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 600px) { .action-grid { grid-template-columns: 1fr; } }
.action-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--hairline-strong);
  background: var(--void-soft);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: all .2s;
}
.action-btn:hover { border-color: var(--mint); }
.action-btn:disabled { opacity: .4; cursor: not-allowed; }
.action-btn .act-cost {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 4px;
}

/* Score strip */
.score-strip {
  display: flex; gap: 24px; flex-wrap: wrap;
}
.score-item {
  display: flex; flex-direction: column;
}
.score-item .score-value {
  font-size: 1.6rem; font-weight: 900; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.score-item .score-label {
  font-family: var(--font-mono); font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.08em;
}

/* Red console controls */
.control-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--hairline);
}
.control-row:last-child { border-bottom: none; }
.control-row label { font-size: 14px; color: var(--read); }
.control-row input[type="range"] { flex: 1; min-width: 120px; }
.control-row .control-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--azure);
  min-width: 48px;
  text-align: right;
}
.budget-bar {
  height: 8px;
  background: var(--void-soft);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 8px;
}
.budget-bar .budget-fill {
  height: 100%;
  background: var(--mint);
  border-radius: 4px;
  transition: width .3s, background .3s;
}
.budget-bar .budget-fill.warn { background: var(--warning); }
.budget-bar .budget-fill.danger { background: var(--danger); }

/* Detection pressure meter */
.pressure-meter {
  display: flex; align-items: center;
  gap: 8px;
}
.pressure-segment {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--void-soft);
  border: 1px solid var(--hairline);
}
.pressure-segment.active { background: var(--warning); border-color: var(--warning); box-shadow: 0 0 8px rgba(240,199,94,0.25); }
.pressure-segment.critical { background: var(--danger); border-color: var(--danger); box-shadow: 0 0 8px rgba(240,101,90,0.3); }

/* After-action report */
.aar-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 760px) { .aar-grid { grid-template-columns: 1fr; } }
.aar-list {
  list-style: none;
  padding: 0; margin: 0;
}
.aar-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--hairline);
  font-size: 14px;
  color: var(--read);
}
.aar-list li span { color: var(--dim); font-family: var(--font-mono); font-size: 11px; }

/* Leaderboard / guestbook */
.lb-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.lb-tab {
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.lb-tab.active { background: var(--azure); color: var(--on-azure); border-color: var(--azure); font-weight: 700; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb-table th, .lb-table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); text-align: left; }
.lb-table th { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; color: var(--dim); font-weight: 500; }
.guestbook-form {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
}
.guestbook-form input {
  flex: 1; min-width: 160px;
  background: var(--void-soft);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 14px;
}

/* Utility for hiding sections */
.view-section { display: none !important; }
.view-section.active { display: block !important; }

/* Defend simulation: endpoint list and detail */
.defend-dashboard {
  display: grid;
  gap: 18px;
  grid-template-columns: 240px 1fr 300px;
}
@media (max-width: 1100px) { .defend-dashboard { grid-template-columns: 1fr; } }

.endpoint-list { display: flex; flex-direction: column; gap: 8px; }
.endpoint-item {
  background: var(--void-soft);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all .2s;
}
.endpoint-item:hover { border-color: var(--hairline-strong); background: var(--panel); }
.endpoint-item.selected {
  border-color: var(--azure);
  box-shadow: 0 0 0 1px var(--azure), 0 8px 24px rgba(65,255,255,0.08);
}
.endpoint-item.isolated {
  border-left: 3px solid var(--danger);
}
.endpoint-item.contained {
  border-left: 3px solid var(--mint);
}
.endpoint-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.endpoint-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.endpoint-status {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--dim);
}

/* Endpoint detail panel */
.endpoint-detail-empty {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
}
.endpoint-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.endpoint-detail-header h3 { margin: 0; font-size: 1.2rem; }
.endpoint-detail-header .endpoint-summary { color: var(--muted); font-size: 13px; }

.log-card {
  background: var(--void-soft);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
}
.log-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  transition: background .2s;
}
.log-card-header:hover { background: var(--panel); }
.log-card-title {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
}
.log-card-summary {
  font-size: 13px;
  color: var(--read);
}
.log-card-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 3px 10px;
}
.log-card-body {
  border-top: 1px solid var(--hairline);
  padding: 14px 16px;
}
.log-raw {
  background: var(--void);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow-y: auto;
}
.log-raw .log-line { display: block; padding: 2px 0; border-bottom: 1px dashed var(--hairline); }
.log-raw .log-line:last-child { border-bottom: none; }
.log-raw .hl { color: var(--warning); }

.expand-btn {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-mono);
}
.expand-btn:hover { border-color: var(--azure); color: var(--azure); }

/* Action panel contextual */
.action-context {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
.action-btn.endpoint-only { border-left: 3px solid var(--azure); }
.action-btn.global { border-left: 3px solid var(--mint); }

/* Tutorial panel */
.tutorial-panel {
  background: rgba(65,255,255,0.06);
  border: 1px solid rgba(65,255,255,0.25);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}
.tutorial-panel h4 {
  margin: 0 0 10px;
  color: var(--azure);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tutorial-step {
  display: none;
  font-size: 14px;
  color: var(--read);
}
.tutorial-step.active { display: block; }
.tutorial-actions {
  display: flex; gap: 10px;
  margin-top: 14px;
}
.tutorial-hint {
  position: relative;
}
.tutorial-hint::after {
  content: '';
  position: absolute;
  inset: -3px;
  border: 1px dashed var(--azure);
  border-radius: inherit;
  animation: pulse-hint 1.6s infinite;
  pointer-events: none;
}
@keyframes pulse-hint {
  0% { opacity: 0; box-shadow: 0 0 0 0 rgba(65,255,255,0); }
  50% { opacity: 1; box-shadow: 0 0 0 4px rgba(65,255,255,0.12); }
  100% { opacity: 0; box-shadow: 0 0 0 0 rgba(65,255,255,0); }
}
.tutorial-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--azure);
  margin-right: 8px;
  box-shadow: 0 0 10px var(--azure);
}

/* Mode switcher supports more buttons */
.mode-switcher { flex-wrap: wrap; }
