/*
 * Copyright (C) 2026 Johan Pieterse
 * Plain Sailing Information Systems
 * Email: johan@plainsailingisystems.co.za
 *
 * This file is part of OpenRiC. Licensed AGPL-3.0-or-later.
 */

.demo-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 1rem 0 1.2rem;
  padding: 0.9rem 1rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 0.95rem;
}

.demo-controls label {
  font-weight: 600;
  color: #374151;
}

.demo-controls select,
.demo-controls input[type="text"] {
  flex: 1 1 260px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.95rem;
  min-width: 260px;
  font-family: inherit;
}

.demo-controls button {
  padding: 0.4rem 1rem;
  background: #1f5fa8;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.demo-controls button:hover { background: #0f3e75; }

.demo-controls .view-toggle {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  overflow: hidden;
}
.demo-controls .view-toggle button {
  background: #fff;
  color: #374151;
  padding: 0.4rem 0.8rem;
  border-radius: 0;
  font-weight: 500;
}
.demo-controls .view-toggle button.active {
  background: #1f5fa8;
  color: #fff;
}

.demo-stage {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  margin-top: 1rem;
}

#openric-graph {
  width: 100%;
  height: 520px;
  background: #111827;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  position: relative;
}

.demo-side-panel {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  max-height: 520px;
  overflow-y: auto;
  font-size: 0.9rem;
}

.demo-side-panel h3 {
  margin-top: 0;
  font-size: 1rem;
  color: #1f2937;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 0.4rem;
}

.demo-side-panel pre {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.8em;
  white-space: pre-wrap;
  word-break: break-word;
}

.demo-side-panel a {
  color: #1f5fa8;
  word-break: break-all;
}

.demo-status {
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  margin-top: 0.4rem;
  display: inline-block;
}
.demo-status.ok     { background: #d1fae5; color: #065f46; }
.demo-status.err    { background: #fee2e2; color: #991b1b; }
.demo-status.info   { background: #dbeafe; color: #1e40af; }

.demo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #374151;
}
.demo-legend .swatch {
  display: inline-block;
  width: 12px; height: 12px;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: middle;
}

@media (max-width: 800px) {
  .demo-stage { grid-template-columns: 1fr; }
  .demo-side-panel { max-height: 320px; }
  #openric-graph { height: 420px; }
}
