/*
  The AI Director, as it appears in the Studio.

  Two places: a small strip in the editor's right-hand column that says what is
  being made and lets you pause it, and a sheet over the top for everything else.
  The strip is the important one — it is what makes a timeline that is quietly
  gaining shots explicable — so it is built to sit under the inspector without
  competing with it.

  Nothing here invents a colour. A run's state is carried by the badge and the
  phase strip, which are the two things anybody glances at.
*/

/* ----------------------------------------------------------------- strip */

.studio-director {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  background: var(--s1);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-lg);
}

.studio-director .bar { margin: 2px 0; }

.studio-director-acts {
  gap: var(--sp-2);
  align-items: center;
}

.studio-director-bad {
  color: var(--danger);
  background: var(--danger-soft);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
}

/* ----------------------------------------------------------------- sheet */

/* How wide it gets is stated in app.css, beside the library picker's, because a
   variant cannot widen .modal-card from here. */

.studio-director-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.studio-director-body h3 { margin: 0; }
.studio-director-body p { margin: 0; }

/* ----------------------------------------------------------------- modes */

/*
  The three ways in, as cards rather than a dropdown. Which one applies depends
  on the timeline underneath — a cut with no holes cannot have its holes filled —
  so each one has to be able to say why it is unavailable, which a disabled
  <option> cannot.
*/
.studio-director-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-2);
}

.studio-director-mode {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: var(--sp-3);
  text-align: left;
  color: var(--fg);
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.studio-director-mode:hover:not(:disabled) { background: var(--s2); }

.studio-director-mode.on {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.studio-director-mode.off {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ------------------------------------------------------------------ form */

.studio-director-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.studio-director-form textarea { resize: vertical; }

/*
  Two columns once there is room for them. Fifteen fields in one column is a
  dialog you scroll to read, and the answers at the bottom — how long a shot may
  be, whether to render at the end — are the ones people change most.

  Items that carry a sentence rather than a value opt out and take the full
  width; everything else pairs up in source order.
*/
@media (min-width: 720px) {
  .studio-director-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-3) var(--sp-4);
    align-items: start;
  }

  .studio-director-form > .wide { grid-column: 1 / -1; }
}

.studio-director-pick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---------------------------------------------------------------- phases */

/*
  Where it has got to, as a row of stations rather than a percentage. A film is
  not a linear amount of work — planning is one call and filming is hours — so a
  single bar would sit at 4% for most of the night and read as broken.
*/
.studio-director-phases {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}

.studio-director-phase {
  padding: 3px 10px;
  font-size: 12px;
  color: var(--fg-3);
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
}

.studio-director-phase.past {
  color: var(--fg-2);
  border-color: var(--border-2);
}

.studio-director-phase.now {
  color: var(--fg);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

/* ------------------------------------------------------------------ gate */

.studio-director-gate {
  padding: var(--sp-3);
  background: var(--s2);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
}

.studio-director-contact {
  width: 100%;
  margin-top: var(--sp-3);
  border-radius: var(--r-sm);
  background: #000;
}

/* ------------------------------------------------------------ cast, shots */

.studio-director-more {
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.studio-director-more > summary {
  cursor: pointer;
  color: var(--fg-2);
}

.studio-director-more > summary:hover { color: var(--fg); }

.studio-director-cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.studio-director-role {
  display: flex;
  gap: var(--sp-3);
  min-width: 0;
}

.studio-director-role img {
  flex: none;
  width: 64px;
  height: 84px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--s3);
}

.studio-director-shots {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-height: 420px;
  margin-top: var(--sp-3);
  overflow: auto;
}

.studio-director-shot {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
}

.studio-director-shot:hover { background: var(--s2); }

.studio-director-thumb {
  flex: none;
  width: 96px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--s3);
}

/* ------------------------------------------------------------------- log */

.studio-director-log {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  margin-top: var(--sp-2);
  overflow: auto;
}

.studio-director-note {
  display: flex;
  gap: var(--sp-3);
  font-size: 13px;
  color: var(--fg-2);
}

.studio-director-note > span:first-child {
  flex: none;
  width: 90px;
  text-align: right;
}

.studio-director-note.bad { color: var(--danger); }
