/* Styles CSS intégrés */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap");

:root {
  /* Variables existantes */
  --bg-color: #051525;
  --text-color: #ffffff;
  --header-bg-color: #0a1d37;
  --header-text-color: #ffffff;
  --button-bg-color: #1a2a4a;
  --button-text-color: #ffffff;
  --button-hover-bg-color: #14213d;
  --input-bg-color: #1a2a4a;
  --input-text-color: #ffffff;
  --input-border-color: #555555;
  --border-color: #555555;
  --sequencer-bg-color: #0a1d37;
  --track-name-bg-color: #14213d;
  --event-bg-color: #ff9800;
  --selected-border-color: #ffffff;
  --grid-line-color: #555555;
  --waveform-bg-color: #0a1d37;
  --navy-blue: #0a1d37;
  --soft-blue: #1a2a4a;
  --group-bg-color: #102030; /* Bleu Dodger pour les groupes */

  /* Success state (used for "Importer / Modifier" audio button) */
  --button-success-bg-color: #1f7a3a;
  --button-success-hover-bg-color: #1a6a32;
}

/* Audio import button: green when an audio is configured/loaded */
.button.audio-ok {
  background-color: var(--button-success-bg-color) !important;
}
.button.audio-ok:hover {
  background-color: var(--button-success-hover-bg-color) !important;
}

body {
  font-family: "Roboto", sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  /* overflow-x: hidden; */
  min-height: 100vh;
  -webkit-text-size-adjust: none; /* Pour éviter le zoom automatique sur iOS */
}

/*
  Mode "Créer un Show": l'audio reste TOUJOURS visible en bas.
  On empêche le scroll de la page (body/main) et on scrolle uniquement
  à l'intérieur de la timeline (#sequencerContainer).
*/
body.mode-create-show {
  height: 100vh;
  overflow: hidden;
}

body.mode-dashboard {
  height: 100vh;
  overflow: hidden;
}

/* Régie: même logique que le dashboard -> pas de scroll page, scroll interne */
body.mode-regie {
  height: 100vh;
  overflow: hidden;
}

body.mode-create-show main {
  overflow: hidden;
}

/* Dashboard: prevent the whole page from scrolling; only the list scrolls */
body.mode-dashboard main {
  overflow: hidden;
}

/* Dashboard: ensure the flex chain is constrained to the viewport so the
   show list is the only scrollable area (no overflow under the footer). */
body.mode-dashboard header,
body.mode-dashboard footer {
  flex: 0 0 auto;
}

body.mode-regie header,
body.mode-regie footer {
  flex: 0 0 auto;
}

body.mode-dashboard #mainContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.mode-regie #mainContent {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 10px; /* un peu plus compact pour la régie */
}

body.mode-dashboard #dashboardPage {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

body.mode-dashboard .dashboard-list-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
}

body.mode-create-show #createShowContainer {
  height: 100%;
  min-height: 0;
}

body.mode-create-show #audioPlayerWindow {
  flex: 0 0 auto;
}

header,
nav {
  background-color: var(--header-bg-color);
  color: var(--header-text-color);
  /* padding: 10px; */
  position: relative;
}

header div {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
}

header nav ul {
  list-style-type: none;
  display: flex;
  gap: 30px;
  padding: 0;
  margin: 0;
  justify-content: center;
  padding: 10px;
}

header h1,
footer p {
  padding: 0 5px;
  margin-top: 5px;
  margin-bottom: 5px;
}

nav ul li a {
  color: var(--header-text-color);
  text-decoration: none;
  font-weight: bold;
}

main {
  padding: 20px;
  /* Keep the app occupying the viewport so inner panels can size/scroll
     without pushing the audio player down when groups expand. */
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

footer {
  background-color: var(--header-bg-color);
  color: var(--header-text-color);
  margin-top: auto;
  display: flex;
  min-width: 100%;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2); /* Optionnel : une ombre pour le détacher du contenu */
  justify-content: center;
}

.content {
  flex: 1;
  padding-bottom: calc(
    var(--footer-height, 60px)
  ); /* Utilisation d'une variable CSS pour la hauteur du footer */
}

.button {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  padding: 10px 15px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 4px;
  margin-right: 5px;
  transition: background-color 0.3s;
  font-size: 16px;
}

.button:hover {
  background-color: var(--button-hover-bg-color);
}

.input-field {
  display: block;
  margin-bottom: 10px;
}

.input-field input,
.input-field select {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  box-sizing: border-box;
  background-color: var(--input-bg-color);
  color: var(--input-text-color);
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  font-size: 16px;
}

.label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

/* Zone de messages */
#messageArea {
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: #333333;
  display: none;
}

.clone-btn {
  background-color: #4caf50;
  color: white;
  padding: 5px 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.clone-btn:hover {
  background-color: #45a049;
}

/* Styles pour le séquenceur */
#sequencerContainer {
  margin-top: 20px;
  border: 1px solid var(--border-color);
  position: relative;
  /* Fill available space in the sequencer window (prevents pushing the audio player) */
  flex: 1;
  min-height: 0;
  height: auto;
  overflow-x: auto;
  overflow-y: auto; /* Scroll inside the sequencer area */
  white-space: nowrap;
  background-color: var(--sequencer-bg-color);
  touch-action: pan-x pan-y;
}

.timeline {
  position: relative;
  height: auto; /* S'adapte au nombre de pistes */
  width: 2000px; /* Largeur ajustée pour le séquenceur */
}

.track {
  position: relative;
  height: 60px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--track-name-bg-color);
  display: flex;
  align-items: center;
}

.track-name {
  width: 120px;
  height: 100%;
  background-color: var(--track-name-bg-color);
  border-right: 1px solid var(--border-color);
  text-align: center;
  line-height: 60px;
  font-weight: bold;
  color: var(--text-color);
  box-sizing: border-box;
  flex-shrink: 0;
}

.event {
  position: absolute;
  top: 5px;
  height: 50px;
  background-color: var(--event-bg-color);
  border: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-color);
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  touch-action: none;
}

.event span {
  display: block;
  padding: 1px;
  pointer-events: none;
  font-size: 12px;
  line-height: 14px;
}

/* Laisse un peu d'espace en bas pour l'indicateur de couleur */
.event span:last-of-type {
  margin-bottom: 14px;
}


/* Petits indicateurs de couleur sous les événements (spotlight / fountain) */
.event-color-preview {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  pointer-events: none;
  z-index: 2;
}

.event-color-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.event-color-gradient {
  width: 42px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.25);
}


.event-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 100%;
  cursor: ew-resize;
  background-color: rgba(0, 0, 0, 0.1);
}

.time-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 2px;
  background-color: #ff5722;
  pointer-events: none;
  z-index: 20;
}

.event.selected {
  border-color: var(--selected-border-color);
  box-shadow:
    0 0 0 2px rgba(52, 152, 219, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.event.event-with-visual-color {
  transition: background-color 0.12s ease, background-image 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.event.event-with-fountain-gradient {
  background-repeat: no-repeat;
  background-size: 100% 100%;
  backdrop-filter: saturate(1.08);
}

.event.event-with-fountain-gradient .event-color-gradient {
  border-color: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.22);
}

/* Sélection rectangulaire (CTRL+SHIFT + drag) */
.sm-selection-rect {
  position: absolute;
  border: 1px dashed var(--selected-border-color);
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 50;
}

.grid {
  position: absolute;
  top: 0;
  left: 120px;
  height: 100%;
  width: calc(100% - 120px);
  background-image: linear-gradient(
    to right,
    var(--grid-line-color) 1px,
    transparent 1px
  );
  background-size: 100px 100%;
  pointer-events: none;
  z-index: 1;
}

.waveform-container {
  position: absolute;
  left: 120px;
  top: 0;
  height: 60px;
  width: calc(0% - 120px);
  pointer-events: none;
  background-color: var(--waveform-bg-color);
  z-index: 2;
}

.waveform-container canvas {
  position: absolute;
  top: 0;
  height: 100%;
  display: block;
}

.location-inputs {
  display: flex;
  gap: 10px;
}

.location-inputs input {
  width: 100%;
}

/* Couleur d'événement (picker + champ) */
.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-input-row input[type="color"] {
  width: 44px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--input-border-color);
  background: transparent;
  border-radius: 6px;
}

.color-input-row input[type="text"] {
  flex: 1;
}

/* Indique visuellement #multiple pour la couleur */
.color-input-row.multiple input[type="color"] {
  opacity: 0.55;
}

/* Styles pour les appareils mobiles */
@media screen and (max-width: 768px) {
  header,
  nav,
  footer {
    text-align: center;
  }

  nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .timeline {
    width: 1500px;
  }

  .button {
    font-size: 14px;
    padding: 8px 12px;
  }

  .input-field input,
  .input-field select {
    font-size: 14px;
    padding: 8px;
  }

  .track-name {
    width: 100px;
    line-height: 50px;
  }

  .event {
    height: 40px;
    top: 5px;
  }

  .event span {
    font-size: 10px;
  }

  #sequencerContainer {
    height: 400px; /* Ajusté pour mobile */
  }
}

/* Désactiver la sélection de texte sur les éléments interactifs pour améliorer l'expérience tactile */
.button,
.event,
.event-resize-handle {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Styles pour les modales */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  pointer-events: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  z-index: 1001;
  background-color: var(--bg-color);
  margin: 5% auto;
  padding: 20px;
  border: 1px solid var(--border-color);
  width: 80%;
  max-width: 500px;
  border-radius: 4px;
}

.close-button {
  color: var(--text-color);
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close-button:hover {
  color: #ffffff;
}

/* Styles pour la liste déroulante filtrable */
.custom-dropdown {
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.search-dropdown {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  background-color: var(--input-bg-color);
  color: var(--input-text-color);
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  font-size: 16px;
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: var(--bg-color);
  border: 1px solid var(--input-border-color);
  border-top: none;
  z-index: 100;
  display: none;
}

.dropdown-options div {
  padding: 10px;
  cursor: pointer;
}

.dropdown-options div:hover {
  background-color: var(--button-hover-bg-color);
}

/* Styles pour la page de connexion et d'inscription */
#loginPage,
#registerPage {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: var(--bg-color);
}

#loginForm,
#registerForm {
  background-color: var(--header-bg-color);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 300px;
}

#loginForm h2,
#registerForm h2 {
  text-align: center;
  color: var(--header-text-color);
}

#loginForm .input-field,
#registerForm .input-field {
  margin-bottom: 15px;
}

#loginForm .input-field label,
#registerForm .input-field label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-color);
}

#loginForm .input-field input,
#registerForm .input-field input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  background-color: var(--input-bg-color);
  color: var(--input-text-color);
}

#userManagementPage {
  padding: 20px;
  background-color: var(--bg-color);
}

#userTable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

#userTable th,
#userTable td {
  padding: 10px;
  text-align: left;
  border: 1px solid var(--border-color);
}

#userManagementPage .button {
  margin-top: 10px;
}

.properties-btn {
  background-color: transparent;
  color: var(--text-color);
  border: none;
  cursor: pointer;
  font-size: 12px;
  padding: 2px 5px;
  margin-left: 5px;
}

.properties-btn:hover {
  color: var(--button-hover-bg-color);
}

#liveButton.live {
  background-color: #ff5722; /* Couleur rouge pour indiquer le mode Live activé */
  color: #ffffff;
}

.event.spotlight {
  background-color: var(--spotlight-color, var(--event-bg-color));
}

.toggle-edit-button {
  background-color: var(--button-bg-color);
  color: var(--button-text-color);
  padding: 10px 15px;
  border: none;
  cursor: pointer;
  margin-top: 10px;
  border-radius: 4px;
  margin-right: 5px;
  transition: background-color 0.3s;
  font-size: 16px;
}

.toggle-edit-button:hover {
  background-color: var(--button-hover-bg-color);
}

.toggle-edit-button.active {
  background-color: #dc3545; /* Rouge lorsque actif */
}

/* Style pour les événements non éditables */
.non-draggable {
  cursor: default;
}

.non-resizable .event-resize-handle {
  display: none;
}

.group[data-collapsed="true"]::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 120px;
  width: calc(100% - 120px);
  height: 1px;
  background-color: #0000ff; /* Bleu pour la séparation */
  z-index: 10;
}

/* Styles pour les en-têtes de groupe */
.group-header {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* Aligne les éléments à gauche */
  background-color: var(--group-bg-color);
  height: 30px;
  line-height: 30px;
  position: relative;
  cursor: pointer;
  border-bottom: 1px solid var(--border-color);
  /* padding: 0 10px; Ajout de padding pour l'espacement */
  z-index: 10;
}

.group-header span {
  /* margin-left: auto; Pousse le nom du groupe vers la droite */
  /* font-weight: bold; */
  font-size: 14px;
}

.buttons-div {
  display: flex;
  gap: 5px;
}

/* Styles pour les pistes dans un groupe */
.group-content {
  display: block;
}

/* Styles pour un groupe rétracté */
.group-collapsed .group-content {
  display: none;
}

.move-group-button,
.rename-group-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px; /* Taille augmentée pour une meilleure visibilité */
  color: var(--button-text-color);
  padding: 0 5px;
  margin: 0 2px; /* Espacement entre les boutons */
}

.move-group-button:hover,
.rename-group-button:hover {
  color: var(--button-hover-bg-color);
}

.track-name {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.name-container {
  display: flex;
  align-items: center;
  width: 100%;
}

.move-buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-right: 5px;
}

.move-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--button-text-color);
  padding: 0;
  margin: 0;
}

.move-button:hover {
  color: var(--button-hover-bg-color);
}

.move-group-button,
.rename-group-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px; /* Taille augmentée pour une meilleure visibilité */
  color: var(--button-text-color);
  padding: 0 5px;
  margin: 0 2px; /* Espacement entre les boutons */
}

.track-name span {
  flex-grow: 1;
}

/* Personnalisation de la Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
  background: var(--input-border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--button-hover-bg-color);
}

/* Pour Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--input-border-color) var(--bg-color);
}

#input-field {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#input-field .input-field {
  flex: 1;
  min-width: 100px;
}

#resizeHandle {
  position: absolute;
  left: -15px;
  top: 0;
  width: 30px; /* Augmentation de la largeur du trait */
  height: 100%;
  cursor: ew-resize;
  background-color: rgba(255, 255, 255, 0.1); /* Légèrement visible */
}

/* Optionnel: Vous pouvez ajouter une ligne pour le différencier visuellement */
#resizeHandle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 100%;
  background-color: var(--border-color);
}

/* Conteneur principal */
#createShowContainer {
  display: flex;
  flex-direction: column;
  /* Height is driven by the main layout (flex:1 on <main>) */
  height: 100%;
  flex: 1;
  min-height: 0;
  gap: 5px;
}

/* Menu du Haut */
#topMenu {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background-color: var(--header-bg-color);
  border-bottom: 1px solid var(--border-color);
  border-radius: 8px;
}

/* Groupes dans le menu */
.menu-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Zone principale */
#mainArea {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 5px;
}

/* Fenêtres */
.window {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

/* Permettre le redimensionnement horizontal */
#sequencerWindow {
  flex: 1;
  min-width: 200px;
}

#eventPropertiesWindow {
  width: 300px;
  min-width: 200px;
}

/* Multi-sélection : visibilité du placeholder (#multiple) */
#eventPropertiesWindow input::placeholder,
#eventPropertiesWindow textarea::placeholder {
  color: #ffffff;
  opacity: 0.85;
}

/* Poignée de redimensionnement */
#resizeHandle {
  width: 5px;
  cursor: col-resize;
  background-color: var(--border-color);
}

/* Styles supplémentaires */
.window-header {
  background-color: var(--header-bg-color-light);
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.window-header h3 {
  margin: 0;
}

.window-content {
  flex: 1;
  overflow: auto;
  padding: 10px;
}

/* Event properties: internal scroll area + footer buttons always visible */
#eventPropertiesWindow .window-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* On donne le MAX d'espace aux propriétés (scroll interne),
     et la barre d'actions reste collée en bas. */
  overflow: hidden;
  padding: 0; /* le padding est géré dans les sous-zones */
}


/* Ensure the properties inner wrapper stretches to full height */
#eventPropertiesWindow #eventProperties {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}
.event-properties-content {
display: flex;
flex-direction: column;
flex: 1 1 auto;
min-height: 0;
height: 100%;
}


.event-properties-scroll {
flex: 1 1 auto;
overflow: auto;
min-height: 0;
padding: 10px;
padding-right: 12px;
}


.event-properties-footer {
flex: 0 0 auto;
display: flex;
gap: 8px;
align-items: center;
justify-content: center;
padding: 10px;
margin-top: auto;
border-top: 1px solid var(--border-color);
background: rgba(0, 0, 0, 0.18);
backdrop-filter: blur(4px);
}


.event-properties-footer .button {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

/* Boutons icônes uniquement (texte via tooltip au survol) */
.button.icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 18px;
  line-height: 1;
}

.event-properties-footer .button.icon-only {
  flex: 0 0 auto;
  width: 44px;
  height: 36px;
}

/* Sequencer layout: toolbar fixed, timeline fills remaining height */
#sequencerWindow .window-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Avoid the whole window scrolling; the sequencer itself scrolls */
  overflow: hidden;
}

#sequencerWindow .window-content > .menu-group {
  flex: 0 0 auto;
}

#sequencerWindow .window-content > #sequencerContainer {
  flex: 1 1 auto;
  min-height: 0;
}

/* Boutons dans le menu du haut */
#topMenu .button {
  margin-right: 5px;
}

/* Ajustement pour les champs du menu */
#topMenu .input-field {
  margin-right: 15px;
}

/* Styles pour la liste des serveurs */
.server-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* Styles pour chaque boîte de serveur */
.server-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: #1a2a4a; /* Couleur gris-bleu par défaut */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap; /* Permet le retour à la ligne des éléments si nécessaire */
}

.server-card.selected {
  background-color: #4caf50; /* Vert clair */
}

/* Conteneur principal */
.server-box {
  display: flex;
  align-items: center;
  flex: 1 1 100%;
}

/* Logo du serveur à gauche */
.logo-container {
  width: 15%; /* Utilisation d'un pourcentage pour la largeur */
  max-width: 120px; /* Largeur maximale */
  height: auto;
  flex-shrink: 0;
  margin-right: 10px;
}

.server-logo {
  width: 100%;
  height: auto; /* Maintenir le ratio de l'image */
  object-fit: cover;
  border-radius: 4px;
}

/* Informations du serveur */
.server-info {
  flex: 1 1 60%; /* Ajustement pour l'espace occupé */
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.server-info h3 {
  font-weight: bold;
  margin: 0;
}

.server-info p {
  font-style: italic;
  margin: 5px 0 0 0;
}

/* Boutons d'action alignés verticalement à droite */
.server-actions {
  flex: 1 1 25%; /* Ajustement pour l'espace occupé */
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}

.server-actions .button {
  padding: 0.5em 1em;
  font-size: 0.9em;
  width: 130px;
  border: 1px solid var(--border-color);
}

.input-field textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  box-sizing: border-box;
  background-color: var(--input-bg-color);
  color: var(--input-text-color);
  border: 1px solid var(--input-border-color);
  border-radius: 4px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}

/* Styles pour les boutons dans le modal */
#associateGroupModal .button {
  margin: 10px 0;
  width: 100%;
}

/* Styles pour les sections cachées */
#associateGroupSection,
#createGroupSection {
  margin-top: 20px;
}

/* Responsive */
@media screen and (max-width: 0px) {
  #mainContent {
    flex-direction: column;
  }

  #sequencerWindow,
  #eventPropertiesWindow {
    width: 100%;
    min-width: auto;
  }

  #resizeHandle {
    display: none;
  }

  /* Fenêtre pour le lecteur audio */
  #audioPlayerWindow {
    flex: 0 0 400px; /* Ajuste la largeur ici si nécessaire */
    height: auto;
    margin: 10px;
  }

  #audioPlayerWindow .window-header {
    background-color: #f5f5f5;
    padding: 10px;
    border-bottom: 1px solid #ccc;
  }

  #audioPlayerWindow .window-content {
    padding: 20px;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  #audioPlayer {
    width: 100%;
    height: 60px; /* Taille de la barre de lecture */
    background-color: #f0f0f0;
    border-radius: 8px;
    border: 1px solid #ccc;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px;
  }

  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    margin: 0;
  }

  /* Assurer que main prend tout l'espace disponible */
  main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
  }

  /* Style pour footer déjà ajusté via JavaScript, mais peut être renforcé ici */
  footer {
    background-color: var(--header-bg-color);
    color: var(--header-text-color);
    text-align: center;
    padding: 10px;
  }
  /* Optionnel : Ajustements spécifiques pour createShowContainer */
  #createShowContainer {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }

  #customBeamTypeContainer {
    margin-top: 10px;
  }
}

/* Dashboard (Tableau de Bord) */
.dashboard {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.dashboard-list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.dashboard-title h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.dashboard-subtitle {
  opacity: 0.8;
  font-size: 14px;
  margin-top: 4px;
}

.dashboard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.button.dashboard-primary {
  background: linear-gradient(180deg, rgba(61, 122, 255, 0.25), rgba(61, 122, 255, 0.10));
  border: 1px solid rgba(120, 170, 255, 0.35);
}

.button.dashboard-primary:hover {
  background: linear-gradient(180deg, rgba(61, 122, 255, 0.35), rgba(61, 122, 255, 0.18));
}

.dashboard-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(10, 29, 55, 0.45);
  backdrop-filter: blur(6px);
}

.dashboard-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(5, 21, 37, 0.35);
}

.dashboard-search-icon {
  opacity: 0.8;
}

.dashboard-search input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-color);
  font-size: 14px;
}

.dashboard-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.dashboard-sort label {
  opacity: 0.8;
  font-size: 14px;
}

.dashboard-sort select {
  padding: 8px 10px;
  background-color: rgba(26, 42, 74, 0.75);
  color: var(--input-text-color);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
}

.dashboard-view-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(5, 21, 37, 0.35);
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  opacity: 0.95;
}

.dashboard-view-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #6fa4ff;
}

.show-card-submeta {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  opacity: 0.85;
  font-size: 12.5px;
}

.show-meta-dates {
  margin: 6px 0 12px;
  opacity: 0.8;
  font-size: 13px;
  line-height: 1.35;
}

.dashboard-stats {
  margin-left: auto;
  opacity: 0.8;
  font-size: 13px;
}

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.show-section {
  margin-top: 14px;
}

/* Nested grouping inside a server (Serveur -> Dossier) */
.show-subsection {
  margin-top: 10px;
  margin-left: 18px;
  padding-left: 10px;
  border-left: 2px solid rgba(255,255,255,0.10);
}

.show-subsection .show-section-header {
  margin: 4px 2px 10px;
  padding: 6px 8px;
  opacity: 0.98;
}

.show-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 2px 10px;
  cursor: pointer;
  user-select: none;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.0);
  transition: background 120ms ease, border-color 120ms ease;
}

.show-section-header:hover {
  background: rgba(26, 42, 74, 0.18);
  border-color: rgba(255,255,255,0.18);
}

.show-section-header:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.45);
  border-radius: 10px;
}

.show-section-chevron {
  width: 18px;
  text-align: center;
  opacity: 0.85;
}

.show-section-title {
  font-weight: 600;
  opacity: 0.95;
}

.show-section-count {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(26, 42, 74, 0.35);
  opacity: 0.85;
}

.show-card {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(10, 29, 55, 0.38);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  outline: none;
  overflow: hidden; /* keep action buttons inside on narrow widths */
  position: relative;
}

/* Background image for the whole card (slightly blurred) */
.show-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(135deg, rgba(8, 20, 40, 0.78), rgba(8, 20, 40, 0.55)),
    var(--show-card-bg, url("../logo.png"));
  background-size: cover;
  background-position: center;
  filter: blur(6px);
  transform: scale(1.04);
  opacity: 0.95;
  z-index: 0;
  pointer-events: none;
}

/* Ensure content sits above the blurred background */
.show-card > * {
  position: relative;
  z-index: 1;
}

.show-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.show-card-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(26, 42, 74, 0.35);
  flex: 0 0 auto;
}

.show-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.show-card-info {
  min-width: 0;
  flex: 1;
}

.show-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
  background: rgba(10, 29, 55, 0.52);
}

.show-card:focus-visible {
  box-shadow: 0 0 0 2px rgba(120, 170, 255, 0.45);
}

.show-card-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.show-card-path {
  font-size: 12px;
  opacity: 0.75;
  margin-top: -2px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.show-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  opacity: 0.85;
  font-size: 12px;
}

.show-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: stretch;
}

.icon-btn {
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(26, 42, 74, 0.55);
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.icon-btn:hover {
  background: rgba(26, 42, 74, 0.75);
  border-color: rgba(255,255,255,0.18);
}

.icon-btn.danger {
  background: rgba(255, 90, 90, 0.10);
  border-color: rgba(255, 90, 90, 0.25);
}

.icon-btn.danger:hover {
  background: rgba(255, 90, 90, 0.16);
  border-color: rgba(255, 90, 90, 0.35);
}

.dashboard-empty {
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 14px;
  padding: 18px;
  background: rgba(10, 29, 55, 0.26);
}

.dashboard-empty-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 6px;
}

.dashboard-empty-subtitle {
  opacity: 0.85;
  font-size: 13px;
}

.dashboard-empty-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dashboard-message {
  opacity: 0.9;
  font-size: 14px;
}

footer.editor-footer-saved {
  background-color: #1f7a3a;
}

footer.editor-footer-dirty {
  background-color: #b96b12;
}

#smFooterEditorState {
  margin-left: 10px;
  font-weight: 600;
}

.fixtures-modal-content {
  max-width: 1100px;
  width: min(1100px, 94vw);
}

.fixtures-modal-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.fixtures-modal-help {
  opacity: 0.86;
  font-size: 0.95rem;
}

.fixtures-modal-list {
  max-height: 60vh;
  overflow: auto;
  padding-right: 6px;
}

.fixtures-empty-state {
  padding: 18px;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
}

.fixtures-errors-box {
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(193, 51, 51, 0.18);
  border: 1px solid rgba(193, 51, 51, 0.4);
}

.fixture-group-block {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.025);
}

.fixture-group-block[data-fixture-depth="1"] {
  margin-left: 10px;
  background: rgba(255,255,255,0.02);
}

.fixture-group-block[data-fixture-depth="2"],
.fixture-group-block[data-fixture-depth="3"],
.fixture-group-block[data-fixture-depth="4"] {
  margin-left: 18px;
  background: rgba(255,255,255,0.018);
}

.fixture-group-block.collapsed {
  padding-bottom: 8px;
}

.fixture-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  margin-bottom: 8px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.fixture-group-block.collapsed .fixture-group-toggle {
  margin-bottom: 0;
}

.fixture-group-chevron {
  flex: 0 0 auto;
  font-size: 0.95rem;
  opacity: 0.82;
}

.fixture-group-title {
  font-weight: 700;
  font-size: 0.96rem;
}

.fixture-group-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 0.78rem;
  opacity: 0.88;
}

.fixture-group-body {
  display: block;
  padding-left: 6px;
}

.fixture-row {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  background: rgba(10, 29, 55, 0.52);
}

.fixture-row.has-error {
  border-color: rgba(193, 51, 51, 0.8);
  box-shadow: 0 0 0 1px rgba(193, 51, 51, 0.25) inset;
}

.fixture-row-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.fixture-row-title {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.fixture-usage {
  opacity: 0.72;
  font-size: 0.82rem;
}

.fixture-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 0.74rem;
  font-weight: 600;
}

.fixture-badge.warning {
  background: rgba(255, 193, 7, 0.18);
  border: 1px solid rgba(255, 193, 7, 0.45);
  color: #ffe08a;
}

.fixture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.fixture-grid label,
.fixture-reset-command {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fixture-checkbox {
  display: flex !important;
  align-items: center;
  gap: 8px;
}

.fixture-checkbox input {
  width: auto;
  margin: 0;
}

.fixture-reset-command {
  margin-top: 8px;
}

.danger-button,
.fixture-delete-btn {
  background-color: #8a2e2e;
}

.danger-button:hover,
.fixture-delete-btn:hover {
  background-color: #702424;
}


.fixtures-modal-content .button {
  white-space: nowrap;
}

.fixtures-modal-content input[type="text"],
.fixtures-modal-content input[type="number"],
.fixtures-modal-content select,
.fixtures-modal-content textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 9px;
  background-color: var(--input-bg-color);
  color: var(--input-text-color);
  border: 1px solid var(--input-border-color);
  border-radius: 6px;
}

.fixtures-modal-content label > span:first-child,
.fixture-reset-command > span:first-child {
  font-size: 0.82rem;
  opacity: 0.84;
}

.fixture-row-header {
  align-items: flex-start;
}

.fixture-row-header .button {
  flex-shrink: 0;
}

.fixture-grid {
  align-items: end;
}

.fixture-checkbox {
  min-height: 36px;
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
}

.fixture-checkbox span {
  line-height: 1.2;
}

.fixture-checkbox input {
  flex: 0 0 auto;
}


.fixture-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.fixture-checkbox.compact,
.fixture-reset-command.compact {
  font-size: 0.9rem;
}

.fixture-delete-btn {
  padding: 7px 10px;
  font-size: 0.82rem;
}

@media (max-width: 720px) {
  .fixtures-modal-content {
    width: min(96vw, 1100px);
    margin: 2vh auto;
    padding: 16px;
  }

  .fixture-row-header {
    flex-direction: column;
    align-items: stretch;
  }

  .fixture-delete-btn {
    width: 100%;
  }
}

/* Popup vidéos de référence synchronisées */
.video-sync-modal-content {
  max-width: min(1200px, 96vw);
  width: 96vw;
  max-height: 92vh;
  overflow: auto;
}

.video-sync-help {
  margin: 6px 0 12px;
  opacity: 0.82;
  line-height: 1.4;
}

.video-sync-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.video-sync-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.video-sync-card {
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.14));
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.video-sync-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.42);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 10px;
}

.video-sync-preview iframe,
.video-sync-preview video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.video-sync-zoom-inner {
  transform-origin: center center;
}

.video-sync-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  text-align: center;
  padding: 10px;
}

.video-sync-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 780px) {
  .video-sync-grid,
  .video-sync-fields {
    grid-template-columns: 1fr;
  }
}

/* Menus clic droit du séquenceur */
.sm-context-menu {
  position: fixed;
  z-index: 5000;
  min-width: 210px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-color);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.sm-context-menu button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: var(--text-color);
  text-align: left;
  cursor: pointer;
}
.sm-context-menu button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.10);
}
.sm-context-menu button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sm-context-menu-separator {
  height: 1px;
  margin: 5px 3px;
  background: var(--border-color);
}

/* Markers de timeline */
.timeline-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 20;
  background: var(--marker-color, #ffcc00);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
}
.timeline-marker::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 9px solid var(--marker-color, #ffcc00);
}
.timeline-marker-flag {
  position: absolute;
  left: 7px;
  top: 4px;
  max-width: 180px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  pointer-events: none;
}
.timeline-marker:hover .timeline-marker-flag {
  opacity: 1;
  transform: translateY(0);
}

.timeline-marker.timeline-marker-editable {
  cursor: ew-resize;
}
.timeline-marker.timeline-marker-editable::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -8px;
  width: 18px;
}

.sm-small-modal-content,
.sm-marker-modal-content {
  max-width: 560px;
}
.sm-form-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 12px;
  align-items: center;
}
.sm-form-grid input,
.sm-form-grid textarea {
  width: 100%;
  box-sizing: border-box;
}
.sm-form-grid textarea {
  resize: vertical;
}
.sm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.button.danger {
  background: #b3261e;
  color: #fff;
}

/* Modal affichage propre */
.display-settings-modal-content {
  max-width: 720px;
  padding: 24px;
}
.display-settings-header h3 {
  margin: 0;
  font-size: 1.35rem;
}
.display-settings-header p {
  margin: 6px 0 0;
  color: var(--muted-text-color, #9ca3af);
  font-size: 0.92rem;
}
.display-settings-section {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}
.display-settings-section h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}
.display-settings-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  cursor: pointer;
}
.display-settings-row input {
  margin-top: 4px;
}
.display-settings-row strong,
.display-settings-field label {
  display: block;
  color: var(--text-color);
}
.display-settings-row small,
.display-settings-field small {
  display: block;
  margin-top: 4px;
  color: var(--muted-text-color, #9ca3af);
  line-height: 1.35;
}
.display-settings-field {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 8px 14px;
  align-items: center;
  margin-top: 12px;
}
.display-settings-field select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--input-bg-color, #111827);
  color: var(--text-color);
}
.display-settings-field small {
  grid-column: 2;
}
.display-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Options d'affichage des markers */
.timeline-marker-full {
  top: 0;
  bottom: 0;
}
.timeline-marker-waveform {
  top: 0;
  height: 60px;
  bottom: auto;
}
.timeline.marker-text-always .timeline-marker-flag {
  opacity: 1;
  transform: translateY(0);
}
.timeline.marker-text-hover .timeline-marker:hover .timeline-marker-flag {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .display-settings-field {
    grid-template-columns: 1fr;
  }
  .display-settings-field small {
    grid-column: 1;
  }
}

/* Drag des markers en mode édition */
.timeline-marker.timeline-marker-dragging {
  cursor: ew-resize;
  opacity: 0.9;
  z-index: 60;
}
.sm-marker-is-dragging,
.sm-marker-is-dragging * {
  cursor: ew-resize !important;
  user-select: none !important;
}
.event.dragging,
.event.dragging * {
  user-select: none !important;
}

/* Modern compact toolbar for the show editor
   Keeps the same vertical footprint while making the top bar cleaner. */
body.mode-create-show #topMenu {
  --sm-toolbar-h: 86px;
  min-height: var(--sm-toolbar-h);
  max-height: var(--sm-toolbar-h);
  box-sizing: border-box;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  background:
    radial-gradient(circle at 18% -30%, rgba(72, 132, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(10, 29, 55, 0.96), rgba(5, 18, 34, 0.96));
  border: 1px solid rgba(117, 159, 210, 0.14);
  border-bottom-color: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

body.mode-create-show #topMenu .menu-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.mode-create-show #topMenu .menu-group:first-child {
  flex: 1 1 auto;
  padding-right: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.mode-create-show #topMenu .menu-group:last-child {
  flex: 0 0 auto;
  align-items: center;
  padding: 8px 12px;
  margin: -1px 0 -1px 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 43, 78, 0.68), rgba(6, 22, 41, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.mode-create-show #topMenu .input-field {
  width: 180px;
  min-width: 165px;
  margin: 0 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

body.mode-create-show #topMenu .menu-group:last-child .input-field {
  width: auto;
  min-width: 190px;
  margin: 0;
}

body.mode-create-show #topMenu .label {
  display: block;
  margin: 0;
  color: rgba(246, 250, 255, 0.92);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
}

body.mode-create-show #topMenu .input-field input,
body.mode-create-show #topMenu .input-field select {
  height: 34px;
  margin: 0;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid rgba(154, 188, 232, 0.36);
  background: rgba(7, 22, 42, 0.78);
  color: #f8fbff;
  font-size: 14px;
  font-weight: 500;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(0, 0, 0, 0.08);
}

body.mode-create-show #topMenu .input-field input:focus,
body.mode-create-show #topMenu .input-field select:focus {
  border-color: rgba(93, 172, 255, 0.85);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.mode-create-show #topMenu .button {
  height: 38px;
  margin: 0;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 7px;
  border: 1px solid rgba(144, 179, 226, 0.22);
  background:
    linear-gradient(180deg, rgba(40, 65, 107, 0.90), rgba(25, 42, 75, 0.90));
  color: rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 8px 18px rgba(0, 0, 0, 0.16);
  transition: transform 0.12s ease, background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

body.mode-create-show #topMenu .button:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 190, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(48, 78, 127, 0.96), rgba(28, 50, 88, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 10px 22px rgba(0, 0, 0, 0.22);
}

body.mode-create-show #topMenu .button:active {
  transform: translateY(0);
}

body.mode-create-show #openVideoSyncBtn,
body.mode-create-show #importAudioBtn.button.audio-ok,
body.mode-create-show #importAudioBtn {
  border-color: rgba(68, 211, 126, 0.32) !important;
  background:
    linear-gradient(180deg, rgba(37, 178, 88, 0.98), rgba(23, 127, 62, 0.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 9px 22px rgba(0, 146, 62, 0.18) !important;
}

body.mode-create-show #openVideoSyncBtn:hover,
body.mode-create-show #importAudioBtn.button.audio-ok:hover,
body.mode-create-show #importAudioBtn:hover {
  background:
    linear-gradient(180deg, rgba(43, 199, 100, 1), rgba(26, 145, 70, 1)) !important;
}

body.mode-create-show #topMenu .menu-group:last-child .input-field > div {
  gap: 0 !important;
  flex-wrap: nowrap !important;
}

body.mode-create-show #importAudioBtn::after {
  content: "⌄";
  margin-left: 4px;
  font-size: 14px;
  opacity: 0.85;
}

@media (max-width: 1450px) {
  body.mode-create-show #topMenu .button {
    padding: 0 10px;
    font-size: 12px;
  }
  body.mode-create-show #topMenu .input-field {
    width: 155px;
    min-width: 145px;
  }
}

/* Icon-only editor toolbar refresh
   Text labels stay available on hover/focus via custom tooltips. */
body.mode-create-show #topMenu {
  --sm-toolbar-h: 86px;
  --sm-icon-size: 44px;
  --sm-icon-radius: 11px;
  padding: 8px 12px;
  align-items: center;
  background:
    radial-gradient(circle at 12% -35%, rgba(80, 140, 255, 0.16), transparent 36%),
    radial-gradient(circle at 80% 140%, rgba(24, 180, 110, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(9, 27, 52, 0.98), rgba(5, 17, 33, 0.98));
}

body.mode-create-show #topMenu .menu-group {
  gap: 12px;
}

body.mode-create-show #topMenu .menu-group:first-child {
  gap: 18px;
  padding-right: 16px;
}

body.mode-create-show #topMenu .menu-group:last-child {
  padding: 8px 14px 8px 18px;
  gap: 16px;
  background: linear-gradient(180deg, rgba(13, 39, 73, 0.52), rgba(7, 22, 41, 0.40));
}

body.mode-create-show #topMenu .input-field {
  width: 235px;
  min-width: 210px;
  margin-right: 10px;
}

body.mode-create-show #topMenu .input-field::after {
  content: "";
  width: 1px;
  height: 50px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.20), transparent);
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
}

body.mode-create-show #topMenu .input-field {
  position: relative;
}

body.mode-create-show #topMenu .menu-group:last-child .input-field::after {
  display: none;
}

body.mode-create-show #topMenu .menu-group:last-child .input-field {
  width: auto;
  min-width: 170px;
  align-items: center;
  text-align: center;
}

body.mode-create-show #topMenu .label {
  font-size: 13px;
  font-weight: 800;
  color: rgba(245, 249, 255, 0.95);
}

body.mode-create-show #topMenu .input-field input {
  height: 36px;
  border-radius: 9px;
  padding: 0 13px;
  background: linear-gradient(180deg, rgba(10, 30, 57, 0.86), rgba(7, 22, 42, 0.82));
  border-color: rgba(109, 166, 235, 0.34);
  font-size: 15px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 0 0 1px rgba(0,0,0,0.15),
    0 6px 18px rgba(0,0,0,0.16);
}

body.mode-create-show #topMenu .toolbar-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body.mode-create-show #topMenu .toolbar-icon-button.button {
  position: relative;
  width: var(--sm-icon-size);
  height: var(--sm-icon-size);
  min-width: var(--sm-icon-size);
  padding: 0;
  margin: 0;
  border-radius: var(--sm-icon-radius);
  border: 1px solid rgba(112, 169, 238, 0.24);
  background:
    radial-gradient(circle at 50% 20%, rgba(105, 172, 255, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(23, 54, 95, 0.70), rgba(12, 33, 63, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 9px 20px rgba(0,0,0,0.18);
  overflow: visible;
}

body.mode-create-show #topMenu .toolbar-icon-button.button:hover,
body.mode-create-show #topMenu .toolbar-icon-button.button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(134, 197, 255, 0.56);
  background:
    radial-gradient(circle at 50% 20%, rgba(125, 194, 255, 0.20), transparent 50%),
    linear-gradient(180deg, rgba(30, 70, 120, 0.82), rgba(14, 38, 72, 0.86));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 11px 24px rgba(0,0,0,0.26),
    0 0 0 3px rgba(71, 151, 255, 0.10);
}

body.mode-create-show #topMenu .toolbar-icon-glyph {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  color: #9ed3ff;
  filter: drop-shadow(0 0 7px rgba(83, 180, 255, 0.38));
}

body.mode-create-show #topMenu .toolbar-save .toolbar-icon-glyph { color: #b69bff; }
body.mode-create-show #topMenu .toolbar-reload .toolbar-icon-glyph { color: #93d7ff; font-size: 30px; }
body.mode-create-show #topMenu .toolbar-export .toolbar-icon-glyph { color: #f0a3ff; font-size: 30px; }
body.mode-create-show #topMenu .toolbar-fixtures .toolbar-icon-glyph { color: #ff9bd7; }
body.mode-create-show #topMenu .toolbar-display .toolbar-icon-glyph { color: #8fd2ff; font-size: 28px; }
body.mode-create-show #topMenu .toolbar-presets .toolbar-icon-glyph { color: #ffd27d; font-size: 31px; }
body.mode-create-show #topMenu .toolbar-menu-toggle .toolbar-icon-glyph { color: #88c7ff; font-size: 31px; }

body.mode-create-show #openVideoSyncBtn.toolbar-icon-button,
body.mode-create-show #importAudioBtn.toolbar-icon-button,
body.mode-create-show #importAudioBtn.button.audio-ok.toolbar-icon-button {
  border-color: rgba(54, 221, 125, 0.38) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(99, 255, 160, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(25, 159, 79, 0.96), rgba(18, 112, 58, 0.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 10px 22px rgba(0, 146, 62, 0.20),
    0 0 0 1px rgba(60, 255, 145, 0.06) !important;
}

body.mode-create-show #openVideoSyncBtn.toolbar-icon-button:hover,
body.mode-create-show #importAudioBtn.toolbar-icon-button:hover,
body.mode-create-show #importAudioBtn.button.audio-ok.toolbar-icon-button:hover {
  background:
    radial-gradient(circle at 50% 20%, rgba(130, 255, 180, 0.24), transparent 50%),
    linear-gradient(180deg, rgba(35, 190, 97, 1), rgba(21, 132, 67, 1)) !important;
}

body.mode-create-show #openVideoSyncBtn .toolbar-icon-glyph,
body.mode-create-show #importAudioBtn .toolbar-icon-glyph {
  color: #d5ffe4;
  filter: drop-shadow(0 0 8px rgba(79, 255, 147, 0.45));
}

body.mode-create-show #openVideoSyncBtn .toolbar-icon-glyph { font-size: 29px; }
body.mode-create-show #importAudioBtn .toolbar-icon-glyph { font-size: 32px; }

body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 9px);
  transform: translateX(-50%) translateY(-3px);
  z-index: 10000;
  max-width: 240px;
  width: max-content;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(141, 188, 255, 0.28);
  background: rgba(4, 16, 31, 0.96);
  color: #f8fbff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0,0,0,0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}

body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]:hover::before,
body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

body.mode-create-show #topMenu .menu-group:last-child .input-field > div {
  justify-content: center;
}

body.mode-create-show #importAudioBtn.toolbar-icon-button::after {
  content: "⌄";
  position: absolute;
  right: -21px;
  top: 50%;
  transform: translateY(-51%);
  margin: 0;
  color: rgba(245,250,255,0.88);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 1450px) {
  body.mode-create-show #topMenu {
    gap: 10px;
    padding-left: 9px;
    padding-right: 9px;
  }
  body.mode-create-show #topMenu .menu-group:first-child {
    gap: 12px;
  }
  body.mode-create-show #topMenu .input-field {
    width: 190px;
    min-width: 175px;
  }
  body.mode-create-show #topMenu {
    --sm-icon-size: 40px;
  }
  body.mode-create-show #topMenu .toolbar-icon-glyph {
    font-size: 24px;
  }
}

/* Final icon-only toolbar polish + tooltip clipping fixes */
body.mode-create-show #topMenu {
  overflow: visible !important;
  position: relative;
  z-index: 500;
}
body.mode-create-show #topMenu .menu-group,
body.mode-create-show #topMenu .input-field,
body.mode-create-show #topMenu .toolbar-icon-button.button {
  overflow: visible !important;
}
body.mode-create-show #topMenu .toolbar-icon-glyph,
#sequencerWindow .sequencer-icon-button .toolbar-icon-glyph,
#sequencerWindow .toggle-edit-button .toolbar-icon-glyph {
  width: 23px;
  height: 23px;
  font-size: 0 !important;
}
body.mode-create-show #topMenu .toolbar-icon-glyph svg,
#sequencerWindow .sequencer-icon-button .toolbar-icon-glyph svg,
#sequencerWindow .toggle-edit-button .toolbar-icon-glyph svg {
  width: 23px;
  height: 23px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body.mode-create-show #topMenu .toolbar-save { --sm-accent: #a990ff; }
body.mode-create-show #topMenu .toolbar-reload { --sm-accent: #85d6ff; }
body.mode-create-show #topMenu .toolbar-export { --sm-accent: #f39dff; }
body.mode-create-show #topMenu .toolbar-fixtures { --sm-accent: #ff8fd2; }
body.mode-create-show #topMenu .toolbar-display { --sm-accent: #7fd2ff; }
body.mode-create-show #topMenu .toolbar-presets { --sm-accent: #ffd17c; }
body.mode-create-show #topMenu .toolbar-video { --sm-accent: #89f0c0; }
body.mode-create-show #topMenu .toolbar-menu-toggle { --sm-accent: #91caff; }
body.mode-create-show #topMenu .toolbar-audio { --sm-accent: #c8ffdc; }
body.mode-create-show #topMenu .toolbar-icon-button.button {
  color: var(--sm-accent, #9ed3ff);
}
body.mode-create-show #topMenu .toolbar-icon-button.button .toolbar-icon-glyph {
  color: var(--sm-accent, #9ed3ff) !important;
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--sm-accent, #9ed3ff) 42%, transparent));
}
body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]::before {
  top: calc(100% + 6px) !important;
  bottom: auto !important;
  z-index: 99999 !important;
  overflow: visible !important;
}
body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]::after,
#sequencerWindow .sequencer-icon-button[data-tooltip]::after,
#sequencerWindow .toggle-edit-button[data-tooltip]::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
}
body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]::after {
  top: calc(100% - 2px);
  border-bottom-color: rgba(4, 16, 31, 0.96);
  z-index: 99998;
}
body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]:hover::after,
body.mode-create-show #topMenu .toolbar-icon-button[data-tooltip]:focus-visible::after,
#sequencerWindow .sequencer-icon-button[data-tooltip]:hover::after,
#sequencerWindow .sequencer-icon-button[data-tooltip]:focus-visible::after,
#sequencerWindow .toggle-edit-button[data-tooltip]:hover::after,
#sequencerWindow .toggle-edit-button[data-tooltip]:focus-visible::after {
  opacity: 1;
}
/* Fenêtre vidéos revient au style normal, seul l'audio reste vert. */
body.mode-create-show #openVideoSyncBtn.toolbar-icon-button {
  border-color: rgba(112, 169, 238, 0.24) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(105, 172, 255, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(23, 54, 95, 0.70), rgba(12, 33, 63, 0.78)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.22),
    0 9px 20px rgba(0,0,0,0.18) !important;
}
body.mode-create-show #openVideoSyncBtn.toolbar-icon-button:hover {
  border-color: rgba(134, 197, 255, 0.56) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(125, 194, 255, 0.20), transparent 50%),
    linear-gradient(180deg, rgba(30, 70, 120, 0.82), rgba(14, 38, 72, 0.86)) !important;
}
body.mode-create-show #openVideoSyncBtn .toolbar-icon-glyph {
  color: var(--sm-accent, #89f0c0) !important;
  filter: drop-shadow(0 0 7px rgba(137, 240, 192, 0.34)) !important;
}

/* Icon-only sequencer toolbar */
#sequencerWindow .window-content > .menu-group {
  position: relative;
  z-index: 60;
  overflow: visible;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 0 6px 0;
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(9, 29, 55, 0.72), rgba(5, 18, 34, 0.55));
  border: 1px solid rgba(122, 169, 232, 0.11);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
#sequencerWindow .sequencer-icon-button,
#sequencerWindow .toggle-edit-button.sequencer-icon-button {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(112, 169, 238, 0.22);
  background:
    radial-gradient(circle at 50% 20%, rgba(105, 172, 255, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(25, 54, 94, 0.78), rgba(13, 33, 62, 0.82));
  color: var(--seq-accent, #9ed3ff);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 7px 15px rgba(0,0,0,0.17);
  transition: transform .12s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
  overflow: visible;
}
#sequencerWindow .sequencer-icon-button:hover,
#sequencerWindow .toggle-edit-button.sequencer-icon-button:hover,
#sequencerWindow .sequencer-icon-button:focus-visible,
#sequencerWindow .toggle-edit-button.sequencer-icon-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(134, 197, 255, 0.50);
  background:
    radial-gradient(circle at 50% 20%, rgba(125, 194, 255, 0.18), transparent 50%),
    linear-gradient(180deg, rgba(32, 70, 118, 0.86), rgba(15, 39, 72, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.13),
    0 9px 20px rgba(0,0,0,0.23);
}
#sequencerWindow .sequencer-icon-button .toolbar-label,
#sequencerWindow .toggle-edit-button .toolbar-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
}
#sequencerWindow .sequencer-add { --seq-accent: #8df0c4; }
#sequencerWindow .sequencer-play { --seq-accent: #82e6a8; }
#sequencerWindow .sequencer-pause { --seq-accent: #8fd2ff; }
#sequencerWindow .sequencer-live { --seq-accent: #ff6f7d; }
#sequencerWindow .sequencer-blackout { --seq-accent: #d4ddf5; }
#sequencerWindow .sequencer-duplicate { --seq-accent: #c6a3ff; }
#sequencerWindow .sequencer-edit { --seq-accent: #ffd17c; }
#sequencerWindow .sequencer-icon-button .toolbar-icon-glyph,
#sequencerWindow .toggle-edit-button .toolbar-icon-glyph {
  color: var(--seq-accent, #9ed3ff) !important;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--seq-accent, #9ed3ff) 42%, transparent));
}
#sequencerWindow #liveButton.live {
  border-color: rgba(255, 100, 115, 0.58) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 116, 131, 0.28), transparent 52%),
    linear-gradient(180deg, rgba(173, 47, 62, 0.96), rgba(112, 25, 36, 0.96)) !important;
}
#sequencerWindow .toggle-edit-button.active {
  border-color: rgba(255, 209, 124, 0.60) !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 209, 124, 0.25), transparent 50%),
    linear-gradient(180deg, rgba(136, 92, 28, 0.92), rgba(84, 55, 18, 0.92)) !important;
}
#sequencerWindow .sequencer-icon-button[data-tooltip]::before,
#sequencerWindow .toggle-edit-button[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-3px);
  z-index: 9999;
  width: max-content;
  max-width: 220px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(141, 188, 255, 0.28);
  background: rgba(4, 16, 31, 0.97);
  color: #f8fbff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0,0,0,0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
#sequencerWindow .sequencer-icon-button[data-tooltip]::after,
#sequencerWindow .toggle-edit-button[data-tooltip]::after {
  top: calc(100% - 1px);
  border-bottom-color: rgba(4, 16, 31, 0.97);
}
#sequencerWindow .sequencer-icon-button[data-tooltip]:hover::before,
#sequencerWindow .sequencer-icon-button[data-tooltip]:focus-visible::before,
#sequencerWindow .toggle-edit-button[data-tooltip]:hover::before,
#sequencerWindow .toggle-edit-button[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Sequencer toolbar refinements: fused play/pause, icon-only live/edit, fixed tooltips */
#sequencerWindow .sequencer-playpause { --seq-accent: #86efac; }
#sequencerWindow .sequencer-playpause.playing { --seq-accent: #8fd2ff; }
#sequencerWindow .sequencer-live { --seq-accent: #ff7a86; }
#sequencerWindow #liveButton.live {
  --seq-accent: #ff3347;
  color: #ffd7dc !important;
  border-color: rgba(255, 54, 72, 0.78) !important;
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 60, 82, 0.42), transparent 52%),
    linear-gradient(180deg, rgba(206, 40, 57, 0.98), rgba(120, 16, 31, 0.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    0 8px 20px rgba(255, 34, 58, 0.28),
    0 0 0 3px rgba(255, 54, 72, 0.10) !important;
}
#sequencerWindow #liveButton.live .toolbar-icon-glyph {
  color: #ffe1e5 !important;
  filter: drop-shadow(0 0 8px rgba(255, 72, 91, 0.70));
}
#sequencerWindow .toggle-edit-button.sequencer-icon-button {
  --seq-accent: #ffd17c;
}
#sequencerWindow .toggle-edit-button.active {
  --seq-accent: #ffe08f;
}
#sequencerWindow .sequencer-icon-button .toolbar-label,
#sequencerWindow .toggle-edit-button .toolbar-label {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
#sequencerWindow .window-content,
#sequencerWindow .window-content > .menu-group {
  overflow: visible !important;
}
#sequencerWindow .sequencer-icon-button[data-tooltip]::before,
#sequencerWindow .toggle-edit-button[data-tooltip]::before {
  z-index: 99999 !important;
}
/* Le premier bouton était trop proche du bord gauche : son tooltip est aligné à gauche pour ne plus être coupé. */
#sequencerWindow .sequencer-add[data-tooltip]::before {
  left: 0 !important;
  transform: translateY(-3px) !important;
}
#sequencerWindow .sequencer-add[data-tooltip]:hover::before,
#sequencerWindow .sequencer-add[data-tooltip]:focus-visible::before {
  transform: translateY(0) !important;
}
#sequencerWindow .sequencer-add[data-tooltip]::after {
  left: 19px !important;
  transform: translateX(-50%) !important;
}
/* Si un tooltip est en bout droit, il reste dans la fenêtre. */
#sequencerWindow .sequencer-edit[data-tooltip]::before {
  left: auto !important;
  right: 0 !important;
  transform: translateY(-3px) !important;
}
#sequencerWindow .sequencer-edit[data-tooltip]:hover::before,
#sequencerWindow .sequencer-edit[data-tooltip]:focus-visible::before {
  transform: translateY(0) !important;
}
#sequencerWindow .sequencer-edit[data-tooltip]::after {
  left: 19px !important;
}

/* Event properties action icons: mêmes codes visuels que la toolbar, sans emoji */
#eventPropertiesWindow .event-properties-footer {
  gap: 10px;
  padding: 9px 10px;
  background: linear-gradient(180deg, rgba(9, 29, 55, 0.76), rgba(5, 18, 34, 0.58));
  border-top: 1px solid rgba(122, 169, 232, 0.14);
  overflow: visible;
  position: relative;
  z-index: 40;
}
#eventPropertiesWindow .event-action-icon {
  --event-accent: #9ed3ff;
  position: relative;
  width: 38px !important;
  height: 36px !important;
  min-width: 38px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid rgba(112, 169, 238, 0.22);
  background:
    radial-gradient(circle at 50% 20%, rgba(105, 172, 255, 0.12), transparent 48%),
    linear-gradient(180deg, rgba(25, 54, 94, 0.78), rgba(13, 33, 62, 0.82));
  color: var(--event-accent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 7px 15px rgba(0,0,0,0.17);
  transition: transform .12s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
  overflow: visible;
}
#eventPropertiesWindow .event-save { --event-accent: #a990ff; }
#eventPropertiesWindow .event-delete { --event-accent: #ff9aa7; }
#eventPropertiesWindow .event-preview { --event-accent: #d8c7ff; }
#eventPropertiesWindow .event-action-icon:hover,
#eventPropertiesWindow .event-action-icon:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--event-accent) 55%, rgba(112,169,238,.22));
  background:
    radial-gradient(circle at 50% 20%, color-mix(in srgb, var(--event-accent) 18%, transparent), transparent 50%),
    linear-gradient(180deg, rgba(32, 70, 118, 0.86), rgba(15, 39, 72, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.13),
    0 9px 20px rgba(0,0,0,0.23);
}
#eventPropertiesWindow .event-action-icon .toolbar-icon-glyph {
  width: 22px;
  height: 22px;
  color: var(--event-accent) !important;
  font-size: 0 !important;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--event-accent) 42%, transparent));
}
#eventPropertiesWindow .event-action-icon .toolbar-icon-glyph svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#eventPropertiesWindow .event-action-icon[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(3px);
  z-index: 99999;
  width: max-content;
  max-width: 190px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(141, 188, 255, 0.28);
  background: rgba(4, 16, 31, 0.98);
  color: #f8fbff;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0,0,0,0.36);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease, transform .14s ease;
}
#eventPropertiesWindow .event-action-icon[data-tooltip]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1px);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(4, 16, 31, 0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
  z-index: 99998;
}
#eventPropertiesWindow .event-action-icon[data-tooltip]:hover::before,
#eventPropertiesWindow .event-action-icon[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#eventPropertiesWindow .event-action-icon[data-tooltip]:hover::after,
#eventPropertiesWindow .event-action-icon[data-tooltip]:focus-visible::after {
  opacity: 1;
}

/* Groupes timeline : vrais groupes parents/sous-groupes sans décalage horizontal */
.group-header.group-main-header {
  background: linear-gradient(90deg, var(--group-bg-color), #14324d);
  border-top: 1px solid rgba(255,255,255,0.18);
  border-bottom: 2px solid rgba(255,255,255,0.18);
}

.group-header.group-sub-header {
  background: linear-gradient(90deg, #1b3b52, #24506a);
  border-top: 1px solid rgba(255,255,255,0.09);
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.group-header .group-path-prefix {
  display: none !important;
}

.group-header.group-main-header .group-name {
  font-weight: 800;
  margin-left: 18px;
}

.group-header.group-sub-header .group-name {
  font-weight: 650;
  margin-left: 34px;
}

.group-content.group-main-content,
.group-content.group-sub-content {
  border-left: 0;
  margin-left: 0;
}

/* V6 - barre supérieure allégée + paramètres structurés */
body.mode-create-show #topMenu .toolbar-home { --sm-accent: #8fffd2; }
body.mode-create-show #topMenu .toolbar-tools { --sm-accent: #ffcf8f; }
body.mode-create-show #topMenu .toolbar-display { --sm-accent: #b7a4ff; }
body.mode-create-show #topMenu .toolbar-home .toolbar-icon-glyph { color: #8fffd2; }
body.mode-create-show #topMenu .toolbar-tools .toolbar-icon-glyph { color: #ffcf8f; }
body.mode-create-show #topMenu .toolbar-display .toolbar-icon-glyph { color: #b7a4ff; }

.toolbar-dropdown-wrap {
  position: relative;
  display: inline-flex;
}

.toolbar-tools-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 190px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(7, 18, 34, .98);
  box-shadow: 0 18px 45px rgba(0,0,0,.35);
  z-index: 1000;
}

.toolbar-tools-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  color: var(--text-color);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.toolbar-tools-menu button:hover,
.toolbar-tools-menu button:focus-visible {
  background: rgba(255,255,255,.10);
  outline: none;
}

.toolbar-tools-menu .toolbar-icon-glyph {
  width: 22px;
  height: 22px;
  font-size: 22px;
}

.settings-modal-content {
  max-width: 980px;
  width: min(980px, calc(100vw - 36px));
}

.settings-header h3 {
  margin-bottom: 4px;
}

.settings-search {
  width: 100%;
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: var(--text-color);
  font-size: 15px;
}

.settings-search:focus {
  outline: 2px solid rgba(127,210,255,.5);
  border-color: rgba(127,210,255,.75);
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  min-height: 420px;
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  background: rgba(0,0,0,.14);
}

.settings-tab {
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  color: rgba(255,255,255,.82);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.settings-tab:hover,
.settings-tab.active {
  color: #fff;
  background: rgba(127,210,255,.18);
}

.settings-panel-wrap {
  min-width: 0;
  position: relative;
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-no-result {
  padding: 30px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 16px;
  color: rgba(255,255,255,.75);
  text-align: center;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shortcut-grid label {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(255,255,255,.055);
  font-weight: 700;
}

.shortcut-grid input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: var(--text-color);
}

.inline-actions {
  justify-content: flex-start !important;
  margin-top: 12px !important;
}

.settings-actions {
  margin-top: 16px;
}

@media (max-width: 760px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-sidebar {
    flex-direction: row;
    overflow-x: auto;
  }
  .shortcut-grid {
    grid-template-columns: 1fr;
  }
}

/* V7 - accueil modal + ordre boutons vidéo/paramètres/audio */
body.mode-create-show #topMenu .toolbar-middle-actions {
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

body.mode-create-show #topMenu .audio-toolbar-field {
  margin-left: 2px;
}

.editor-home-modal-content {
  max-width: 540px;
}

.editor-home-modal-content h3 {
  margin-top: 0;
}

.editor-home-actions {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* V8 - vidéo + paramètres dans la même zone que Outils, alignés à droite hors Audio */
body.mode-create-show #topMenu .toolbar-tools-side-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
}

body.mode-create-show #topMenu .toolbar-audio-actions {
  flex: 0 0 auto;
}

body.mode-create-show #topMenu .toolbar-audio-actions .audio-toolbar-field {
  margin-left: 0;
}

body.mode-create-show #topMenu .toolbar-middle-actions {
  justify-content: initial;
}

@media (max-width: 1280px) {
  body.mode-create-show #topMenu .toolbar-tools-side-actions {
    gap: 8px;
    padding-left: 8px;
  }
}

/* V9 - nom du show dans paramètres + modal de création */
.create-show-name-modal-content {
  max-width: 520px;
}

.create-show-name-modal-content h3 {
  margin-top: 0;
}

.create-show-name-field {
  margin-top: 14px;
}

.create-show-name-field input,
.display-settings-field input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.18);
  color: var(--text-color);
  font-size: 15px;
}

.create-show-name-field input:focus,
.display-settings-field input[type="text"]:focus {
  outline: 2px solid rgba(127,210,255,.5);
  border-color: rgba(127,210,255,.75);
}

.create-show-name-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

/* V10 - séparateur visuel pour le bouton Accueil */
body.mode-create-show #topMenu .toolbar-home-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  margin: -1px 8px -1px 0;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(15, 43, 78, 0.68), rgba(6, 22, 41, 0.48));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.mode-create-show #topMenu .toolbar-home-actions::after {
  content: "";
  width: 1px;
  height: 44px;
  margin-left: 12px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22), transparent);
}

body.mode-create-show #topMenu .toolbar-home-actions .toolbar-home {
  margin: 0;
}

@media (max-width: 1280px) {
  body.mode-create-show #topMenu .toolbar-home-actions {
    padding: 7px 9px;
    margin-right: 5px;
  }
  body.mode-create-show #topMenu .toolbar-home-actions::after {
    margin-left: 9px;
  }
}


/* Stabilisation typographique : les éléments de timeline restent compacts. */
.event span {
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(9px, .65vw, 10px);
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fixture-badge { font-size: clamp(10px, .72vw, 12px); }
.timeline-marker-flag {
  font-size: clamp(9px, .68vw, 11px);
  line-height: 1.25;
}
