/*
  Stepp videoplanning — Gantt op /videoplanning.

  Hoort bij page-videoplanning.php + assets/js/videoplanning.js.

  Deze pagina gebruikt bewust NIET de dashboard-schil (.dashboard/.hero/
  .content-panel uit dashboard.css). Een planning wil je zo groot mogelijk
  in beeld: één wit vlak dat het scherm vult met 100px lucht eromheen, en
  de tijdlijn die daarbinnen scrollt. De kleurvariabelen uit dashboard.css
  (--stepp-navy, --page-background, ...) worden wél hergebruikt, met een
  fallback zodat dit bestand ook los overeind blijft.

  Alle klassen beginnen met .vp- zodat er niets botst met editor.css of
  dashboard.css.

  Fasekleuren komen uit de Stepp-huisstijl (zie CLAUDE.md §1.2): de
  divisiekleuren plus SteppDarkblue. Voeg je een fase toe in
  videoplanning.js, geef 'm dan hier ook een --vp-<type>-variabele.
*/

:root {
  --vp-line: #e2e6f4;
  --vp-line-strong: #ccd3ea;
  --vp-muted: #6b7399;
  --vp-weekend: #f4f6ff;
  --vp-row-hover: #f7f9ff;

  --vp-voorbereiding: #00a0d2;
  --vp-opname: #dc5091;
  --vp-montage: #0a1955;
  --vp-feedback: #b4a087;
  --vp-verspreiding: #41964b;
}

/* ─── Paginaschil ───────────────────────────────────────────────── */

/* De pagina zelf scrollt niet: het witte vlak is precies zo hoog als het
   scherm minus de rand eromheen, en de tijdlijn scrollt daarbinnen. De
   rand krimpt mee op kleinere schermen — 100px vasthouden op een laptop
   zou een derde van het beeld opeten. */
.vp-page {
  --vp-gutter: clamp(24px, 6vw, 100px);

  display: flex;
  min-height: 100vh;
  padding: var(--vp-gutter);
  background: var(--page-background, #f0f3ff);
}

.vp-panel {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  padding: clamp(20px, 2.2vw, 34px);
  border-radius: 28px;
  background: var(--panel-background, #ffffff);
  box-shadow: 0 24px 60px rgba(10, 25, 85, 0.08);
}

.vp,
.vp * {
  box-sizing: border-box;
}

/* De planner vult het witte vlak; .vp-body pakt de resterende hoogte. */
.vp {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  color: var(--stepp-navy, #0a1955);
  font-family: "Outfit", Arial, sans-serif;
}

.vp-boot {
  padding: 60px 0;
  color: var(--vp-muted);
  font-weight: 300;
}

/* ─── Werkbalk ──────────────────────────────────────────────────── */

.vp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding-bottom: 18px;
}

.vp-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Enige navigatie op deze pagina: terug naar het overzicht. Zelfde
   rondje als .breadcrumb__back in dashboard.css, maar hier los
   gedefinieerd omdat die schil op deze pagina niet meedoet. */
.vp-back {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--page-background, #f0f3ff);
  color: var(--stepp-navy, #0a1955);
  font-size: 16px;
  text-decoration: none;
  transition: background 150ms ease;
}

.vp-back:hover {
  background: #d7dcf5;
}

.vp-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.vp-subtitle {
  margin: 2px 0 0;
  color: var(--vp-muted);
  font-size: 13px;
  font-weight: 300;
}

.vp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.vp-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #3a4270;
  font-size: 13px;
  font-weight: 300;
}

.vp-swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.vp-spacer {
  flex: 1;
}

.vp-zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--vp-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vp-zoom input {
  width: 120px;
  accent-color: var(--stepp-navy);
}

.vp-status {
  min-width: 118px;
  color: var(--vp-muted);
  font-size: 12.5px;
  font-weight: 300;
  text-align: right;
}

.vp-status.is-error {
  color: #c0392b;
  font-weight: 500;
}

.vp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid var(--vp-line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--stepp-navy);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.vp-btn:hover {
  border-color: var(--stepp-navy);
  background: var(--page-background);
}

.vp-btn--primary {
  border-color: var(--stepp-navy);
  background: var(--stepp-navy);
  color: #ffffff;
}

.vp-btn--primary:hover {
  background: var(--stepp-navy-light);
  border-color: var(--stepp-navy-light);
}

.vp-btn--danger {
  border: none;
  padding: 0;
  background: none;
  color: #c0392b;
  font-size: 13px;
  font-weight: 400;
}

.vp-btn--danger:hover {
  background: none;
  text-decoration: underline;
}

.vp-btn:focus-visible,
.vp-input:focus-visible {
  outline: 2px solid #00a0d2;
  outline-offset: 2px;
}

/* ─── Hoofdvlak: tijdlijn + zijpaneel ───────────────────────────── */

.vp-body {
  display: flex;
  min-height: 0;
  flex: 1;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--vp-line);
  border-radius: 20px;
  background: #ffffff;
  overflow: hidden;
}

.vp-scroll {
  flex: 1;
  min-width: 0;
  overflow: auto;
  position: relative;
}

.vp-canvas {
  position: relative;
  min-width: min-content;
  padding-bottom: 40px;
}

/* ─── Kolomkop (maanden + dagen) ────────────────────────────────── */

.vp-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid var(--vp-line-strong);
}

.vp-head-label {
  position: sticky;
  left: 0;
  z-index: 6;
  display: flex;
  width: 290px;
  min-width: 290px;
  align-items: flex-end;
  padding: 10px 18px;
  border-right: 1px solid var(--vp-line-strong);
  background: #ffffff;
  color: var(--vp-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vp-head-track {
  position: relative;
}

.vp-months {
  position: relative;
  height: 26px;
  border-bottom: 1px solid var(--vp-line);
}

.vp-month {
  position: absolute;
  top: 0;
  display: flex;
  height: 26px;
  align-items: center;
  padding-left: 8px;
  border-left: 1px solid var(--vp-line-strong);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}

.vp-days {
  position: relative;
  height: 38px;
}

.vp-day {
  position: absolute;
  top: 0;
  display: flex;
  height: 38px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: #3a4270;
  font-size: 11px;
}

.vp-day.is-weekend {
  color: #a3aac9;
}

.vp-day.is-monday {
  border-left: 1px solid var(--vp-line-strong);
}

.vp-day-wd {
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vp-day-num {
  font-weight: 500;
}

/* ─── Rijen ─────────────────────────────────────────────────────── */

.vp-row {
  display: flex;
  min-width: min-content;
  border-bottom: 1px solid var(--vp-line);
}

.vp-row--project.is-selected .vp-row-label,
.vp-row--project.is-selected .vp-track {
  background: var(--vp-row-hover);
}

.vp-row-label {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  width: 290px;
  min-width: 290px;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 10px;
  border-right: 1px solid var(--vp-line-strong);
  background: #ffffff;
}

.vp-row--project .vp-row-label {
  cursor: pointer;
}

.vp-row--phase {
  border-bottom-color: #f0f2fb;
}

.vp-row--phase .vp-row-label,
.vp-row--phase .vp-track {
  background: #fbfcff;
}

/* Inspringen t.o.v. de projectnaam, die achter het handvat en het
   pijltje begint. */
.vp-row--phase .vp-row-label {
  padding-left: 58px;
}

.vp-caret {
  width: 18px;
  color: #9aa3c4;
  font-size: 10px;
  text-align: center;
  user-select: none;
}

.vp-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 3px;
}

.vp-row-main {
  flex: 1;
  min-width: 0;
}

.vp-row-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-row--phase .vp-row-name {
  color: #3a4270;
  font-size: 12.5px;
  font-weight: 400;
}

.vp-row-sub {
  color: #9aa3c4;
  font-size: 11px;
  font-weight: 300;
}

/* Naam van de verantwoordelijke, rechts in de projectrij. */
.vp-owner {
  overflow: hidden;
  max-width: 96px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--page-background);
  font-size: 11.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Handvat om een project hoger of lager te slepen. */
.vp-grip {
  width: 14px;
  flex: 0 0 auto;
  color: #c3c9de;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.vp-grip:hover {
  color: var(--stepp-navy);
}

.vp-row--project.is-reordering {
  position: relative;
  z-index: 5;
  opacity: 0.75;
  box-shadow: 0 6px 18px rgba(10, 25, 85, 0.22);
}

.vp-row--project.is-reordering .vp-grip {
  color: var(--stepp-navy);
  cursor: grabbing;
}

/* Weekendarcering + weeklijnen worden als achtergrond-gradient gezet
   door videoplanning.js (hangt van de zoomstand af). */
.vp-track {
  position: relative;
  background-color: #ffffff;
}

/* ─── Balken ────────────────────────────────────────────────────── */

.vp-bar {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: none;
  border-radius: 7px;
  background: var(--stepp-navy);
  color: #ffffff;
  font-family: inherit;
  overflow: hidden;
  text-align: left;
  cursor: grab;
  box-shadow: 0 1px 3px rgba(10, 25, 85, 0.18);
  touch-action: none;
}

.vp-bar.is-dragging {
  cursor: grabbing;
  box-shadow: 0 6px 16px rgba(10, 25, 85, 0.3);
}

.vp-bar.is-selected {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--stepp-navy);
}

.vp-bar-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vp-bar-grip {
  position: absolute;
  top: 0;
  right: 0;
  width: 9px;
  height: 100%;
  cursor: ew-resize;
}

.vp.is-readonly .vp-bar {
  cursor: pointer;
}

.vp.is-readonly .vp-bar-grip {
  display: none;
}

.vp-today {
  position: absolute;
  top: 64px;
  bottom: 0;
  z-index: 4;
  width: 2px;
  background: #dc5091;
  opacity: 0.5;
  pointer-events: none;
}

/* ─── Zijpaneel ─────────────────────────────────────────────────── */

.vp-drawer {
  width: 340px;
  min-width: 340px;
  padding: 20px;
  border-left: 1px solid var(--vp-line);
  background: #fbfcff;
  overflow-y: auto;
}

.vp-drawer[hidden] {
  display: none;
}

.vp-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.vp-drawer-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.vp-close {
  border: none;
  background: none;
  color: var(--vp-muted);
  font-family: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.vp-close:hover {
  color: var(--stepp-navy);
}

.vp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.vp-field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.vp-field-row .vp-field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.vp-label {
  color: var(--vp-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.vp-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--vp-line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--stepp-navy);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
}

.vp-input:disabled {
  background: #f4f6ff;
  color: var(--vp-muted);
}

.vp-note {
  margin: 10px 0 0;
  color: #9aa3c4;
  font-size: 12px;
  font-weight: 300;
  line-height: 1.5;
}

.vp-divider {
  height: 1px;
  margin: 18px 0;
  background: var(--vp-line);
}

.vp-section-title {
  margin-bottom: 10px;
  color: var(--vp-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vp-phase-card {
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid var(--vp-line);
  border-radius: 10px;
  background: #ffffff;
}

.vp-phase-card.is-selected {
  border-color: var(--stepp-navy);
}

.vp-phase-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vp-phase-name {
  flex: 1;
  min-width: 0;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: var(--stepp-navy);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

.vp-phase-name:focus {
  outline: none;
  border-bottom: 1px solid var(--vp-line-strong);
}

.vp-phase-remove {
  border: none;
  background: none;
  color: #b6bdd6;
  font-family: inherit;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.vp-phase-remove:hover {
  color: #c0392b;
}

.vp-phase-fields {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}

.vp-phase-fields .vp-input {
  flex: 1;
  min-width: 0;
  padding: 6px 7px;
  font-size: 12px;
}

.vp-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.vp-chip {
  padding: 6px 11px;
  border: 1px dashed var(--vp-line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: #3a4270;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.vp-chip:hover {
  border-style: solid;
  border-color: var(--stepp-navy);
}

.vp-empty {
  padding: 60px 24px;
  color: var(--vp-muted);
  font-size: 14px;
  font-weight: 300;
  text-align: center;
}

/* ─── Smallere schermen ─────────────────────────────────────────── */

@media (max-width: 1100px) {
  .vp-drawer {
    width: 300px;
    min-width: 300px;
  }
}

@media (max-width: 860px) {
  /* Zijpaneel onder de tijdlijn i.p.v. ernaast; de pagina mag hier wél
     als geheel scrollen, anders past die stapel niet meer op het scherm. */
  .vp-page {
    display: block;
    min-height: 0;
  }

  .vp-body {
    flex: none;
    flex-direction: column;
  }

  .vp-scroll {
    height: 60vh;
  }

  .vp-drawer {
    width: auto;
    min-width: 0;
    border-left: none;
    border-top: 1px solid var(--vp-line);
  }
}
