/* Création & bande son — timeline dégradé rose/violet, zoom, modales */

/*
  Responsive : la .main en flex doit pouvoir rétrécir ; sinon le contenu impose
  une largeur min et la fenêtre crée une barre de défilement horizontale.
*/
body .main.main-creation-spectacle {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.creation-spectacle-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Contourne style.css : .app-page-top-sticky .project-header { flex-wrap: nowrap } jusqu’à 640px */
body.has-top-profile-menu .main .creation-spectacle-page .app-page-top-sticky .project-header {
  flex-wrap: wrap !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  align-items: flex-start;
  gap: 16px;
}

body.has-top-profile-menu .main .creation-spectacle-page .app-page-top-sticky .project-header > div:first-child {
  flex: 1 1 min(100%, 420px);
  min-width: 0;
}

/* Contourne margin-left:auto sur [class*="header-actions"] (chaîne présente dans creation-page-header-actions) */
body.has-top-profile-menu .main .creation-spectacle-page .creation-page-header-actions {
  margin-left: 0 !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  flex-wrap: wrap !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 100%;
  gap: 12px;
}

.creation-spectacle-page .project-header-actions a.action-btn {
  text-decoration: none;
}

.creation-page-header-actions {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}

.creation-toolbar-file-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
}

.creation-file-name-inline {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  min-width: 0;
  max-width: min(100%, 200px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.creation-duration-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.creation-duration-input {
  width: 88px;
  min-width: 88px;
  text-align: center;
}

@media (min-width: 900px) {
  .creation-file-name-inline {
    max-width: min(100%, 280px);
  }
}

.creation-audio-file-btn {
  font-size: 12px;
  padding: 9px 12px;
}

@media (max-width: 520px) {
  .creation-audio-file-btn {
    font-size: 11px;
    padding: 8px 10px;
  }
}

.creation-kpi {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .creation-kpi {
    grid-template-columns: 1fr;
  }
}

.creation-card-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.creation-audio-card .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.creation-form-grid {
  display: grid;
  gap: 14px;
}

.creation-form-grid .full {
  grid-column: 1 / -1;
}

.creation-hint {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.62);
}

.creation-file-label {
  cursor: pointer;
}

.creation-file-input:focus + span,
.creation-file-label:focus-within .action-btn {
  outline: 2px solid rgba(236, 72, 153, 0.45);
  outline-offset: 2px;
}

.creation-audio-card {
  max-width: 100%;
  min-width: 0;
}

.creation-wave-panel {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 0;
}

.creation-wave-timeline-wrap.is-hidden {
  display: none;
}

.creation-wave-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
}

.creation-wave-timeline-wrap:not(.is-hidden) {
  margin-top: 10px;
}

.creation-toolbar-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.creation-toolbar-group--left {
  flex: 1 1 auto;
  min-width: 0;
}

.creation-toolbar-group--right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.creation-add-effect-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .creation-toolbar-group--right {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .creation-add-effect-btn {
    white-space: normal;
    text-align: center;
  }

  .creation-time-readout {
    font-size: clamp(15px, 4vw, 19px);
  }
}

/* Lecture / pause — icônes seules, même famille visuelle que le zoom */
.creation-transport-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(236, 72, 153, 0.45);
  background: linear-gradient(145deg, rgba(236, 72, 153, 0.42), rgba(139, 92, 246, 0.38));
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(236, 72, 153, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.creation-transport-btn:hover {
  filter: brightness(1.08);
  box-shadow:
    0 10px 28px rgba(236, 72, 153, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.creation-transport-btn:active {
  transform: scale(0.96);
}

.creation-transport-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.35);
  box-shadow: none;
}

.creation-transport-btn:disabled:hover {
  transform: none;
  filter: grayscale(0.35);
}

.creation-transport-btn:focus-visible {
  outline: 2px solid rgba(244, 114, 182, 0.85);
  outline-offset: 2px;
}

.creation-transport-btn .creation-transport-icon--pause {
  display: none;
}

.creation-transport-btn.is-playing .creation-transport-icon--play {
  display: none;
}

.creation-transport-btn.is-playing .creation-transport-icon--pause {
  display: block;
}

.creation-time-readout {
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(17px, 1.35vw, 22px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: rgba(245, 242, 250, 0.94);
}

/* Zoom + / − (style app : dégradé rose / violet) */
.creation-zoom-cluster {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.14), rgba(139, 92, 246, 0.14));
  border: 1px solid rgba(236, 72, 153, 0.28);
  box-shadow: 0 8px 22px rgba(236, 72, 153, 0.1);
}

.creation-zoom-btn {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.35), rgba(139, 92, 246, 0.28));
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.creation-zoom-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.25);
}

.creation-zoom-btn:active {
  transform: scale(0.96);
}

.creation-zoom-label {
  min-width: 52px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
}

/* Timeline : cadre discret (lisibilité avant effet) */
.creation-timeline-shell {
  position: relative;
  padding: 2px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(120, 70, 110, 0.35) 0%,
    rgba(80, 65, 120, 0.32) 50%,
    rgba(110, 75, 115, 0.3) 100%
  );
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.creation-wave-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(130, 100, 150, 0.4) rgba(0, 0, 0, 0.25);
  background: linear-gradient(180deg, #0e0d12 0%, #0a0a10 50%, #0c0b11 100%);
  cursor: crosshair;
}

.creation-cue-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  pointer-events: none;
  z-index: 3;
}

.creation-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(235, 230, 245, 0.92);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.45);
  pointer-events: none;
  z-index: 6;
  transform: translateX(0);
  will-change: transform;
}

.creation-cue-overlay.is-dragging {
  cursor: grabbing;
}

.creation-cue-bar {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid rgba(236, 72, 153, 0.45);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.82), rgba(139, 92, 246, 0.82));
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.creation-cue-bar:hover {
  filter: brightness(1.06);
}

.creation-cue-bar:active {
  cursor: grabbing;
}

.creation-cue-bar.is-dragging {
  z-index: 20;
}

.creation-cue-bar__drag {
  opacity: 0;
  transition: opacity 0.15s ease;
  font-size: 10px;
  flex-shrink: 0;
}

.creation-cue-bar:hover .creation-cue-bar__drag {
  opacity: 0.95;
}

.creation-cue-bar__txt {
  overflow: hidden;
  text-overflow: ellipsis;
}

.creation-wave-viewport::-webkit-scrollbar {
  height: 10px;
}

.creation-wave-viewport::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
}

.creation-wave-viewport::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(120, 90, 140, 0.45), rgba(90, 80, 120, 0.4));
  border-radius: 8px;
}

#creationWaveCanvas {
  display: block;
  vertical-align: top;
  min-width: 100%;
  max-width: none;
  height: 200px;
  cursor: crosshair;
  box-sizing: content-box;
}

/* Modal confirmation retirer la bande son */
#removeAudioConfirmModal .creation-remove-audio-modal__box {
  width: min(440px, 94vw);
}

/* Modal infos spectacle */
#spectacleInfoModal .spectacle-info-modal__box {
  width: min(520px, 94vw);
  max-height: min(88vh, 720px);
  overflow-y: auto;
}

.spectacle-info-modal__form label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
}

.spectacle-info-modal__form input[type="text"],
.spectacle-info-modal__form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.spectacle-info-modal__form textarea {
  resize: vertical;
  min-height: 120px;
}

.spectacle-info-modal__form input:focus,
.spectacle-info-modal__form textarea:focus {
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.12);
}

/* Timeline tableau */
.creation-timeline-scroll {
  margin-top: 8px;
}

.creation-timeline-inner {
  min-width: 1480px;
}

.creation-timeline-head,
.creation-timeline-inner .catalog-row {
  grid-template-columns:
    64px 72px 72px 54px 90px minmax(180px, 1.45fr) 48px 52px 52px 64px minmax(190px, 1.8fr) 56px;
  gap: 8px 10px;
}

.creation-head-actions {
  justify-self: end;
  text-align: right;
}

.creation-timeline-inner .creation-head-actions {
  min-width: 52px;
}

.creation-row-del {
  appearance: none;
  border: 1px solid rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.creation-row-del:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fff;
}

.creation-inline-input {
  width: 100%;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 0 8px;
  font-size: 12px;
  box-sizing: border-box;
}

.creation-inline-input:focus {
  outline: none;
  border-color: rgba(236, 72, 153, 0.45);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.12);
}

.creation-postes-names-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.creation-cues-empty {
  margin: 14px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
  display: none;
}

.creation-cues-empty.is-visible {
  display: block;
}

/* Modal catalogue */
#catalogEffectModal .creation-catalog-modal__box {
  width: min(1100px, 98vw);
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.creation-catalog-search {
  width: 100%;
  max-width: none;
  margin-bottom: 14px;
}

.creation-catalog-modal-scroll {
  flex: 1;
  min-height: 200px;
  max-height: 52vh;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.creation-catalog-modal-table {
  max-height: 52vh;
}

.creation-catalog-modal-table .catalogue-table-inner {
  min-width: 900px;
}

.creation-modal-head,
.creation-catalog-modal-table .catalog-row {
  grid-template-columns:
    72px minmax(160px, 1.3fr) minmax(140px, 1.05fr) 92px 72px 48px 52px 52px 60px minmax(120px, 1.1fr) 72px;
  gap: 8px 10px;
}

.creation-catalog-modal-table .catalog-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.creation-catalog-modal-table .catalog-row:hover {
  background: rgba(236, 72, 153, 0.12);
}

.creation-catalog-modal-table .catalog-row.is-dim {
  opacity: 0.35;
}

@media (max-width: 768px) {
  #creationWaveCanvas {
    height: 160px;
  }
}
