/* Reset and Base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0b0d;
  color: #e5e7eb;
}

#root {
  min-height: 100vh;
}

/* Layout */
.app-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #0a0b0d;
  color: white;
}

/* Header */
.app-header {
  background: #111214;
  border-bottom: 1px solid #374151;
  padding: 16px 32px;
  flex-shrink: 0;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.header-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: bold;
  color: white;
}

.header-title p {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.1);
  color: #34d399;
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.events-badge {
  padding: 8px 16px;
  background: #1f2937;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
  font-weight: 500;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.column {
  display: flex;
  flex-direction: column;
}

.column-left {
  width: 33.333%;
  background: #0e0f11;
  border-right: 1px solid #374151;
}

.column-middle {
  width: 25%;
  background: #0a0b0d;
  border-right: 1px solid #374151;
}

.column-right {
  flex: 1;
  background: #0e0f11;
}

/* Section Headers */
.section-header {
  padding: 20px 24px;
  border-bottom: 1px solid #374151;
  flex-shrink: 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: white;
}

.section-subtitle {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
}

.icon-cyan { color: #22d3ee; }
.icon-purple { color: #a78bfa; }
.icon-green { color: #4ade80; }

/* Content Areas */
.section-content {
  flex: 1;
  overflow: hidden;
}

.content-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #6b7280;
  text-align: center;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state svg {
  opacity: 0.3;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
}

/* Timeline */
.timeline-container {
  height: 100%;
  overflow-y: auto;
  padding: 32px;
}

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

.timeline-item {
  padding: 16px;
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid #374151;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.timeline-item:hover {
  background: rgba(31, 41, 55, 0.8);
  border-color: #4b5563;
}

.timeline-item.active {
  background: rgba(6, 182, 212, 0.1);
  border-color: #06b6d4;
  box-shadow: 0 0 0 1px #06b6d4;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.timeline-node {
  display: flex;
  align-items: center;
  gap: 12px;
}

.node-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.node-name {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  color: white;
}

.timeline-timestamp {
  font-size: 12px;
  color: #9ca3af;
}

.timeline-type {
  font-size: 12px;
  color: #6b7280;
  margin-left: 24px;
}


/* State Viewer */
.state-viewer {
  height: 100%;
  overflow-y: auto;
}

.state-section {
  padding: 32px;
  border-bottom: 1px solid #374151;
}

.state-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.state-section-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: white;
}

.node-badge {
  padding: 4px 8px;
  background: #1f2937;
  color: #9ca3af;
  font-size: 12px;
  border-radius: 4px;
}

.state-content {
  background: #1a1b1e;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 16px;
}

.diff-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.diff-card {
  padding: 16px;
  border-radius: 8px;
  border: 1px solid;
}

.diff-card.added {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
}

.diff-card.removed {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.3);
}

.diff-card.modified {
  background: rgba(251, 191, 36, 0.05);
  border-color: rgba(251, 191, 36, 0.3);
}

.diff-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.diff-header.added { color: #34d399; }
.diff-header.removed { color: #f87171; }
.diff-header.modified { color: #fbbf24; }

.diff-items {
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diff-item {
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

.diff-item.added { color: #6ee7b7; }
.diff-item.removed { color: #fca5a5; }
.diff-item.modified { color: #fcd34d; }

.diff-change {
  margin-bottom: 12px;
}

.diff-change-key {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #fbbf24;
  margin-bottom: 4px;
}

.diff-change-values {
  padding-left: 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
}

/* Playback Controls */
.playback-controls {
  background: #111214;
  border-top: 1px solid #374151;
  padding: 20px 32px;
  flex-shrink: 0;
}

.progress-container {
  margin-bottom: 20px;
}

.progress-bar-wrapper {
  position: relative;
  height: 8px;
  background: #1f2937;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4 0%, #2563eb 100%);
  transition: width 0.3s;
  border-radius: 4px;
}

.progress-bar-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #9ca3af;
}

.controls-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.control-btn {
  padding: 12px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-center;
}

.control-btn:hover:not(:disabled) {
  background: #374151;
  border-color: #4b5563;
}

.control-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.control-btn.play {
  padding: 16px;
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.control-btn.play:hover {
  box-shadow: 0 6px 16px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1a1b1e;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

/* Mermaid */
.mermaid-container {
  padding: 32px;
  height: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-center;
}

.mermaid-container svg {
  max-width: 100%;
  height: auto;
}
