.diagnostic-wrapper {
  height: calc(100vh - var(--top-nav-height) - var(--sub-nav-height));
  display: flex;
  flex-direction: column;
}

.diagnostic-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.diagnostic-header {
  background: #f5f5f5;
  color: #111;
  padding: 20px;
  display: none;
}
.diagnostic-header h1 {
  margin: 0 0 10px 0;
  font-size: 24px;
}
.diagnostic-header p {
  margin: 0 0 15px 0;
  color: #aaa;
}

.status-bar {
  display: flex;
  gap: 30px;
  font-size: 14px;
}
.status-bar span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-value, .count-value {
  background: #333;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: monospace;
}

.status-value.connected {
  background: #333;
  color: rgba(90, 255, 155, 0.75);
}

.count-value {
  color: rgba(90, 255, 155, 0.75);
}

.editor-section {
  flex: 0 0 auto;
  padding: 20px;
  min-height: 200px;
  height: 300px;
  overflow: auto;
}

.panel {
  background: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.panel h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
}

#editor-container {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: auto;
}

.editor-info {
  margin-top: 10px;
  color: #666;
}
.editor-info small {
  font-size: 12px;
}

.cm-editor {
  height: 100%;
}

.cm-content {
  padding: 10px;
}

.cm-focused {
  outline: none;
}

.tl-highlight-warning {
  background-color: #fff3cd;
  border-bottom: 2px solid #ffc107;
}

.tl-highlight-error {
  background-color: #f8d7da;
  border-bottom: 2px solid #dc3545;
}

.tl-highlight-info {
  background-color: #d1ecf1;
  border-bottom: 2px solid #17a2b8;
}

#sequencer-wrapper {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  margin: 0 20px;
  overflow: hidden;
  min-height: 150px;
}

.sequencer-header {
  background: #1f1f1f;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #333;
}
.sequencer-header h4 {
  margin: 0;
  color: #fff;
  font-size: 14px;
}

.sequencer-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sequencer-controls button {
  background: #444;
  border: 1px solid #555;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.sequencer-controls button:hover {
  background: #555;
}
.sequencer-controls button span {
  font-size: 18px;
}

.timeline-label {
  background-color: rgba(250, 50, 55, 0.2) !important;
  color: rgba(250, 150, 155, 0.9) !important;
  height: 20px;
  display: flex;
  align-items: center;
  padding: 5px 20px;
}

.time-display {
  color: #7ec548;
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
  margin-right: 20px;
  padding: 4px 20px;
  height: 20px;
  box-sizing: border-box;
  border-radius: 4px;
  background-color: rgba(50, 150, 255, 0.1);
  color: rgb(90, 190, 255);
}

.sequencer-container {
  display: flex;
  height: 100%;
  position: relative;
  background: #1a1a1a;
}

.sequencer-tracks {
  width: 350px;
  background: #242424;
  border-right: 1px solid #333;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 54px;
  scrollbar-width: thin;
  scrollbar-color: #444 #1a1a1a;
}
.sequencer-tracks::-webkit-scrollbar {
  width: 6px;
}
.sequencer-tracks::-webkit-scrollbar-track {
  background: #1a1a1a;
}
.sequencer-tracks::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}
.sequencer-tracks::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.track-group {
  border-bottom: 1px solid #333;
}

.track-group-header {
  background: #2d2d2d;
  color: #7ec548;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 24px;
  box-sizing: border-box;
}
.track-group-header.collapsed {
  background: #252525;
}
.track-group-header.collapsed .expand-icon {
  transform: rotate(-90deg);
}
.track-group-header .expand-icon {
  font-size: 14px;
  transition: transform 0.2s;
}

.track-row {
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: #999;
  font-size: 11px;
  border-bottom: 1px solid #2a2a2a;
  background: #1f1f1f;
  box-sizing: border-box;
}
.track-row:hover {
  background: #252525;
}
.track-row.trigger {
  padding-left: 20px;
  color: #ff9800;
}
.track-row.regex {
  padding-left: 20px;
  color: #2196f3;
}

.sequencer-timeline {
  flex: 1;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: #444 #1a1a1a;
  user-select: none;
}
.sequencer-timeline::-webkit-scrollbar {
  height: 6px;
}
.sequencer-timeline::-webkit-scrollbar-track {
  background: #1a1a1a;
}
.sequencer-timeline::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}
.sequencer-timeline::-webkit-scrollbar-thumb:hover {
  background: #555;
}
.sequencer-timeline:active {
  cursor: grabbing !important;
}

.timeline-scroll-container {
  position: absolute;
  top: 30px;
  left: 0;
  right: 0;
  bottom: 0;
  transition: transform 0.1s linear;
}

.timeline-control-bar {
  display: flex;
  align-items: center;
  height: 30px;
  background: #1f1f1f;
  border-bottom: 1px solid #333;
  position: relative;
  z-index: 100;
}

.control-bar-left {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.timeline-label {
  color: #ff0000;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
}

.control-bar-center {
  width: 40px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
}

.control-bar-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
}

.timeline-info {
  font-size: 11px;
  color: #666;
}
.timeline-info .past-label,
.timeline-info .future-label {
  color: #888;
}
.timeline-info .separator {
  margin: 0 8px;
  color: #444;
}

.time-cursor-triangle {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #ff0000;
  margin-bottom: -1px;
}

.time-cursor-line {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  bottom: 0;
  background: white;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  z-index: 100;
  pointer-events: none;
}

.timeline-header {
  height: 24px;
  background: #2d2d2d;
  border-bottom: 1px solid #333;
  position: relative;
  z-index: 10;
}

.time-marker {
  width: 60px;
  text-align: center;
  color: rgba(50, 150, 255, 0.85);
  font-size: 10px;
  padding: 5px 0;
  border-right: 1px solid #333;
}

.timeline-tracks {
  position: relative;
  min-width: 100%;
}

.timeline-track {
  height: 24px;
  border-bottom: 1px solid #2a2a2a;
  position: relative;
  box-sizing: border-box;
}
.timeline-track.group-header {
  height: 24px;
  background: #252525;
}

.timeline-group-container {
  border-bottom: 2px solid #333;
}

.time-cell {
  position: absolute;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
.time-cell.pii-active {
  background: rgba(255, 0, 0, 0.3) !important;
}

.event-marker {
  width: 100%;
  height: 16px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: white;
  font-weight: bold;
}
.event-marker.trigger {
  background: #ff9800;
}
.event-marker.regex {
  background: #2196f3;
}
.event-marker.warning {
  background: #ffa726;
}
.event-marker.error {
  background: #f44336;
}

.event-block {
  position: absolute;
  height: 20px;
  top: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  padding: 0 5px;
  font-size: 10px;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  animation: eventPulse 0.3s ease-out;
  cursor: pointer;
}
.event-block.trigger {
  background: linear-gradient(135deg, #ff9800, rgb(204, 121.6, 0));
}
.event-block.regex {
  background: linear-gradient(135deg, #2196f3, rgb(11.5384615385, 124.0384615385, 213.4615384615));
}
.event-block.warning {
  background: linear-gradient(135deg, #ffa726, rgb(242, 143.8617511521, 0));
}
.event-block.error {
  background: linear-gradient(135deg, #f44336, rgb(234.1839622642, 27.9622641509, 12.8160377358));
}

@keyframes eventPulse {
  0% {
    transform: scaleY(0);
    opacity: 0;
  }
  50% {
    transform: scaleY(1.1);
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}
.diagnostic-footer {
  display: none;
}

.footer-tabs {
  display: flex;
  padding: 0px 20px;
  position: relative;
  background-color: transparent;
}

.tab-button {
  flex: 0 0 auto;
  padding: 4px 20px;
  background: transparent;
  border: none;
  font-size: 12px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 25px;
}
.tab-button:hover {
  background: #d5d5d5;
}
.tab-button.active {
  background: #444;
  color: #fff;
}

.footer-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  background: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.footer-toggle-btn:hover {
  background: #d5d5d5;
}
.footer-toggle-btn .material-symbols-outlined {
  font-size: 20px;
  color: #666;
}

.tab-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.tab-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  display: none;
  flex-direction: column;
}
.tab-panel.active {
  display: flex;
}
.tab-panel h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: #333;
}

.integration-code {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.integration-code pre {
  flex: 1;
  background: #1a1a1a;
  color: #7ec548;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0;
}
.integration-code code {
  font-family: "Courier New", monospace;
  font-size: 13px;
}

.event-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}
.event-controls div {
  display: flex;
  gap: 10px;
}
.event-controls button {
  padding: 4px 8px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}
.event-controls button:hover {
  background: #f0f0f0;
}
.event-controls label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #666;
}
.event-controls label input[type=checkbox] {
  margin: 0;
}

#event-log {
  flex: 1;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  background: white;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.event-item {
  margin-bottom: 8px;
  padding: 6px;
  background: #f8f8f8;
  border-left: 3px solid #007acc;
  border-radius: 3px;
}
.event-item.error {
  border-left-color: #d32f2f;
}
.event-item.warning {
  border-left-color: #ffa726;
}
.event-item.system {
  border-left-color: #9e9e9e;
}
.event-item.detection {
  border-left-color: #4caf50;
}

.event-time {
  color: #666;
  font-size: 11px;
}

.event-type {
  font-weight: bold;
  color: #007acc;
  margin-left: 10px;
}

.event-data {
  margin-top: 5px;
  color: #333;
  word-break: break-word;
  white-space: pre-wrap;
}

#graph-container {
  flex: 1;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
}
#graph-container svg {
  width: 100%;
  height: 100%;
}

.node {
  cursor: pointer;
}
.node.trigger circle {
  fill: #ff9800;
  stroke: rgb(204, 121.6, 0);
  stroke-width: 2px;
}
.node.intent circle {
  fill: #4caf50;
  stroke: #388e3c;
  stroke-width: 2px;
}
.node.regex circle {
  fill: #2196f3;
  stroke: rgb(11.5384615385, 124.0384615385, 213.4615384615);
  stroke-width: 2px;
}
.node text {
  font-size: 11px;
  pointer-events: none;
  text-anchor: middle;
  dy: 0.35em;
  fill: #333;
}

.link {
  fill: none;
  stroke: #999;
  stroke-opacity: 0.6;
  stroke-width: 1.5px;
}
.link.highlight {
  stroke: #ff4444;
  stroke-width: 2.5px;
  stroke-opacity: 1;
}

.tooltip {
  position: absolute;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
}

.graph-error {
  text-align: center;
  padding: 20px;
  color: #d32f2f;
}

.vertical-resizer {
  position: relative;
  height: 8px;
  background: transparent;
  cursor: row-resize;
  user-select: none;
  z-index: 10;
  margin: 0;
}
.vertical-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 20px;
  right: 20px;
  height: 1px;
  background: #ddd;
  transform: translateY(-50%);
}
.vertical-resizer.active::before {
  background: #007acc;
}

.vertical-resizer-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 4px;
  background: #999;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}
.vertical-resizer:hover .vertical-resizer-handle, .vertical-resizer.active .vertical-resizer-handle {
  opacity: 1;
}

body.resizing-vertical {
  cursor: row-resize !important;
  user-select: none;
}
body.resizing-vertical * {
  cursor: row-resize !important;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "liga";
}

#diagnostic-container {
  height: calc(100vh - 80px);
}
