/* ============================================================
   RoT Voice Monitor — History Page Styles
   ============================================================ */

.history-filters {
  padding: 1rem 0;
  border-bottom: 1px solid var(--rot-700);
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 180px;
  flex: 1;
}

.filter-label {
  font-size: 11px;
  color: var(--rot-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select,
.filter-group input[type="datetime-local"] {
  background: var(--rot-800);
  color: var(--rot-100);
  border: 1px solid var(--rot-700);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-family: var(--font);
  font-size: 13px;
}

.multi-select {
  background: var(--rot-800);
  border: 1px solid var(--rot-700);
  border-radius: 4px;
  padding: 0.25rem 0.4rem;
  min-height: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  cursor: text;
  position: relative;
}

.multi-select input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--rot-100);
  font-family: var(--font);
  font-size: 13px;
  flex: 1;
  min-width: 100px;
}

.multi-select .chip {
  background: var(--rot-700);
  color: var(--rot-100);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.multi-select .chip button {
  background: transparent;
  border: none;
  color: var(--rot-300);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}

.multi-select .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--rot-850);
  border: 1px solid var(--rot-700);
  border-radius: 4px;
  margin-top: 4px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 10;
}

.multi-select .dropdown div {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 13px;
}

.multi-select .dropdown div:hover {
  background: var(--rot-700);
}

.view-tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1rem;
  border-bottom: 1px solid var(--rot-700);
}

.view-tab {
  background: transparent;
  border: none;
  color: var(--rot-400);
  font-family: var(--font);
  font-size: 13px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.view-tab.active {
  color: var(--rot-100);
  border-bottom-color: var(--rot-crimson);
}

.view { display: block; }
.view.hidden { display: none; }

.timeline-list { display: flex; flex-direction: column; gap: 0; }

.timeline-row {
  display: grid;
  grid-template-columns: 80px auto 1fr;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rot-800);
  font-size: 13px;
  align-items: center;
}

.timeline-time { color: var(--rot-400); font-variant-numeric: tabular-nums; }
.timeline-type { color: var(--rot-200); font-size: 16px; width: 24px; text-align: center; }
.timeline-text { color: var(--rot-200); }
.timeline-text .user { color: var(--rot-100); font-weight: 500; }
.timeline-text .channel { color: var(--rot-crimson-light); }
.timeline-text .server  { color: var(--rot-400); font-size: 12px; }

.timeline-gap {
  background: var(--rot-800);
  color: var(--rot-yellow);
  padding: 0.5rem 0.75rem;
  font-size: 12px;
  text-align: center;
  border-bottom: 1px solid var(--rot-700);
}

.state-scrubber {
  background: var(--rot-900);
  border: 1px solid var(--rot-800);
  border-radius: 10px;
  padding: 1rem 1.25rem 0.9rem;
  margin-bottom: 1rem;
}
.state-scrubber-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.state-scrubber-readout {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.state-scrubber-readout-top {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.state-scrubber-time {
  font-size: 20px;
  font-weight: 700;
  color: var(--rot-100);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.state-scrubber-relative {
  font-size: 12px;
  color: var(--rot-400);
  font-variant-numeric: tabular-nums;
  background: var(--rot-800);
  padding: 2px 8px;
  border-radius: 10px;
}
.state-scrubber-live {
  font-size: 11px;
  color: var(--rot-500);
  font-variant-numeric: tabular-nums;
}
.state-scrubber-live .live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rot-green, #57F287);
  margin-right: 4px;
  vertical-align: middle;
  animation: pulse-live 2s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.state-scrubber-actions {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.state-scrubber-actions .btn-ghost {
  background: var(--rot-800);
  border: 1px solid var(--rot-700);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  font-size: 12px;
  font-weight: 500;
  color: var(--rot-200);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.state-scrubber-actions .btn-ghost:hover {
  background: var(--rot-700);
  border-color: var(--rot-600);
  color: var(--rot-100);
}
.state-scrubber-actions .btn-ghost:active {
  transform: translateY(1px);
}
.state-scrubber-actions #stateJumpNow {
  border-color: var(--rot-crimson);
  color: var(--rot-crimson-light, #f08080);
}
.state-scrubber-actions #stateJumpNow:hover {
  background: var(--rot-crimson);
  border-color: var(--rot-crimson);
  color: var(--rot-100);
}
.state-scrubber-toggle { margin-left: 0.25rem; }

.state-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  background: transparent;
  border-radius: 6px;
  outline: none;
  margin: 0.4rem 0 0.5rem;
  cursor: pointer;
}
.state-slider::-webkit-slider-runnable-track {
  height: 10px;
  background: linear-gradient(to right, var(--rot-800), var(--rot-700));
  border: 1px solid var(--rot-800);
  border-radius: 5px;
}
.state-slider::-moz-range-track {
  height: 10px;
  background: linear-gradient(to right, var(--rot-800), var(--rot-700));
  border: 1px solid var(--rot-800);
  border-radius: 5px;
}
.state-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  background: var(--rot-crimson);
  border: 3px solid var(--rot-100);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(160, 16, 16, 0.4);
  transition: box-shadow 0.15s, transform 0.1s;
}
.state-slider::-webkit-slider-thumb:hover,
.state-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 0 8px rgba(160, 16, 16, 0.22);
  transform: scale(1.08);
}
.state-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.12);
}
.state-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  background: var(--rot-crimson);
  border: 3px solid var(--rot-100);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.state-scrubber-bounds {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--rot-500);
  font-variant-numeric: tabular-nums;
  margin-top: 0.1rem;
}
.state-scrubber-bounds .bounds-label {
  font-size: 9px;
  color: var(--rot-600);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 1px;
}
.state-scrubber-bounds .bounds-end {
  text-align: right;
}
.state-scrubber-hint {
  color: var(--rot-600);
  font-size: 10px;
  font-style: italic;
  align-self: center;
}
.state-scrubber-staleness {
  font-size: 11px;
  color: var(--rot-yellow, #FEE75C);
  margin-top: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: rgba(254, 231, 92, 0.08);
  border: 1px solid rgba(254, 231, 92, 0.2);
  border-radius: 4px;
}
.state-scrubber-staleness.hidden { display: none; }
@media (max-width: 600px) {
  .state-scrubber-hint { display: none; }
  .state-scrubber-time { font-size: 17px; }
}

.graph-container {
  width: 100%;
  height: 300px;
  margin-bottom: 1rem;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 12px;
  color: var(--rot-300);
}

.graph-legend .legend-item { display: flex; align-items: center; gap: 4px; }
.graph-legend .swatch { width: 12px; height: 4px; border-radius: 2px; }

.nav-health {
  font-size: 11px;
  color: var(--rot-400);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--rot-800);
}
.nav-health.healthy { color: var(--rot-green); }
.nav-health.stale   { color: var(--rot-yellow); }
.nav-health.dead    { color: var(--rot-red); }

@media (max-width: 768px) {
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-group { min-width: 0; }
  .timeline-row { grid-template-columns: 60px 24px 1fr; gap: 0.5rem; font-size: 12px; }
}
