/* =========================================================
   FONT SAMPLER PREVIEW — CLEAN & LIGHT VERSION (COMPACT FINAL)
========================================================= */

/* --- Vars --- */
:root {
  --control-height: 36px;
  --select-padding-x: 10px;
  --select-arrow-right: 10px;
  --slider-width: 120px;
  --track-height: 2px;
  --thumb-size: 12px;
  --gap-row: 3.5px;
}

/* Container */
.fsp-container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  background: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
}

/* Info text */
.fsp-info {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 22px;
}

/* ============================================
   MASTER CONTROLS WRAPPER
============================================ */
.fsp-controls.unified-controls,
.fsp-axes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: flex-start;
}

/* ============================================
   CONTROL ROW — COMPACT + ANTI PECAH BARIS
============================================ */
.fsp-controls .control-row,
.fsp-axes .control-row {
  display: flex;
  flex-direction: column; /* label + input vertically stacked */
  align-items: flex-start;
  min-width: 120px;
  flex: 0 0 auto;
  gap: var(--gap-row);
}

/* ============================================
   CONTROL — label di atas slider
============================================ */
.fsp-controls .control,
.fsp-axes .control {
  display: flex;
  flex-direction: column; /* LABEL DI ATAS */
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 120px;
  gap: 4px;
}

/* Label */
.fsp-controls label,
.fsp-axes label {
  font-size: 12px;
  font-weight: 500;
  color: #111 !important;
  padding: 0 !important;
}


/* ============================================
   SELECT — compact
============================================ */
.fsp-controls select,
.fsp-controls select.fsp-style-select,
.fsp-controls select.fsp-case-select {
  height: var(--control-height);
  line-height: var(--control-height);
  width: 100%;
  max-width: 420px;
  padding: 0 var(--select-padding-x);
  padding-right: calc(var(--select-arrow-right) + 14px);
  font-size: 13px;
  border: none;
  border-bottom: 2px solid #111;
  background:
    #fff
    url("data:image/svg+xml,%3Csvg fill='%23111' height='10' viewBox='0 0 10 10' width='10' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolygon points='0,0 10,0 5,5'/%3E%3C/svg%3E")
    no-repeat right var(--select-arrow-right) center;
  background-size: 10px;
  appearance: none;
  cursor: pointer;
  color: #111;
  box-sizing: border-box;
}

.fsp-controls select:focus {
  outline: none;
  border-bottom-color: #000;
}

.fsp-controls select.fsp-case-select {
  max-width: 160px;
}

/* ============================================
   RANGE SLIDER — compact
============================================ */
.fsp-controls input[type="range"],
.fsp-axes input[type="range"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  width: var(--slider-width);
  max-width: 100%;
  height: var(--track-height) !important;
  background: transparent !important;
  outline: none !important;
  border: none !important;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
  box-sizing: content-box;
}

/* Track (Webkit) */
.fsp-controls input[type="range"]::-webkit-slider-runnable-track,
.fsp-axes input[type="range"]::-webkit-slider-runnable-track {
  background: #111 !important;
  height: var(--track-height) !important;
}

/* Track (Firefox) */
.fsp-controls input[type="range"]::-moz-range-track,
.fsp-axes input[type="range"]::-moz-range-track {
  background: #111 !important;
  height: var(--track-height) !important;
}

/* Thumb (Webkit) */
.fsp-controls input[type="range"]::-webkit-slider-thumb,
.fsp-axes input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: var(--thumb-size) !important;
  height: var(--thumb-size) !important;
  background: #fff !important;
  border: 1px solid #111 !important;
  border-radius: 10% !important;
  box-shadow: 0 0 0 1px #111 !important;
  margin-top: calc((var(--track-height) - var(--thumb-size)) / 2);
}

/* Thumb (Firefox) */
.fsp-controls input[type="range"]::-moz-range-thumb,
.fsp-axes input[type="range"]::-moz-range-thumb {
  width: var(--thumb-size) !important;
  height: var(--thumb-size) !important;
  background: #fff !important;
  border: 1px solid #111 !important;
  border-radius: 10% !important;
  box-shadow: 0 0 0 1px #111 !important;
}

/* Focus */
.fsp-controls input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(0,0,0,.06), 0 0 0 1px #111;
}

/* ============================================
   PREVIEW TEXT
============================================ */
.fsp-preview {
  width: 100%;
  min-height: 140px;
  margin-top: 20px;
  font-size: 48px;
  line-height: 1.4;
  background: #fff;
  color: #111;
  border: 0;
  outline: none !important;
  box-shadow: none !important;
  transition: background .2s, color .2s, font-family .25s ease;
}

.fsp-preview.fsp-loading {
  opacity: .4;
  pointer-events: none;
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 720px) {
  :root {
    --slider-width: 100%;
  }

  .fsp-controls.unified-controls,
  .fsp-axes,
  .fsp-controls .control-row,
  .fsp-axes .control-row {
    width: 100% !important;
    min-width: 100% !important;
  }

  .fsp-controls select,
  .fsp-controls input[type="range"],
  .fsp-axes input[type="range"] {
    width: 100% !important;
    max-width: 100% !important;
  }
}


/* Color control occupies the unused right side of the existing control bar. */
.fsp-controls .fsp-color-float {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
  align-self: flex-start;
  z-index: 100;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.fsp-color-toggle {
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  padding: 10px 17px;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0,0,0,.12);
}
.fsp-color-toggle:hover,
.fsp-color-toggle:focus-visible { background: #333; color: #fff; }
.fsp-color-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 190px;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
  color: #111;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  display: grid;
  gap: 12px;
  z-index: 101;
}
.fsp-color-panel[hidden] { display: none !important; }
.fsp-color-panel label { display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:12px; }
.fsp-color-panel input[type="color"] { width:38px; height:30px; padding:2px; border:1px solid #ddd; background:#fff; cursor:pointer; }
.fsp-color-presets { display:flex; gap:6px; }
.fsp-color-presets button { flex:1; padding:7px 4px; border:1px solid #ccc; background:#fff; color:#111; border-radius:5px; cursor:pointer; font-size:11px; }
@media (max-width:720px) {
  .fsp-controls .fsp-color-float { margin-left: 0; }
  .fsp-color-panel { right: 0; max-width: calc(100vw - 40px); }
}


/* v6.1.2: restore the Tracking control without changing the sampler layout. */
.fsp-container .fsp-tracking-control { min-width: 130px; }
.fsp-container .fsp-tracking-control input[type="range"] { width: 100%; }
