/**
 * ================================================================
 *  RoxyPiano v2.0 — Komponen UI Reusable
 *  © 2026 Roxy Emanuel. All Rights Reserved.
 * ================================================================
 *  Buttons, toggle switches, range sliders, speed buttons,
 *  hand selector, dan elemen kbd.
 * ================================================================
 */

/* ── Tombol (Button System) ────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 0 16px var(--accent-glow), 0 0 16px var(--accent-2-glow); filter: brightness(1.1); }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }
.btn-sm { padding: 4px 8px; font-size: .7rem; }

/* ── Range Slider ──────────────────────────────────────────────── */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--surface-2);
  border-radius: 2px; outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  box-shadow: 0 0 5px var(--accent-glow);
}

/* ── Toggle Switch ─────────────────────────────────────────────── */
.toggle-switch { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.toggle-switch input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer;
  transition: var(--transition);
}
.toggle-slider::after {
  content: ''; position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-muted);
  top: 2px; left: 2px;
  transition: var(--transition);
}
.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::after { background: #fff; transform: translateX(18px); }

/* ── Speed Buttons ─────────────────────────────────────────────── */
.speed-btns { display: flex; gap: 2px; }
.speed-btn {
  padding: 3px 7px; font-size: .66rem;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
  font-family: var(--font-body); font-weight: 500;
}
.speed-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }

/* ── Hand Selector ─────────────────────────────────────────────── */
.hand-selector { display: flex; gap: 2px; }
.hand-btn {
  padding: 3px 8px; font-size: .68rem;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--surface-2); color: var(--text-muted);
  cursor: pointer; transition: var(--transition);
  font-family: var(--font-body);
}
.hand-btn.active {
  background: linear-gradient(135deg, rgba(0,212,255,.2), rgba(124,58,237,.2));
  color: var(--accent); border-color: var(--accent); font-weight: 600;
}

/* ── Keyboard Shortcut Badge ───────────────────────────────────── */
kbd {
  display: inline-block; padding: 1px 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 3px; font-family: var(--font-body);
  font-size: .64rem; margin: 0 1px;
}
.shortcuts { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }

/* ── Input file tersembunyi ────────────────────────────────────── */
#midiFileInput { display: none; }
