/* ── Settings bottom-sheet ─────────────────────────────────────────────
   Matches Figma node 66:4717 ("Instellingen"): two rounded white cards
   (timer / colour / theme + tutorial / articles links) and a full-width
   dark-teal "Verder spelen" CTA. Cards are theme-aware. */

.modal--settings .modal-sheet__panel {
  padding: 24px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  gap: 12px;
  min-height: 85vh;
}

.settings-card {
  background: var(--theme-card-bg, #ffffff);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-card + .settings-card {
  margin-top: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 8px 16px;
}

.settings-row__icon {
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-text, #004046);
}

.settings-row__icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.settings-row__label {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  font-family: "SF Pro Text", "Funnel Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--theme-text, #004046);
  min-width: 0;
}

.settings-row__sub {
  font-size: 12px;
  color: var(--theme-text-muted, #737373);
  font-weight: var(--font-weight-regular);
  margin-top: 2px;
}

.settings-row__control {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
}

.settings-divider {
  height: 1px;
  border: 0;
  margin: 0 16px;
  background: var(--theme-card-divider, #d1d1d1);
}

/* ── iOS-style toggle switch ─────────────────────────────────────────── */

.toggle-switch {
  width: 51px;
  height: 31px;
  border-radius: 15.5px;
  background: var(--theme-toggle-off, #d1d1d6);
  border: 0;
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
  touch-action: manipulation;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle-switch.is-on {
  background: var(--theme-toggle-on, #34c759);
}

.toggle-switch.is-on::after {
  transform: translateX(20px);
}

/* ── Segmented control (theme + colour pickers) ──────────────────────── */

.segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--theme-segmented-track, #f5f1ed);
  border-radius: 7.5px;
  padding: 2px;
  gap: 0;
  height: 34px;
}

.segmented-control__btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-text, #004046);
  font-family: "SF Pro Text", "Funnel Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  touch-action: manipulation;
  position: relative;
  transition: background-color 0.15s ease;
}

.segmented-control__btn.is-selected {
  background: var(--theme-segmented-active-bg, #ffffff);
  box-shadow: var(--theme-segmented-active-shadow, 0 1px 2px rgba(0, 0, 0, 0.15));
}

.segmented-control__btn svg {
  width: 16px;
  height: 16px;
  display: block;
  color: currentColor;
}

.segmented-control__separator {
  width: 1px;
  height: 12px;
  background: var(--theme-segmented-separator, #bcbcbd);
  flex-shrink: 0;
}

/* Colour picker (Kies je kleur): two triangle swatches */

.color-picker {
  width: 92px;
}

.color-picker__btn {
  width: 43px;
  height: 30px;
}

.color-picker__btn svg {
  width: 18px;
  height: 18px;
}

/* The teal triangle SVG is hard-coded dark teal and disappears against the
   dark-mode segmented track / selected background. Brighten it to match the
   treatment applied to teal board pieces in dark mode. */
[data-theme="dark"] .color-picker__btn[data-color="teal"] svg {
  filter: brightness(3.2) saturate(0.7);
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .color-picker__btn[data-color="teal"] svg {
    filter: brightness(3.2) saturate(0.7);
  }
}

/* Theme segment (Thema): 🌙 | A | ☀ */

.theme-segment {
  width: 134px;
}

.theme-segment__btn {
  flex: 1 1 0;
}

/* ── Green pill action buttons (Uitleg / Lezen) ──────────────────────── */

.pill-button {
  background: var(--theme-pill-success-bg, #34c759);
  color: var(--theme-pill-success-fg, #ffffff);
  border: 0;
  border-radius: 7.5px;
  height: 34px;
  padding: 0 16px;
  min-width: 88px;
  font-family: "SF Pro Text", "Funnel Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  touch-action: manipulation;
}

.pill-button:active:not(:disabled) {
  filter: brightness(0.92);
}

/* ── Articles placeholder modal ─────────────────────────────────────── */

.modal--articles {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.modal--articles .modal-card {
  background: var(--theme-card-bg, #ffffff);
  color: var(--theme-text, #004046);
  border-radius: 12px;
  padding: 24px;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.modal--articles .modal-card__title {
  margin: 0;
  font-family: "Funnel Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  color: var(--theme-text, #004046);
}

.modal--articles .modal-card__body {
  margin: 0;
  font-size: 14px;
  color: var(--theme-text-muted, #737373);
  line-height: 1.45;
}

.modal--articles .modal-card__close {
  align-self: stretch;
  margin-top: 4px;
  background: var(--theme-cta-bg, #004046);
  color: var(--theme-cta-fg, #f5f1ed);
  border: 0;
  border-radius: 24px;
  height: 40px;
  font-family: "Funnel Display", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  touch-action: manipulation;
}
