/* Seat Height Figure Simulator v1.0.0 — styles */

/* Main wrapper: two-column layout */
.shf {
  max-width: 1200px;
  margin: 1rem auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

/* Controls (left column) */
.shf .controls {
  grid-column: 1;
  display: grid;
  gap: .55rem;
  margin: 0;
  position: sticky;
  top: 10px;
}
.shf .controls .row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.shf .controls .row.vertical {
  display: grid;
  grid-template-columns: 1fr;
  gap: .6rem;
}

.shf label {
  font-weight: 600;
  font-size: 14px;
}
.shf input,
.shf select {
  width: 100%;
  padding: .45rem .55rem;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.shf input[type="checkbox"],
.shf input[type="radio"]{
  width: auto;
  padding: 0;
}

/* Preview + bike image (right column) — sticky on desktop so it stays visible while scrolling tall control panel */
.shf .canvasWrap {
  grid-column: 2;
  position: sticky;
  top: 10px;
  align-self: start;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  margin-top: 0;
  max-width: 500px;
  width: 100%;
  justify-self: start;
}
.shf .bikeWrap {
  position: relative;
  width: 100%;
  max-width: 500px;
}
#bikeImg {
  display: block;
  width: 100%;
  height: auto;
}
#riderSVG {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Foot toggle */
#footModeWrap {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: .25rem 0;
  flex-wrap: wrap;
}
#footModeWrap .legend {
  font-weight: 600;
  font-size: 14px;
  margin-right: 4px;
}
#footModeWrap label.opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  line-height: 1;
}
#footModeWrap input[type="radio"]{
  margin: 0;
}

/* Foot position: one option per line (robust on phones) */
#shf #footModeWrap { display: block; }
#shf #footModeWrap .opt {
  display: block !important;
  margin: 0 0 .35rem 0;
}
#shf #footModeWrap label.opt{
  display: flex !important;
  align-items: center;
  gap: 10px;
  white-space: normal !important;
}
#shf #footModeWrap input[type="radio"]{
  position: static !important;
  margin: 0;
  inline-size: 1.1em; block-size: 1.1em;
}

/* Passenger toggle group */
#paxWrap {
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px 10px;
  margin: .35rem 0 0;
}
#paxWrap[hidden]{ display: none; }
#paxWrap .legend {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
#paxWrap .opt {
  display: block;
  margin: 0 0 .25rem 0;
}
#paxWrap label.opt{
  display: flex !important;
  align-items: center;
  gap: 10px;
  white-space: normal !important;
}
#paxWrap input[type="checkbox"]{
  inline-size: 1.1em; block-size: 1.1em;
  margin: 0;
}
#paxOffsetRow[hidden],
#paxBodyRow[hidden]{ display: none !important; }

/* Full-page password gate overlay (Goutchen purple theme) */
.shfGateOverlay {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 20, 60, 0.55);
  -webkit-backdrop-filter: blur(8px) saturate(0.9);
  backdrop-filter: blur(8px) saturate(0.9);
  padding: 16px;
  overflow-y: auto;
}
html.shf-gate-locked,
body.shf-gate-locked {
  overflow: hidden !important;
  height: 100% !important;
}

/* The gate card */
.shfGate {
  max-width: 480px;
  width: 100%;
  margin: 0;
  padding: 28px 24px;
  border: 1px solid #d8c4f0;
  background: #faf5ff;
  border-radius: 14px;
  text-align: center;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  box-shadow: 0 18px 60px rgba(60, 30, 100, 0.35);
}
.shfGate.ar {
  font-family: "Cairo","Noto Naskh Arabic","Noto Sans Arabic",Tahoma,Arial,sans-serif;
}
.shfGate__icon {
  font-size: 38px;
  line-height: 1;
  margin-bottom: 10px;
  color: #6b3fa0;
}
.shfGate__title {
  margin: 0 0 8px;
  font-size: 22px;
  color: #4a148c;
}
.shfGate__message {
  margin: 0 0 6px;
  font-size: 16px;
  color: #3a2a4a;
  line-height: 1.5;
}
.shfGate__help {
  margin: 0 0 18px;
  font-size: 14px;
  color: #6b5a7e;
}
.shfGate__help a {
  color: #6b3fa0;
  font-weight: 700;
  text-decoration: none;
}
.shfGate__help a:hover { text-decoration: underline; }
.shfGate__form {
  margin-top: 12px;
  text-align: start;
}
.shfGate__inputLabel {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
  color: #4a148c;
}
.shfGate__row {
  display: flex;
  gap: 8px;
}
.shfGate__row input[type="text"],
.shfGate__row input[type="password"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: .55rem .7rem;
  border: 1px solid #c8a8e0;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: #2a1a3a;
}
.shfGate__row input[type="text"]:focus,
.shfGate__row input[type="password"]:focus {
  outline: none;
  border-color: #6b3fa0;
  box-shadow: 0 0 0 3px rgba(107, 63, 160, 0.18);
}
.shfGate__row button {
  flex: 0 0 auto;
  padding: .55rem 1.1rem;
  background: #6b3fa0;
  color: #fff;
  border: 1px solid #5b2f90;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
  transition: background-color .15s ease;
}
.shfGate__row button:hover { background: #5b2f90; }
.shfGate__row button:active { background: #4a2480; }
.shfGate__error {
  margin-top: 8px;
  color: #b30000;
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 600px) {
  .shfGateOverlay { padding: 12px; }
  .shfGate { padding: 22px 16px; }
  .shfGate__title { font-size: 19px; }
  .shfGate__message { font-size: 15px; }
}

/* Sliders */
#shf .shf-range{
  width: 100%;
  margin-top: 4px;
}
@media (max-width: 900px){
  #shf input[type="number"][readonly]{
    opacity: .9;
  }
}

/* Stats */
.shf .stats {
  grid-column: 2;
  margin-top: .6rem;
  color: #333;
  max-width: 500px;
}

/* Mobile: bike image sticky at top, controls scroll under it */
@media (max-width: 900px) {
  .shf {
    grid-template-columns: 1fr;
    grid-template-areas:
      "canvas"
      "controls"
      "stats";
  }
  .shf .canvasWrap {
    grid-area: canvas;
    grid-column: 1;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: min(360px, 92vw);
    margin: 0 auto .5rem;
    justify-self: center;
  }
  .shf .bikeWrap {
    max-width: 100%;
  }
  .shf .controls {
    grid-area: controls;
    grid-column: 1;
    position: static;
    max-width: 100%;
    justify-self: stretch;
    margin-top: .25rem;
  }
  .shf .stats {
    grid-area: stats;
    grid-column: 1;
    max-width: 100%;
    justify-self: stretch;
  }
}

/* Rider stroke tweak */
@media (min-width: 860px) {
  #riderSVG g {
    stroke-width: 16;
  }
}

/* --- Dangerousness styles --- */
.shf .stats .dangerRow { margin-top: .35rem; }
.dangerBadge {
  display: inline-block;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  color: #1b1b1b;
}
.dangerScale {
  position: relative;
  height: 12px;
  border-radius: 8px;
  margin-top: 6px;
  border: 1px solid #e0e0e0;
  background: linear-gradient(90deg,#1db954 0%,#c7e600 20%,#ffd400 50%,#ff9a00 70%,#ff3b30 100%);
  max-width: 480px;
}
.dangerMarker {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 20px;
  background: #111;
  left: 0%;
  transform: translateX(-1px);
  border-radius: 2px;
}
.dangerTicks {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  max-width: 480px;
}

/* RTL tweaks */
.shf.ar label { text-align: right; }
.shf.ar .controls .row.two label { text-align: right; }
.shf.ar .dangerTicks { direction: ltr; }

/* Arabic font */
.shf.ar,
.shf.ar *{
  font-family: "Cairo","Noto Naskh Arabic","Noto Sans Arabic",Tahoma,Arial,sans-serif;
}
.shf.ar { font-size: 16px; line-height: 1.6; }
