/* ═══════════════════════════════════════════════════════════
   COMPONENTS.CSS — Buttons, chips, inputs, toggles, pills
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════
   BUTTONS & CHIPS (shared base)
   ═══════════════════════════════════════ */
body.theme-hud .btn,
body.theme-hud .chip,
body.theme-hud .mode-btn {
  height: var(--btn-h);
  padding: 0 var(--btn-pad-x);
  border-radius: var(--r-pill);
  border: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface) 78%, transparent);
  color: var(--ui-text-2);

  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: .10em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  outline: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  transition:
    transform var(--dur-fast) ease,
    box-shadow var(--dur-normal) ease,
    background var(--dur-normal) ease,
    border-color var(--dur-normal) ease,
    color var(--dur-normal) ease;
}

body.theme-hud .chip {
  height: var(--chip-h);
}

/* ── Hover ── */
body.theme-hud .btn:hover,
body.theme-hud .chip:hover,
body.theme-hud .mode-btn:hover {
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-accent) 8%, var(--ui-surface));
  border-color: var(--ui-border-strong);
  box-shadow: var(--ui-shadow-soft);
  transform: translateY(-1px);
}

/* ── Active ── */
body.theme-hud .btn:active,
body.theme-hud .chip:active,
body.theme-hud .mode-btn:active {
  transform: translateY(0) scale(0.98);
}

/* ── Focus ── */
body.theme-hud .btn:focus-visible,
body.theme-hud .chip:focus-visible,
body.theme-hud .mode-btn:focus-visible {
  box-shadow: var(--ui-focus);
  border-color: var(--ui-border-strong);
}

/* ── Active state (selected chip/mode) ── */
body.theme-hud .chip--active,
body.theme-hud .mode-btn--active {
  background: linear-gradient(90deg, var(--ui-accent), var(--ui-accent-2));
  border-color: color-mix(in srgb, var(--ui-accent) 55%, transparent);
  color: rgba(0, 0, 0, .92);
  box-shadow: var(--ui-glow);
}

/* ── Primary ── */
body.theme-hud .btn-primary {
  background: linear-gradient(90deg, var(--ui-accent), var(--ui-accent-2));
  border-color: color-mix(in srgb, var(--ui-accent) 55%, transparent);
  color: rgba(0, 0, 0, .92);
  box-shadow: var(--ui-glow);
}

body.theme-hud .btn-primary:hover {
  box-shadow: var(--ui-glow-strong);
}

/* ── Neon (add point) ── */
body.theme-hud .neon-btn {
  border-color: color-mix(in srgb, var(--c-green) 40%, var(--ui-border));
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--c-green) 22%, transparent),
    color-mix(in srgb, var(--ui-accent) 8%, transparent)
  );
}

body.theme-hud .neon-btn:hover {
  border-color: color-mix(in srgb, var(--c-green) 58%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c-green) 18%, transparent),
              0 0 34px color-mix(in srgb, var(--c-green) 14%, transparent);
}

/* ── Button icon ── */
.btn-icon {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  opacity: .85;
}

/* ═══════════════════════════════════════
   INPUTS & SELECTS
   ═══════════════════════════════════════ */
body.theme-hud .input,
body.theme-hud .select {
  height: var(--btn-h);
  padding: 0 12px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--ui-surface) 85%, transparent);
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
  transition: border-color var(--dur-normal) ease, box-shadow var(--dur-normal) ease;
}

body.theme-hud .input:focus,
body.theme-hud .select:focus {
  border-color: var(--ui-border-strong);
  box-shadow: var(--ui-focus);
}

/* ── Datetime icon fix (dark theme) ── */
body.theme-hud .sidebar--left input[type="datetime-local"] {
  color-scheme: light;
}

body.theme-hud .sidebar--left input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.15);
  opacity: 1;
}

body.theme-hud[data-ui-theme="light"] .sidebar--left input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: none;
}

/* ═══════════════════════════════════════
   TOGGLES
   ═══════════════════════════════════════ */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.toggle__track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  position: relative;
  flex-shrink: 0;
  transition: background var(--dur-normal) ease;
}

.toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ui-text-dim);
  transition: all var(--dur-normal) var(--ease-spring);
}

.toggle input:checked + .toggle__track {
  background: var(--ui-accent);
}

.toggle input:checked + .toggle__track::after {
  left: 21px;
  background: var(--c-bg-deep);
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__label {
  font-size: 13px;
  color: var(--ui-text-2);
}

/* ═══════════════════════════════════════
   HUD PILLS
   ═══════════════════════════════════════ */
body.theme-hud .hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-surface) 80%, transparent);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--ui-text-2);
  white-space: nowrap;
}

body.theme-hud .hud-pill--ok {
  border-color: color-mix(in srgb, var(--c-green) 35%, var(--ui-border));
  background: color-mix(in srgb, var(--c-green) 10%, var(--ui-surface));
  color: color-mix(in srgb, var(--c-green) 55%, var(--ui-text));
}

/* ═══════════════════════════════════════
   SOUND TOGGLE
   ═══════════════════════════════════════ */
#sound-toggle-btn[aria-pressed="false"] {
  opacity: .55;
  filter: grayscale(0.2);
}

/* ═══════════════════════════════════════
   UI THEME BUTTON
   ═══════════════════════════════════════ */
#ui-theme-btn[aria-pressed="true"] {
  box-shadow: var(--ui-glow);
}

#ui-theme-btn[data-ui-theme="light"] { border-color: rgba(0, 150, 190, .35); }
#ui-theme-btn[data-ui-theme="dark"]  { border-color: rgba(0, 242, 255, .28); }
#ui-theme-btn[data-ui-theme="auto"]  { opacity: .92; }