/*
 * Menu mockup — matches Arclyte in-game UI (ImGui theme 2: dark + blue accent).
 * Colors from render.cpp apply_ui_theme() dark branch + case 2 (blue).
 */

.menu-preview-section {
  background: var(--bg-mid);
  padding-top: var(--space-2xl) !important;
  padding-bottom: var(--space-2xl) !important;
}

/* Actual in-game size: 690×540 px (ImGui SetNextWindowSize) */
.menu-mockup-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-md) 0;
  overflow-x: auto;
}

@media (max-width: 720px) {
  .menu-mockup-wrap {
    justify-content: flex-start;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
  }
}

/* Exact ImGui dark theme (blue accent) — font 13px Consolas per render.cpp */
.menu-mockup {
  --imgui-window-bg: #101010;        /* 0.063 */
  --imgui-child-bg: #111111;        /* 0.067 */
  --imgui-menubar-bg: #141414;      /* 0.078 */
  --imgui-text: #ffffff;
  --imgui-text-disabled: #919191;   /* 0.57 */
  --imgui-frame-bg: #0d0d0d;       /* 0.05 */
  --imgui-frame-shadow: rgba(0, 0, 0, 0.55);
  --imgui-border: rgba(82, 82, 82, 0.59);   /* 0.32 */
  --imgui-border-shadow: #000000;
  --imgui-separator: #3b3b3b;      /* 0.23 */
  --imgui-accent: #2979db;         /* 0.16, 0.47, 0.86 blue */
  --imgui-accent-active: rgba(41, 121, 219, 0.5);
  --imgui-header-bg: #1f1f1f;     /* 0.12 */
  font-family: Consolas, "JetBrains Mono", ui-monospace, monospace;
  font-size: 13px;
  flex-shrink: 0;
}

/* Window: exact 690×540 px as on screen */
.menu-window {
  width: 690px;
  min-width: 690px;
  height: 540px;
  min-height: 540px;
  flex-shrink: 0;
  background: var(--imgui-child-bg);
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--imgui-border-shadow);
  display: flex;
  flex-direction: column;
}

/* Header: header_height = GetFontSize() + ChildPadding.y*2 => 13 + 12 = 25px */
.menu-header {
  display: flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  background: var(--imgui-menubar-bg);
  background-image: linear-gradient(to bottom, transparent 0%, var(--imgui-frame-shadow) 100%);
  border-bottom: 1px solid var(--imgui-border);
  position: relative;
  flex-shrink: 0;
}

/* Single word ΛRCLYTE: Λ in accent, no gap (matches DrawLabelShadow "ΛRCLYTE") */
.menu-brand {
  display: inline;
  color: var(--imgui-text);
  font-weight: 600;
  letter-spacing: 0;
  margin-right: auto;
  white-space: nowrap;
}

.menu-brand-accent {
  color: var(--imgui-accent);
}

/* Tabs: SelectableFrame style — gradient (transparent top → accent bottom) + bottom bar (accent when active, separator when not) */
.menu-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding-left: 8px;
  border-left: 1px solid var(--imgui-border);
  min-height: 25px;
  align-items: stretch;
}

.menu-tab {
  font-family: inherit;
  font-size: 13px;
  padding: 0 8px;
  min-width: 82px;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--imgui-text-disabled);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease;
}

/* Gradient fill (transparent → accent at bottom) */
.menu-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--imgui-accent-active) 100%);
  opacity: 0;
  pointer-events: none;
}

.menu-tab.active::before {
  opacity: 1;
}

/* Bottom bar (1px, accent when selected) */
.menu-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--imgui-separator);
}

.menu-tab.active::after {
  background: var(--imgui-accent);
}

.menu-tab:hover {
  color: var(--imgui-text);
}

.menu-tab.active {
  color: var(--imgui-text);
}

/* Body: padding from WindowPadding + ChildPadding */
.menu-body {
  flex: 1;
  padding: 8px;
  background: var(--imgui-child-bg);
  overflow: auto;
  min-height: 0;
}

.menu-pane {
  display: none;
}

.menu-pane.active {
  display: block;
}

.menu-pane[hidden] {
  display: none !important;
}

.menu-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  height: 100%;
}

/* Child panels: header (menubar_bg + gradient) + border + content (child_bg) — matches ImAdd::BeginChild */
.menu-child {
  background: var(--imgui-child-bg);
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.menu-child.full {
  grid-column: 1 / -1;
}

/* Panel header: MenuBarBg + gradient (FontSize + CellPadding*2) */
.menu-child-title {
  min-height: 17px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  background: var(--imgui-menubar-bg);
  background-image: linear-gradient(to bottom, transparent 0%, var(--imgui-frame-shadow) 100%);
  color: var(--imgui-text);
  font-weight: 600;
  border-bottom: 1px solid var(--imgui-border);
  flex-shrink: 0;
}

/* Content area: ChildPadding 6px (ImGui style.ChildPadding) */
.menu-child > *:not(.menu-child-title) {
  padding-left: 6px;
  padding-right: 6px;
}

.menu-child > *:not(.menu-child-title):first-of-type {
  padding-top: 6px;
}

.menu-child > *:not(.menu-child-title):last-child {
  padding-bottom: 6px;
}

.menu-child > .imgui-row,
.menu-child > .imgui-slider-row {
  margin: 1px 0;
}

.menu-child > .imgui-btn {
  margin-top: 4px;
  align-self: flex-start;
}

/* SeparatorText: label in TextDisabled, then horizontal line */
.imgui-sep-text {
  color: var(--imgui-text-disabled);
  font-size: 13px;
  padding-bottom: 2px;
}

.imgui-sep-text::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--imgui-border);
  margin-top: 4px;
  margin-left: -6px;
  margin-right: -6px;
}

/* Rows: ItemSpacing 8,6; FramePadding 2 */
.imgui-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 17px;
  color: var(--imgui-text);
  font-size: 13px;
  cursor: default;
}

.imgui-row span:first-child {
  flex: 0 0 auto;
  min-width: 140px;
  color: var(--imgui-text);
}

.imgui-slider-row span:first-child {
  min-width: 180px;
}

.imgui-value {
  color: var(--imgui-text-disabled);
  font-size: 13px;
}

.imgui-slider-row > .imgui-value {
  flex: 0 0 28px;
  text-align: right;
}

.imgui-value-wrap {
  flex: 0 0 auto;
  min-width: 52px;
  text-align: right;
  font-size: 13px;
  color: var(--imgui-text-disabled);
}

/* Checkbox / Toggle: square, accent when checked */
.imgui-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  background: var(--imgui-frame-bg);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.imgui-checkbox:hover {
  background: #151515;
  border-color: var(--imgui-text-disabled);
}

.imgui-checkbox:active {
  background: #0a0a0a;
}

.imgui-checkbox:checked {
  background: var(--imgui-accent);
  border-color: var(--imgui-accent);
}

.imgui-checkbox:focus-visible {
  outline: 1px solid var(--imgui-accent);
  outline-offset: 1px;
}

/* Label containing checkbox: align and clickable */
.imgui-row label,
label.imgui-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* Slider: track (frame bg) + filled track (accent) + thumb */
.imgui-slider-wrap {
  flex: 1 1 0%;
  min-width: 80px;
  position: relative;
  height: 14px;
  display: block;
  cursor: pointer;
}

/* Background track (full width, behind fill) */
.imgui-slider-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 2px;
  height: 10px;
  background: var(--imgui-frame-bg);
  border: 1px solid var(--imgui-border);
  pointer-events: none;
  z-index: 0;
  box-sizing: border-box;
}

.imgui-slider {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  z-index: 2;
  cursor: pointer;
}

/* WebKit: make track full width so clicking works */
.imgui-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 10px;
  background: transparent;
  border: none;
}

.imgui-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: var(--imgui-accent);
  cursor: pointer;
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  margin-top: -1px;
}

/* Firefox */
.imgui-slider::-moz-range-track {
  width: 100%;
  height: 10px;
  background: transparent;
  border: none;
}

.imgui-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: var(--imgui-accent);
  cursor: pointer;
  border: 1px solid var(--imgui-border);
  border-radius: 0;
}

/* Filled track (accent from 0 to value) — JS sets width via style */
.imgui-slider-track {
  position: absolute;
  left: 0;
  top: 2px;
  height: 10px;
  width: var(--slider-pct, 0%);
  min-width: 0;
  background: var(--imgui-accent);
  border: 1px solid var(--imgui-border);
  border-right: none;
  pointer-events: none;
  box-sizing: border-box;
  z-index: 1;
  transition: width 0.08s ease;
}

.imgui-slider-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}

/* Color picker: strict square (16×16), native input overlaid for clicks */
.imgui-color-wrap {
  position: relative;
  display: inline-block;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  aspect-ratio: 1;
  cursor: pointer;
  box-sizing: border-box;
}

.imgui-color {
  display: block;
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  aspect-ratio: 1;
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  box-sizing: border-box;
}

.imgui-color-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  font-size: 0;
}

/* Old separator label (Misc, Appearance) — keep for compatibility */
.imgui-sep {
  color: var(--imgui-text-disabled);
  font-size: 14px;
  margin: 8px 0 4px;
}

/* Button: FrameBg, accent when hovered */
.imgui-btn {
  font-family: inherit;
  font-size: 13px;
  padding: 2px 10px;
  background: var(--imgui-frame-bg);
  color: var(--imgui-text);
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.imgui-btn:hover {
  background: var(--imgui-accent);
  border-color: var(--imgui-accent);
  color: #fff;
}

.imgui-muted {
  color: var(--imgui-text-disabled);
  font-size: 13px;
}

.imgui-muted.small {
  font-size: 12px;
}

/* Footer: Build: __DATE__ with accent on date */
.menu-footer {
  min-height: 21px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  background: var(--imgui-child-bg);
  border-top: 1px solid var(--imgui-border);
  color: var(--imgui-text);
  font-size: 13px;
  flex-shrink: 0;
}

/* Conditional blocks: shown when associated checkbox is checked */
.menu-child .imgui-toggle-block {
  padding-left: 6px;
  padding-right: 6px;
  padding-top: 0;
  padding-bottom: 2px;
}

.imgui-toggle-block[hidden] {
  display: none !important;
}

/* Row with checkbox + keybind: keybind right-aligned */
.imgui-row-kb {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 17px;
  color: var(--imgui-text);
  font-size: 13px;
}

.imgui-row-kb label {
  flex: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.imgui-keybind {
  flex: 0 0 auto;
  color: var(--imgui-text-disabled);
  font-size: 12px;
  padding: 1px 6px;
  border: 1px solid var(--imgui-border);
  background: var(--imgui-frame-bg);
  cursor: default;
}

.imgui-kb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 17px;
  color: var(--imgui-text);
  font-size: 13px;
}

.imgui-kb-row span:first-child {
  flex: 0 0 auto;
  min-width: 80px;
}

.imgui-kb-row .imgui-keybind {
  margin-left: 0;
}

.imgui-combo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 17px;
  color: var(--imgui-text);
  font-size: 13px;
}

.imgui-combo-row span {
  flex: 0 0 auto;
  min-width: 100px;
}

.imgui-combo {
  font-family: inherit;
  font-size: 13px;
  padding: 2px 6px;
  background: var(--imgui-frame-bg);
  color: var(--imgui-text);
  border: 1px solid var(--imgui-border);
  border-radius: 0;
  cursor: pointer;
  min-width: 100px;
}

.menu-footer-date {
  color: var(--imgui-accent-active);
  margin-left: 4px;
}

@media (max-width: 720px) {
  .menu-header {
    flex-wrap: wrap;
    min-height: auto;
    padding: 6px 8px;
  }

  .menu-header::before {
    display: none;
  }

  .menu-tabs {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid var(--imgui-border);
  }

  .menu-tab {
    min-width: 0;
    flex: 1;
    font-size: 12px;
    padding: 4px 6px;
  }

  .menu-cols {
    grid-template-columns: 1fr;
  }
}
