/* ==========================================================
   07 - Vue Timeline, timeline mobile, wizard de creation
   ========================================================== */

/* --- Bascule de vue --- */
.view-toggle {
  display: flex;
  gap: 3px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  padding: 3px;
  flex-shrink: 0;
  margin-left: auto;
}
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 7px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--t3);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.view-toggle-btn:hover { color: var(--t1); }
.view-toggle-btn.active { background: var(--surface); color: var(--t1); box-shadow: var(--shadow-sm); }
.view-toggle-btn svg { width: 14px; height: 14px; }

#timelineView { display: none; }
#timelineView.active { display: block; }

/* --- Barres de navigation --- */
.tl-quarter-bar {
  display: flex;
  gap: clamp(4px, 0.5vw, 8px);
  padding: 12px 24px 8px;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: center;
}
.tl-year-bar {
  display: flex;
  gap: 6px;
  padding: 12px 24px 0;
  justify-content: center;
  align-items: center;
}
.tl-quarter-btn {
  padding: 6px clamp(8px, 1.2vw, 18px);
  border-radius: var(--r-full);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: clamp(10px, 1.1vw, 12px);
  font-weight: 600;
  color: var(--t3);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 1;
}
.tl-quarter-btn:hover { border-color: var(--border-3); color: var(--t1); background: var(--surface-2); }
.tl-quarter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.tl-enseigne-bar { display: flex; gap: 8px; padding: 16px 24px 0; }
.tl-enseigne-btn {
  padding: 8px 20px;
  border-radius: var(--r-full);
  border: 1px solid var(--border-2);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--t3);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background .18s, border-color .18s, color .18s;
}
.tl-enseigne-btn:hover { border-color: var(--border-3); color: var(--t1); background: var(--surface-2); }
.tl-enseigne-btn.active {
  border-color: color-mix(in srgb, var(--blue) 45%, transparent);
  color: var(--blue);
  background: var(--blue-soft);
}

/* --- Canevas --- */
.tl-outer { padding: 20px 24px 0; }
.tl-canvas { position: relative; width: 100%; }
.tl-bar {
  position: absolute;
  height: 12px;
  border-radius: var(--r-full);
  cursor: pointer;
  transition: filter 0.18s, transform 0.18s var(--ease);
  z-index: 2;
}
.tl-bar:hover { filter: brightness(1.14) saturate(1.1); transform: scaleY(1.35); }

.tl-card {
  position: absolute;
  border-radius: var(--r-md);
  border: 1.5px solid;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  /* Leger tilt façon mur de mood-board (angle fourni par --tilt, en inline) ;
     se redresse et se souleve au survol. */
  transform: rotate(var(--tilt, 0deg));
  transition: box-shadow 0.2s, transform 0.22s var(--ease);
  z-index: 3;
}
.tl-card:hover {
  box-shadow: var(--shadow-md);
  transform: rotate(0deg) translateY(-3px);
  z-index: 4;
}
.tl-card img,
.tl-card video { width: 100%; height: 60px; object-fit: cover; display: block; }
.tl-card-placeholder {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  padding: 4px 6px;
  line-height: 1.3;
}
.tl-card-name {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  text-align: center;
  padding: 5px 6px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--t2);
}
.tl-card-dates {
  font-size: 9.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 0 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--t4);
  letter-spacing: 0.02em;
}

.tl-stem { position: absolute; width: 1.5px; z-index: 1; }
.tl-axis { position: absolute; bottom: 0; left: 0; right: 0; height: 50px; border-top: 1.5px solid var(--t2); }
.tl-qaxis { position: relative; height: 100%; }
.tl-qaxis-tick { position: absolute; top: 0; width: 1px; }
.tl-qaxis-tick-minor { height: 4px; background: var(--t4); }
.tl-qaxis-tick-major { height: 9px; background: var(--t3); }
.tl-qaxis-day-label {
  position: absolute;
  top: 10px;
  font-size: 8px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--t3);
  transform: translateX(-50%);
  line-height: 1;
}
.tl-qaxis-month-label {
  position: absolute;
  bottom: 6px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tl-axis-months { display: flex; height: 100%; }
.tl-month {
  flex: 1;
  position: relative;
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 10px;
  text-align: center;
}
.tl-month::before { content: ''; position: absolute; top: -2px; left: 0; width: 1.5px; height: 8px; background: var(--t3); }

.tl-today-line {
  position: absolute;
  top: 0;
  width: 2px;
  background: var(--orange);
  opacity: 0.8;
  z-index: 4;
}
.tl-today-label {
  position: absolute;
  top: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--orange);
  white-space: nowrap;
  padding-left: 6px;
  z-index: 4;
}

.tl-undated { padding: 20px 24px; }
.tl-undated-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--t4);
  margin-bottom: 11px;
}
.tl-undated-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tl-undated-chip {
  padding: 6px 14px;
  border-radius: var(--r-full);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.012em;
  cursor: pointer;
  border: 1px solid;
  background: var(--surface);
  transition: opacity 0.18s, transform 0.14s;
}
.tl-undated-chip:hover { opacity: 0.7; transform: translateY(-1px); }
.tl-empty {
  padding: 60px 24px;
  text-align: center;
  font-size: 14px;
  color: var(--t4);
}

/* ==========================================================
   Timeline mobile
   ========================================================== */
.mtl-list { padding: 8px 12px 32px; display: flex; flex-direction: column; }
.mtl-month-header {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--t3);
  padding: 18px 4px 9px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 9px;
}
.mtl-month-header:first-child { padding-top: 4px; }
.mtl-card {
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  border-left: 4px solid transparent;
  padding: 12px 14px 11px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: transform 0.14s, box-shadow 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.mtl-card:active { transform: scale(0.98); box-shadow: none; }
.mtl-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.mtl-card-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.018em;
  color: var(--t1);
  line-height: 1.3;
  flex: 1;
}
.mtl-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--r-full);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.mtl-current { background: var(--green-soft); color: var(--green); }
.mtl-past    { background: var(--surface-3);  color: var(--t4); }
.mtl-future  { background: var(--blue-soft);  color: var(--blue); }
.mtl-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.mtl-type-dot   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.mtl-type-label { font-size: 11px; font-weight: 700; }
.mtl-date-label { font-size: 11px; color: var(--t3); }
.mtl-bar-track {
  height: 5px;
  background: var(--surface-4);
  border-radius: var(--r-full);
  position: relative;
  overflow: hidden;
}
.mtl-bar-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: var(--r-full);
  min-width: 4px;
  opacity: 0.85;
}

/* ==========================================================
   Wizard pas-a-pas
   ========================================================== */
.wizard-indicator {
  display: flex;
  align-items: flex-start;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.wizard-step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wdot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border-3);
  background: var(--surface);
  color: var(--t3);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.24s var(--ease), border-color 0.24s, color 0.24s, box-shadow 0.24s;
}
.wizard-step-dot.active .wdot {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px var(--blue-soft);
}
.wizard-step-dot.done .wdot {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.wlabel {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t4);
  white-space: nowrap;
  transition: color 0.24s;
}
.wizard-step-dot.active .wlabel { color: var(--blue); }
.wizard-step-dot.done .wlabel   { color: var(--green); }
.wizard-connector {
  flex: 1;
  height: 2px;
  border-radius: 1px;
  background: var(--border-2);
  margin: 15px 10px 0;
  transition: background 0.24s;
}
.wizard-connector.done { background: var(--green); }

.wizard-pane { display: none; }
.wizard-pane.active { display: block; }
.wizard-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.wiz-nav-btn { min-width: 160px; justify-content: center; }
.btn-create {
  background: var(--green);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 2px 8px -2px rgba(11,128,85,0.42);
}
.btn-create:hover { background: var(--green-press); box-shadow: 0 1px 0 rgba(255,255,255,0.16) inset, 0 4px 14px -3px rgba(11,128,85,0.50); }
#editPanel.wizard-mode { display: flex; flex-direction: column; overflow: hidden; }
#editPanel.wizard-mode .edit-form { flex: 1; overflow-y: auto; }
