/**
 * 5G NR SRS Resource Element Mapping Visualizer - scoped styles
 * 3GPP TS 38.211 Section 6.4.1.4, Table 6.4.1.4.3-1 | max-width 800px | Courier New | dark theme
 */
#srs5g-root {
  max-width: 800px;
  margin: 0 auto;
  background: #000;
  color: #e5e5e5;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 8px;
  box-sizing: border-box;
}

#srs5g-root * {
  box-sizing: border-box;
}

/* Two-column layout: controls left, grid right */
.srs5g-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.srs5g-layout-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
}

.srs5g-control-panel {
  flex: 0 0 auto;
  min-width: 260px;
  padding: 10px;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 4px;
}

.srs5g-rrc-info-panel {
  padding: 10px;
  background: #0d0d0d;
  border: 1px solid #333;
  border-radius: 4px;
  font-size: 11px;
  color: #e5e5e5;
}

.srs5g-rrc-param {
  margin-bottom: 4px;
}

.srs5g-rrc-param:last-child {
  margin-bottom: 0;
}

.srs5g-rrc-name {
  color: #8ae;
  margin-right: 6px;
}

#srs5g-root .srs5g-rrc-info-panel .srs5g-rrc-param span:last-child {
  color: #ffc107;
  font-weight: bold;
}

.srs5g-n-srs-display {
  transition: background-color 0.15s ease-out;
}

.srs5g-hop-flash {
  background-color: rgba(255, 193, 7, 0.4);
  border-radius: 2px;
}

.srs5g-control-panel .srs5g-param-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.srs5g-control-panel label {
  color: #fff;
  white-space: nowrap;
  min-width: 5em;
}

#srs5g-root input[type="range"] {
  flex: 1;
  min-width: 80px;
  max-width: 120px;
  vertical-align: middle;
}

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

#srs5g-root select {
  min-width: 4em;
}

.srs5g-value-span {
  min-width: 2.5em;
  color: #8ae;
  font-weight: bold;
}

/* Grids row: one or two grids side by side */
.srs5g-tabs-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.srs5g-tabs-header {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  border-bottom: 1px solid #333;
}

.srs5g-tab-btn {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 8px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-bottom: none;
  color: #999;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  margin-bottom: -1px;
}

.srs5g-tab-btn:hover {
  color: #e5e5e5;
  background: #252525;
}

.srs5g-tab-btn.srs5g-tab-active {
  background: #0d0d0d;
  color: #ffc107;
  border-color: #444;
}

.srs5g-tab-panel {
  display: none;
  padding: 0;
}

.srs5g-tab-panel.srs5g-tab-panel-active {
  display: block;
}

.srs5g-magnified-wrap {
  position: relative;
}

.srs5g-iq-subplot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 140px;
  padding: 4px;
  background: #111;
  border: 1px solid #444;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.srs5g-iq-subplot canvas {
  display: block;
  width: 80px;
  height: 80px;
}

.srs5g-iq-subplot-label {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}

.srs5g-seq-table-container {
  width: 100%;
  margin-top: 6px;
  font-size: 8px;
  border: 1px solid #333;
  background: #0d0d0d;
  border-radius: 2px;
}

.srs5g-seq-table {
  width: 100%;
  border-collapse: collapse;
  color: #beb;
  font-family: "Courier New", Courier, monospace;
  font-size: inherit;
}

.srs5g-seq-table th,
.srs5g-seq-table td {
  padding: 2px 4px;
  text-align: left;
  white-space: nowrap;
}

.srs5g-seq-table thead tr {
  border-bottom: 1px solid #333;
}

.srs5g-seq-table th {
  color: #888;
  font-weight: 600;
}

.srs5g-fullband-grids-row {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: flex-start;
  max-width: 800px;
}

.srs5g-fullband-grid-wrap {
  flex: 0 0 auto;
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
}

.srs5g-fullband-grid-wrap .srs5g-grid-label {
  font-size: 11px;
  color: #ffc107;
  margin-bottom: 4px;
}

#srs5g-fullband-grid-0,
#srs5g-fullband-grid-1 {
  display: block;
  max-width: 100%;
  background: #111;
  border: 1px solid #333;
}

.srs5g-grids-row {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 0 0 auto;
  align-items: flex-start;
}

.srs5g-grid-wrap {
  flex: 0 0 auto;
  padding: 8px;
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
}

.srs5g-grid-wrap.srs5g-hidden {
  display: none !important;
}

.srs5g-grid-label {
  font-size: 11px;
  color: #ffc107;
  margin-bottom: 4px;
}

#srs5g-resource-grid,
#srs5g-resource-grid-1 {
  display: block;
  max-width: 100%;
  background: #111;
  border: 1px solid #333;
}

.srs5g-tooltip {
  position: fixed;
  padding: 6px 10px;
  background: #1a1a1a;
  border: 1px solid #ffc107;
  border-radius: 4px;
  font-size: 11px;
  color: #e5e5e5;
  pointer-events: none;
  z-index: 1000;
  max-width: 280px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
  font-family: "Courier New", Courier, monospace;
}

.srs5g-btn {
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  padding: 6px 10px;
  background: #333;
  border: 1px solid #555;
  color: #e5e5e5;
  border-radius: 4px;
  cursor: pointer;
}

.srs5g-btn:hover {
  background: #444;
}

.srs5g-btn.srs5g-animating {
  background: #2d5016;
  border-color: #4a7c23;
}

.srs5g-btn:disabled,
.srs5g-btn.srs5g-btn-inactive {
  opacity: 0.5;
  cursor: not-allowed;
}

.srs5g-control-panel .srs5g-param-row-center {
  justify-content: center;
}

.srs5g-calc-display {
  margin-top: 8px;
  padding: 6px;
  background: #141414;
  border: 1px solid #333;
  border-radius: 2px;
  font-size: 11px;
  color: #beb;
}

.srs5g-calc-display strong {
  color: #ffc107;
}

/* Table container - 38.211 Table 6.4.1.4.3-1 */
.srs5g-table-container {
  margin-top: 16px;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 320px;
  scrollbar-width: thin;
  scrollbar-color: #444 #1a1a1a;
}

.srs5g-table-container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.srs5g-table-container::-webkit-scrollbar-track {
  background: #1a1a1a;
  border-radius: 2px;
}

.srs5g-table-container::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}

.srs5g-table-container::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.srs5g-table-container::-webkit-scrollbar-corner {
  background: #1a1a1a;
}

#srs5g-config-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #1a1a1a;
  box-shadow: 0 1px 0 #444;
}

.srs5g-table-container h3 {
  color: #ffc107;
  font-size: 12px;
  margin-bottom: 8px;
}

#srs5g-config-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  background: #0d0d0d;
}

#srs5g-config-table th,
#srs5g-config-table td {
  border: 1px solid #444;
  padding: 4px 6px;
}

#srs5g-config-table thead {
  background: #1a1a1a;
  font-weight: bold;
  color: #fff;
}

#srs5g-config-table tbody tr {
  color: #ccc;
}

.srs5g-highlight-row {
  background-color: rgba(255, 193, 7, 0.2) !important;
  outline: 2px solid #ffc107;
  font-weight: bold;
  color: #fff;
}

.srs5g-highlight-cell {
  background-color: #ffc107;
  color: #000;
}

.srs5g-legend {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.srs5g-legend .srs5g-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  border: 1px solid #444;
}

.srs5g-swatch-srs {
  background: #e53935;
}

.srs5g-swatch-empty {
  background: #1e1e1e;
}

.srs5g-note {
  margin-top: 10px;
  font-size: 11px;
  color: #999;
}
