/* The film looks tool (inc/film-tool.inc.php): the samples, the look tiles,
   the choices and the photo. The layout is pt-ui.css's, the phone editor
   pt-app.css's, the sliders and buttons take pt-theme.css's look. */

/* ── Empty state: the samples ─────────────────────────────────────────── */
.film-editor .sample-thumbnails-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  text-align: center;
  /* Without a width it shrinks to half the box (left: 50%). */
  width: 90%;
}
/* By id: in the phone editor the photo box is out of the card. */
#fl-empty.hidden { display: none; }
.film-editor .sample-thumbnails { display: flex; justify-content: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.film-editor .sample-thumbnail {
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid #dee2e6;
  border-radius: 10px;
  overflow: hidden;
  width: 110px;
  height: 110px;
  padding: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.film-editor .sample-thumbnail:hover,
.film-editor .sample-thumbnail:focus-visible { border-color: var(--pt-accent, #0f70e6); box-shadow: 0 4px 12px rgba(15, 112, 230, 0.25); }
.film-editor .sample-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 767px) { .film-editor .sample-thumbnail { width: 84px; height: 84px; } }

/* ── The photo ────────────────────────────────────────────────────────── */
#fl-viewport { position: relative; display: flex; align-items: center; justify-content: center; padding: 12px; overflow: hidden; }
#fl-canvas { display: block; max-width: 100%; max-height: 100%; border-radius: 6px; background: #fff; }
#fl-canvas[hidden] { display: none; }
/* Lens flare: the photo is where the light is put. */
#fl-canvas.fl-move { cursor: crosshair; touch-action: none; }
#fl-compare.active { color: #fff; background: var(--cb-ink, #16181d); border-color: var(--cb-ink, #16181d); }

/* ── Look tiles: the photo in each look ───────────────────────────────── */
.fl-looks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.fl-look {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--cb-text, #3d434b);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
.fl-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #e9e5df, #f6f4f1);
  box-shadow: inset 0 0 0 1px var(--cb-line, #e4e1dc);
  transition: box-shadow 0.15s;
}
.fl-thumb canvas { display: block; width: 100%; height: 100%; }
.fl-name { max-width: 100%; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
.fl-look:hover .fl-thumb { box-shadow: inset 0 0 0 1px var(--cb-line, #e4e1dc), 0 0 0 2px #cfcac3; }
.fl-look[aria-pressed="true"] { color: var(--cb-ink, #16181d); font-weight: 700; }
/* The chosen one: CB's double ring. */
.fl-look[aria-pressed="true"] .fl-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--cb-ink, #16181d); }
.fl-look:focus-visible { outline: none; }
.fl-look:focus-visible .fl-thumb { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(15, 112, 230, 0.6); }
fieldset:disabled .fl-look { cursor: default; opacity: 0.75; }

.fl-link {
  border: 0;
  background: none;
  padding: 2px 4px;
  font-size: 0.8rem;
  color: var(--pt-accent, #0f70e6);
  cursor: pointer;
}
.fl-link:disabled { color: #9aa1aa; cursor: default; }
.fl-hint { font-size: 0.75rem; line-height: 1.45; color: #6c757d; }
#fl-shuffle { display: inline-flex; align-items: center; gap: 6px; }
.fl-opts[hidden] { display: none; }
/* Two choices of four in a row, words that wrap rather than overflow. */
.fl-choice .pt-cseg button { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }

/* ── Phone editor ─────────────────────────────────────────────────────── */
/* The tiles lifted into the bottom bar: one row that scrolls sideways. */
.pt-app-panels .fl-looks { display: flex; gap: 10px; padding: 6px 4px; }
.pt-app-panels .fl-look { flex: 0 0 auto; width: 68px; color: var(--pt-app-fg); }
.pt-app-panels .fl-look[aria-pressed="true"] { color: var(--pt-app-fg); }
.pt-app-panels .fl-thumb { box-shadow: inset 0 0 0 1px var(--pt-app-line-strong); }
/* Options in the bottom bar: the look's choices, compact. */
.pt-app-panels #fl-opts { padding: 4px 4px 2px; max-height: 40vh; overflow-y: auto; }
.pt-app-panels #fl-opts .form-label { color: var(--pt-app-fg); font-size: 13px; margin-bottom: 4px; }
.pt-app-panels #fl-opts .fl-choice { margin-bottom: 10px !important; }
.pt-app-panels #fl-opts .fl-hint { color: var(--pt-app-fg); opacity: 0.8; margin-bottom: 6px !important; }
.pt-app-panels #fl-opts .form-check-label { color: var(--pt-app-fg); }
.pt-app-panels #fl-date { font-size: 16px; }
