/**
 * 5G NR PDSCH DMRS Visualizer - scoped styles
 * Max simulation width 800px; Courier New; black theme.
 */
#dmrs-dl5g-root {
  max-width: 800px;
  margin: 0 auto;
  background: #0f0f0f;
  color: #e5e5e5;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 8px;
  box-sizing: border-box;
}

#dmrs-dl5g-root * {
  box-sizing: border-box;
}

/* Control panel */
.dmrs-control-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 12px;
  padding: 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
}

.dmrs-control-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dmrs-control-row label {
  white-space: nowrap;
  color: #94a3b8;
}

#dmrs-dl5g-root select,
#dmrs-dl5g-root input[type="text"],
#dmrs-dl5g-root input[type="number"] {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 4px 6px;
  background: #1e1e1e;
  border: 1px solid #444;
  color: #e5e5e5;
  border-radius: 2px;
}

#dmrs-dl5g-root select:focus,
#dmrs-dl5g-root input[type="text"]:focus,
#dmrs-dl5g-root input[type="number"]:focus {
  outline: none;
  border-color: #3b82f6;
}

#dmrs-dl5g-root input[type="number"] {
  width: 8em;
}

.dmrs-v-index-row {
  margin-bottom: 12px;
}

/* Port checkboxes */
.dmrs-ports-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
}

.dmrs-ports-wrap label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #94a3b8;
}

.dmrs-ports-wrap input[type="checkbox"] {
  accent-color: #3b82f6;
  cursor: pointer;
}

/* Grid of RBs */
.dmrs-re-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.dmrs-grid-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  padding: 6px;
}

.dmrs-grid-cell .dmrs-port-label {
  font-weight: bold;
  color: #64748b;
  margin-bottom: 4px;
  font-size: 11px;
}

.dmrs-grid-cell canvas {
  display: block;
  border: 1px solid #333;
  background: #111;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

/* Legend */
.dmrs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 10px;
  padding: 6px 8px;
  background: #1a1a1a;
  border-radius: 4px;
  font-size: 11px;
}

.dmrs-legend-allocated { color: #eab308; font-weight: bold; }
.dmrs-legend-reserved { color: #1e3a8a; font-weight: bold; }
.dmrs-legend-dmrs0 { color: #60a5fa; font-weight: bold; }
.dmrs-legend-dmrs1 { color: #3b82f6; font-weight: bold; }
.dmrs-legend-dmrs2 { color: #1d4ed8; font-weight: bold; }
.dmrs-legend-pdsch { color: #64748b; }
.dmrs-legend-outside-pdsch { color: #111827; }
.dmrs-legend-desc {
  width: 100%;
  margin: 6px 0 0 0;
  color: #94a3b8;
  font-style: italic;
  font-size: 11px;
}

/* Info box */
.dmrs-info-section {
  margin-bottom: 8px;
}

.dmrs-param-table-title { margin-top: 1rem; margin-bottom: 0.5rem; font-weight: bold; }
.dmrs-info-section h4 {
  margin: 0 0 6px 0;
  color: #94a3b8;
  font-size: 12px;
}

.dmrs-hover-info {
  min-height: 24px;
  padding: 6px 8px;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 4px;
  color: #94a3b8;
  font-size: 11px;
  margin-bottom: 8px;
}

.dmrs-table-filter {
  margin-bottom: 6px;
}

.dmrs-table-filter input {
  width: 200px;
}

.dmrs-table-wrap {
  overflow-x: auto;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a1a;
  margin-bottom: 8px;
}

#dmrs-dl5g-root .dmrs-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

#dmrs-dl5g-root .dmrs-ref-table th,
#dmrs-dl5g-root .dmrs-ref-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid #333;
}

#dmrs-dl5g-root .dmrs-ref-table th {
  background: #252525;
  color: #e2e8f0;
  font-weight: bold;
}

#dmrs-dl5g-root .dmrs-ref-table td {
  color: #cbd5e1;
  background: #1a1a1a;
}

#dmrs-dl5g-root .dmrs-ref-table tbody tr:hover {
  background: #252525;
}

#dmrs-dl5g-root .dmrs-ref-table tbody tr:hover td {
  color: #e2e8f0;
}

#dmrs-dl5g-root .dmrs-ref-table tr.dmrs-row-highlight td {
  background: #1e3a5f;
  color: #e2e8f0;
}

#dmrs-dl5g-root .dmrs-ref-table tr.dmrs-row-highlight td.dmrs-cell-ports {
  color: #93c5fd;
}

#dmrs-dl5g-root .dmrs-ref-table td.dmrs-cell-ports {
  color: #60a5fa;
  font-weight: bold;
}

.dmrs-note {
  padding: 8px;
  background: #1e293b;
  border-left: 3px solid #3b82f6;
  border-radius: 2px;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
}
