/* sidebar.css — Sidebar sections, field rows, inputs */

/* ── Sidebar container ───────────────────────────────────────── */

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-empty {
  padding: 16px 8px;
  color: rgba(255,255,255,0.28);
  font-size: 12px;
  text-align: center;
  font-style: italic;
  line-height: 1.5;
}

/* ── Section ─────────────────────────────────────────────────── */

.sidebar-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 2px;
}

.multi-selection-caption {
  margin: -1px 0 3px;
  color: rgba(255,255,255,0.36);
  font-size: 11px;
  line-height: 1.35;
}

.sidebar-subheading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.38);
  margin: 10px 0 4px;
}
.sidebar-subheading:first-child {
  margin-top: 2px;
}

.sidebar-schema-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.46);
  margin: 10px 0 3px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.secondary-dropdown {
  margin: 10px 0 3px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.secondary-dropdown-summary {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.46);
  cursor: pointer;
  user-select: none;
}

.secondary-dropdown-summary:hover {
  color: rgba(255,255,255,0.68);
}

.secondary-dropdown-body {
  margin-top: 4px;
}

.sidebar-schema-subheading {
  margin: 12px 0 3px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.34);
}

.advanced-subsection {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.advanced-subheading {
  color: rgba(255,255,255,0.32);
  margin: 0 0 2px;
}

.cage-secondary-subsection {
  margin-top: 8px;
}

.cage-secondary-subsection .secondary-dropdown {
  margin-top: 4px;
}

/* Caption shown below a field. Indented to line up under the input. */
.field-help {
  font-size: 10px;
  color: rgba(255,255,255,0.42);
  line-height: 1.3;
  margin: -2px 0 2px 106px;
  font-style: italic;
}

/* ── Field rows ──────────────────────────────────────────────── */

.field-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-height: 26px;
}

/* Wraps conditional sub-fields under a parent toggle so the hierarchy is
   visually obvious. Adds a subtle vertical guide-line and indent. Nestable —
   placing one .field-nest inside another stacks the indents naturally. */
.field-nest {
  margin-left: 6px;
  padding-left: 10px;
  border-left: 2px solid rgba(77, 139, 255, 0.25);
  display: flex;
  flex-direction: column;
}

/* Tighten the label column inside nested rows so the input box doesn't get
   crushed by the extra left padding. */
.field-nest .field-row label {
  flex-basis: 94px;
}
.field-nest .field-nest .field-row label {
  flex-basis: 84px;
}
/* Field-help indent compensates for the extra nest indent so the caption still
   sits under the input column, not visually drifting right. */
.field-nest .field-help {
  margin-left: 100px;
}
.field-nest .field-nest .field-help {
  margin-left: 90px;
}

.field-row label {
  flex: 0 0 100px;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  padding-top: 4px;
  cursor: default;
}

.field-label-text {
  min-width: 0;
}

.field-row label.has-tooltip {
  cursor: help;
}

.field-tooltip-bubble {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: max-content;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - 16px);
  padding: 6px 7px;
  border: 1px solid rgba(77,139,255,0.35);
  border-radius: 4px;
  background: rgba(12,17,28,0.98);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  color: rgba(232,238,255,0.92);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  overflow: auto;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-2px);
  transition: opacity 0.08s ease, transform 0.08s ease, visibility 0.08s ease;
}

.field-row label.has-tooltip.tooltip-visible .field-tooltip-bubble,
.field-row label.has-tooltip:hover .field-tooltip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ── Inputs ──────────────────────────────────────────────────── */

.field-row input[type="number"],
.field-row input[type="text"],
.field-row select {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: #d8d8e8;
  font-size: 12px;
  padding: 3px 6px;
  height: 24px;
  outline: none;
  transition: border-color 0.1s;
}

.field-row input[type="number"]:focus,
.field-row input[type="text"]:focus,
.field-row select:focus {
  border-color: #4d8bff;
  background: rgba(0,0,0,0.5);
}

.field-row input[type="number"]::-webkit-inner-spin-button {
  opacity: 0.5;
}

.field-row .mixed-value-input::placeholder {
  color: rgba(255,255,255,0.5);
  opacity: 1;
}

.field-row select {
  cursor: pointer;
  appearance: auto;
}

/* Checkbox — right-aligned */
.field-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #4d8bff;
  margin-left: auto;
}

.checkbox-inline {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: rgba(255,255,255,0.55);
  font-size: 11px;
  line-height: 1.2;
  padding-top: 4px;
}

.checkbox-inline input[type="checkbox"] {
  flex: 0 0 auto;
  margin-left: 0;
}

/* ── Lane + Segment pickers ──────────────────────────────────── */

.lane-seg-row {
  gap: 8px;
  align-items: flex-start;
}

.lane-seg-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lane-seg-group label {
  flex: none;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.lane-seg-group select {
  width: 100%;
  height: 26px;
  font-size: 12px;
  padding: 2px 4px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #d8d8e8;
  outline: none;
}
.lane-seg-group select:focus { border-color: #4d8bff; }

/* World coord display */
.coord-display {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  font-family: 'Consolas', 'Courier New', monospace;
  padding: 1px 2px;
  letter-spacing: 0.03em;
}

/* ── Color field ─────────────────────────────────────────────── */

.color-row label {
  flex: 0 0 100px;
}

.color-group {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}

.color-group input[type="color"] {
  width: 36px;
  height: 24px;
  padding: 1px 2px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.alpha-wrap {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  flex-shrink: 0;
}

.alpha-input {
  width: 52px !important;
  flex: none !important;
}

/* ── Section separator ───────────────────────────────────────── */

.sidebar-separator {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 4px 0;
}

/* ── Player panel (blue window) ─────────────────────────────── */

.player-panel {
  background: rgba(20, 55, 130, 0.28);
  border: 1px solid rgba(77, 139, 255, 0.45);
  border-radius: 6px;
}

.player-panel .sidebar-section-title {
  color: rgba(140, 185, 255, 0.85);
  border-bottom-color: rgba(77, 139, 255, 0.25);
}

/* ── Delete button ───────────────────────────────────────────── */

.delete-btn {
  margin-top: 6px;
  width: 100%;
  padding: 6px;
  background: rgba(220, 50, 50, 0.12);
  border: 1px solid rgba(220, 50, 50, 0.3);
  border-radius: 4px;
  color: #ff8080;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.delete-btn:hover  { background: rgba(220, 50, 50, 0.25); }
.delete-btn:active { background: rgba(220, 50, 50, 0.4); }

/* ── Scrollbar styling ───────────────────────────────────────── */

.sidebar-content::-webkit-scrollbar,
.level-tabs::-webkit-scrollbar { width: 4px; }
.sidebar-content::-webkit-scrollbar-track,
.level-tabs::-webkit-scrollbar-track { background: transparent; }
.sidebar-content::-webkit-scrollbar-thumb,
.level-tabs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}
