/* ============================================================
   Format Converter — controls.css
   Step 2: "Convert to" format dropdown + quality segmented control
   ============================================================ */


/* ══════════════════════════════════════════
   1. CONTROLS WRAPPER
   ══════════════════════════════════════════ */
.fc-format-convert-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 22px 0 4px;
}

.fc-format-convert-controls__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-format-convert-controls__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fc-ink);
}

.fc-format-convert-controls__hint {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--fc-ink-soft);
  line-height: 1.5;
}


/* ══════════════════════════════════════════
   2. FORMAT PICKER ("Convert to")
   A fully custom dropdown, not a native <select>. Native
   selects can only be styled up to their closed state — the
   opened options list is rendered by the OS/browser itself and
   cannot be given rounded corners, custom colors, hover states,
   or a checkmark for the current choice. Building this as plain
   button + list markup means BOTH the closed and open states
   look like the rest of the app, consistently across every
   platform.
   ══════════════════════════════════════════ */
.fc-format-convert-formatpicker {
  position: relative;
}

.fc-format-convert-formatpicker__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--fc-line);
  background: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--fc-ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fc-format-convert-formatpicker__trigger:hover {
  border-color: var(--fc-line-strong);
}

.fc-format-convert-formatpicker__trigger:focus-visible {
  outline: none;
  border-color: var(--fc-brand);
  box-shadow: 0 0 0 4px var(--fc-brand-soft);
}

.fc-format-convert-formatpicker__chevron {
  width: 20px;
  height: 20px;
  color: var(--fc-ink-soft);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.fc-format-convert-formatpicker__trigger[aria-expanded="true"] .fc-format-convert-formatpicker__chevron {
  transform: rotate(180deg);
}

/* ── The floating menu — fully our own markup, fully our own styling ── */
.fc-format-convert-formatpicker__menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 40;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--fc-line);
  box-shadow: 0 16px 40px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
  max-height: 280px;
  overflow-y: auto;
  animation: fcMenuIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fc-format-convert-formatpicker__menu[hidden] {
  display: none;
}

/* Flipped variant: used when there isn't enough room below the trigger
   (common on short mobile viewports) — JS adds this class and sets an
   explicit max-height so the menu always stays fully on-screen instead
   of running off the bottom edge. */
.fc-format-convert-formatpicker__menu--up {
  top: auto;
  bottom: calc(100% + 8px);
}

@keyframes fcMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fc-format-convert-formatpicker__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fc-ink);
  cursor: pointer;
}

.fc-format-convert-formatpicker__option:hover,
.fc-format-convert-formatpicker__option.is-active {
  background: var(--fc-bg);
}

.fc-format-convert-formatpicker__option.is-selected {
  color: var(--fc-brand-dark);
  font-weight: 700;
  background: var(--fc-brand-soft);
}

.fc-format-convert-formatpicker__option svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--fc-brand);
  visibility: hidden;
}

.fc-format-convert-formatpicker__option.is-selected svg {
  visibility: visible;
}


/* ══════════════════════════════════════════
   3. QUALITY — segmented control (4 options)
   ══════════════════════════════════════════ */
.fc-format-convert-quality {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.fc-format-convert-quality__btn {
  height: 40px;
  padding: 0 4px;
  border-radius: 9999px;
  border: 1.5px solid var(--fc-line);
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--fc-ink-soft);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.fc-format-convert-quality__btn.is-active {
  border-color: var(--fc-brand);
  color: var(--fc-brand);
  background: var(--fc-brand-soft);
}

/* GIF output ignores quality entirely (palette-based format) —
   dim + lock the row instead of hiding it, so the reason is visible */
.fc-format-convert-quality.is-disabled .fc-format-convert-quality__btn {
  opacity: 0.45;
  pointer-events: none;
}


/* ══════════════════════════════════════════
   4. DESKTOP ENHANCEMENTS (≥768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .fc-format-convert-quality__btn {
    font-size: 13px;
  }

  .fc-format-convert-quality__btn:hover {
    border-color: var(--fc-brand);
    color: var(--fc-brand);
  }
}
