@import "../shared/omusiclab-theme.css";

body.tuner-view-simple .advanced-only {
  display: none !important;
}

body.tuner-view-advanced .simple-only {
  display: none !important;
}

#body-container {
  max-width: 24rem;
}

.view-mode-fieldset {
  border: 1px solid var(--oml-border);
  border-radius: 0.5em;
  padding: 0.65rem 0.85rem 0.75rem;
  margin: 0.75rem 0 0.5rem;
  background: var(--oml-panel);
}

.view-mode-legend {
  font-size: 0.75em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--oml-muted);
  padding: 0 0.35rem;
}

.view-mode-toggle {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.view-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  color: var(--oml-text);
}

.view-mode-option input {
  width: auto;
  accent-color: var(--oml-accent-text);
}

.tuner-panel {
  background-color: var(--oml-panel);
  border: solid thin var(--oml-edge);
  border-radius: 0.2em;
  padding: 1.25rem 1rem 1rem;
  margin: 1rem 0;
}

.freq-readout {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  min-height: 2.75rem;
}

.freq-readout .unit {
  font-size: 0.45em;
  font-weight: 600;
  color: var(--oml-muted);
  margin-left: 0.2em;
}

.note-readout {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0.5rem 0 0.35rem;
  min-height: 2.25rem;
}

.tuning-plain {
  font-size: 1rem;
  font-weight: 500;
  color: var(--oml-muted);
  margin: 0.35rem 0 0.5rem;
  min-height: 1.5rem;
  line-height: 1.35;
}

.tuning-plain.in-tune {
  color: var(--oml-accent-text);
}

.cents-line {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--oml-muted);
  min-height: 1.35rem;
}

.cents-line.in-tune {
  color: var(--oml-accent-text);
}

.meter-wrap {
  margin: 1.1rem 0 0.25rem;
  padding: 0 0.25rem;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--oml-muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.meter-track {
  position: relative;
  height: 0.65rem;
  background: linear-gradient(
    90deg,
    rgba(51, 51, 51, 0.08) 0%,
    rgba(16, 99, 71, 0.2) 48%,
    rgba(16, 99, 71, 0.28) 50%,
    rgba(16, 99, 71, 0.2) 52%,
    rgba(51, 51, 51, 0.08) 100%
  );
  border-radius: 999px;
  border: 1px solid var(--oml-border);
}

.meter-needle {
  position: absolute;
  top: -0.2rem;
  width: 3px;
  margin-left: -1.5px;
  height: calc(100% + 0.4rem);
  background: var(--oml-text);
  border-radius: 1px;
  left: 50%;
  transform: translateX(-50%);
  transition: left 0.06s ease-out;
  pointer-events: none;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin: 0.75rem 0;
}

.controls-row .dropdown {
  flex: 1;
  min-width: 10rem;
}

.controls-row .dropdown label {
  line-height: 2.25em;
}

select#instrument-select {
  width: 100%;
  max-width: 14rem;
}

.string-fieldset {
  border: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.string-fieldset legend {
  font-size: 0.85em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--oml-text);
  margin-bottom: 0.5rem;
  padding: 0;
}

.string-grid {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.string-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.string-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.string-option label {
  display: block;
  width: 100%;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--oml-border);
  border-radius: 0.5em;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
}

.string-option input:focus-visible + label {
  outline: 2px solid var(--oml-accent-text);
  outline-offset: 2px;
}

.string-option input:checked + label {
  border-color: rgba(16, 99, 71, 0.45);
  background: rgba(16, 99, 71, 0.06);
}

.string-option label:hover {
  background: var(--oml-panel);
}

.target-hint {
  font-size: 0.8em;
  color: var(--oml-muted);
  margin-top: 0.75rem;
  line-height: 1.4;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

button.primary,
button.ghost {
  font-family: "Poppins", sans-serif;
  font-size: 0.85em;
  font-weight: 600;
  padding: 0.55em 1.25em;
  border-radius: 0.5em;
  cursor: pointer;
  border: 1px solid var(--oml-border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

button.primary {
  background: var(--oml-accent-text);
  color: #fff;
  border-color: var(--oml-accent-text);
}

button.primary:hover {
  filter: brightness(1.06);
}

button.ghost {
  background: #fff;
  color: var(--oml-text);
}

button.ghost:hover {
  background: var(--oml-panel);
}

button:focus-visible {
  outline: 2px solid var(--oml-accent-text);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.hint {
  font-size: 0.75em;
  color: var(--oml-muted);
  margin-top: 1rem;
  line-height: 1.45;
}

.status-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--oml-muted);
  margin-right: 0.35rem;
  vertical-align: middle;
}

.status-dot.live {
  background: #c43;
  box-shadow: 0 0 0 2px rgba(196, 51, 51, 0.25);
}
