@font-face {
    font-family: 'Fredoka';
    src: url('../fonts/Fredoka-Regular.ttf') format('truetype');
    font-style: normal;
    font-weight: 300;
}

/* Variante Bold pour utiliser Fredoka-Bold quand font-weight: bold (700) est déclaré */
@font-face {
  font-family: 'Fredoka';
  src: url('../fonts/Fredoka-Medium.ttf') format('truetype');
  font-style: normal;
  font-weight: 700; /* correspond à "bold" */
  font-display: swap;
}

html,
body {
    margin: 0;
    /* overflow: hidden; */
    scrollbar-width: thin;
    height: 100vh;    
    background-color: rgb(0, 0, 0);
    color: #aaa;
    font-family: 'Fredoka', sans-serif;
    font-weight: 300;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

#layout {
  display: flex;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

#conteneur {
  width: 240px;
  height: 100%;
  background: #000;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

#main {
  flex-grow: 1;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
}

#rightPanel {
  width: 40px;
  height: 100%;
  background: #000;
  flex-shrink: 0;               /* reste fixe, n’occupe pas l’espace restant */
  display: flex;
  flex-direction: column;      /* structure en colonnes comme #conteneur */
  justify-content: flex-start;
  align-items: center;
  border-left: 1px solid rgb(50, 50, 50);
  box-sizing: border-box;
  z-index: 110;
}

#xp { 
  width: 0px; /* ← masqué par défaut */
  overflow: hidden;
  flex-shrink: 0;
  height: 100%;
  background: #000;
  border-left: 1px solid rgb(50, 50, 50);
  z-index: 120;
}

/* https://developer.mozilla.org/en-US/docs/Web/Tutorials#css_tutorials */


#canvasContainer {
  flex: 1 1 auto;   /* prend tout l’espace restant */
  min-height: 0;    /* évite le débordement */
  position: relative; /* permet de positionner tes <canvas> en absolute à l’intérieur */
  display: flex;
  align-items: center;
  justify-content: center; /* → centre le contenu si tu veux que les canvas soient centrés. */
  width: 100%;
  height: 100%;
  overflow: hidden;
  /* ajout */
  box-sizing: border-box;
  padding-bottom: 1px; /* ou 23px si tu veux tenir compte de toute la hauteur de la barre */
}

#canvas {
    background-color: rgb(0, 0, 0);
    display: block;
    /* Utiliser le centrage flex du parent #canvasContainer pour éviter les translations subpixel */
    position: relative;   /* ou 'static' : canvas participe au flow flex */
    margin: auto;         /* centre horizontalement/verticalement via flexbox */
    transform: none;
    max-width: 100%;
    max-height: 100%;
    width: auto;    /* taille contrôlée depuis JS pour respecter le ratio */
    height: auto;   /* taille contrôlée depuis JS pour respecter le ratio */
    box-sizing: border-box;
}

#canvas2d {
    background-color: rgb(0, 0, 0);
    display: none;
    /* resize: both; */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* calc(100vh - 44px - 20px -2px); */
}

/* ===== Barre de progression flottante centrée au-dessus du canvas ===== */
.is-hidden { display: none !important; }

#centerProgress {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10; /* au-dessus des canvas */
  width: 48%;
  max-width: 640px;
  min-width: 240px;
  height: 16px;
  background-color: #444; /* fond gris */
  border: 1px solid #fff; /* liseret blanc */
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  overflow: hidden;
}

#centerProgressFill {
  height: 100%;
  width: 0%;
  background-color: #c51414; /* rouge progression */
  transition: width 0.12s ease;
}

/* ===== Toast encodage ===== */
.toast {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12; /* au-dessus de l'overlay */
  background: rgba(20, 20, 20, 0.95);
  color: #fff;
  border: 1px solid #fff;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  padding: 10px 14px;
  font-size: 14px;
  white-space: nowrap;
}

.progress-container {
  width: 100%;
  padding: 1px;
  padding-bottom: 0;
  background-color: transparent;
  box-sizing: border-box;
  border-top: 1px solid rgb(50, 50, 50);
  display: flex;
  align-items: center; /* ← centre verticalement */
  height: 23px; /* hauteur totale incluant padding */
  position: relative;
}

progress {
  width: 100%;
  top: -1px;
  height: 20px;
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
}

progress::-webkit-progress-bar {
  background-color: transparent;
  /* border-radius: 6px; */
}

progress::-webkit-progress-value {
  background-color: #45454580;
  transition: width 0.1s ease; 
}

progress::-moz-progress-bar {
  background-color: #6b695c60;
}

#progressBar {
  pointer-events: auto;
  z-index: 99;
  position: relative;
}

#frameIndicator {
  position: absolute;
  opacity: 0;
  transition: opacity 0.5s ease;
  top: 3px;
  width: 14px;
  height: 14px;
  background-color: rgba(221, 213, 213, 0.91);
  border-radius: 50%; /* ← cercle parfait */
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6); /* léger glow */
  /* background-image: url('../images/indicator.png');
  background-size: contain;
  background-repeat: no-repeat; */
  pointer-events: none; /* ← rend l’élément non cliquable */
  z-index: 100;
}

#progressTicks {
  position: absolute;
  top: 1px; /* juste sous la barre */
  left: 4px;
  width: calc(100% - 8px); /* ← largeur du conteneur, pas du viewport */
  height: 18px;
  display: flex;
  align-items: center; /* ← centrage vertical des ticks */
  justify-content: space-between;
  pointer-events: none;
  z-index: 98;
}

#progressTicks .tick {
  flex: 1 1 auto;
  position: relative;
}

#progressTicks .tick::before {
  content: '';
  display: block;
  width: 1px;
  height: 6px; /* hauteur par défaut */
  background-color: #888;
  margin: 0 auto;
}

#progressTicks .tick.major::before {
  height: 14px; /* hauteur max pour les repères majeurs */
  width: 2px;
}


#iconContainer {
  position: absolute;
  top: -48px; /* juste en dessous du parent */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 0px;
  padding: 0px 12px;
  margin: 0px auto;
  background-color: rgba(0, 0, 0, 0.6); /* fond semi-transparent */
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border: 1px solid rgb(50, 50, 50);
  border-bottom: 0px;
  visibility: visible;
  opacity: 1;
  transition: opacity 1s ease, visibility 1s ease;
  width: fit-content;
  z-index: 6;
}

#iconContainer.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.icon-btn {
  background: none;
  border: none;
  padding: 10px 12px 8px;
  cursor: pointer;
}

 .icon-btn img { /* svg */
  width: 24px;
  height: 24px;
  opacity: 0.8;
  /* fill: white; */
}

.icon-btn:focus {
  outline: none;
}

#iconTriggerZone {
  position: absolute;
  top: -48px; /* ajuster selon la position de #iconContainer */
  left: 50%;
  transform: translateX(-50%);
  width: 312px;
  height: 47px;
  background-color: transparent;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  z-index: 5;
}

#iconTriggerZone.hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}



/* Scale canvas with resize attribute to full size */
/* canvas[resize] {
    height: calc(100vh - 46px);
    width: calc(100vh - 46px);
} */


#control {
  margin: 0;
  padding: 0px;
  width: 240px;
  height: 100%;
  background-color: rgb(9, 9, 9);
  font-size: 1em;
  border-right: 1px solid rgb(50, 50, 50);
  z-index: 110;
  display: block;
  flex-grow: 1;
  align-self: stretch;
  /* scroll enabled but scrollbar hidden */
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge legacy */
}
#control::-webkit-scrollbar {
  width: 0;
  height: 0;                  /* Chrome/Safari */
}

#headerControl {
  position: absolute;
  margin: 0;
  width: 240px;
  height: 115px;
  background-color: black;
  /* border-bottom: 1px solid rgb(50, 50, 50); */
  font-size: 1em;
  display: block;
  z-index: 111;
}

#illusion {
  color: #cd1313;
  font-size: 0.85em;
  margin-top: -18px;
  margin-left: -10px;
} 

.hex-section {
    margin-top: 20px;
    padding: 0px;
    padding-bottom: 17px;
    background: #161616;
    border-top: 1px solid rgb(50, 50, 50);
    border-bottom: 1px solid rgb(50, 50, 50);
}

/* Quand repliée, supprimer l’espace sous le header */
.hex-section.is-collapsed {
  padding-bottom: 0;
  border-bottom: 0;
}

#help {
  margin-top: 100px;
  margin-left: 15px;
  margin-right: 10px;
  padding-top: 15px;
  color: white;
  text-align: center;
}

.slidecontainer {
    display: block;
    margin-top: -3px;
}

#logo {
    margin-top: 4px;
    width: 200px;
}

.sliders {
    margin-left: 15px;
    width: 150px;
    height: 13px;
    appearance: none;
    background: #111;
    outline: none;
    border-radius: 13px;
    overflow: hidden;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 1);
}

.sliders::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #303030;
    border: 4px solid #bdbdbd;
    box-shadow: -407px 0 0 400px #4d4f4d;
}

.display {
    background-color: #09090900;
    color: white;
    width: 40px;
    border: none;
    margin-left: 5px;
    position: relative;
    top: -2px;
}


.textdisplay {
    margin-left: 15px;
    font-size: 1.1em;
    color: #c6c6c6;
}

.check {
    margin-left: 18px;
}

button {
    color: #ffffff;
    background-color: #000000;
    border-radius: 1px;
    padding-top: 4 em;
}

.dec {
    margin: 15px;
    margin-left: 5px;
    font-size: 0.9em;
}

.center {
    text-align: center;
    margin: 10px auto;
}

/* ======================================================================================= */

/* Table d'options (occuper toute la largeur, alignée à gauche) */
.option-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* garantit l'occupation uniforme de l'espace */
  margin: 0; /* pas de marges latérales inutiles */
}
.option-table td,
.option-table th {
  text-align: left;
  vertical-align: middle;
  padding: 4px 0; /* léger padding vertical */
}
/* 2 colonnes équilibrées */
.option-table td { width: 50%; }

#colorAdjustmentsHeader {
  margin-top: 0px;
  padding: 3px 15px; /* zone cliquable un peu plus grande */
  background-color: #121212;
  border-bottom: 1px solid rgb(50, 50, 50);
  text-align: center;
  position: relative;
  user-select: none;
}

#colorAdjustmentsHeader:hover {
  background-color: #a61a1a;
}

/* Header Level: même style que Color Adjustments */
#levelAdjustmentsHeader {
  margin-top: 0px;
  padding: 3px 15px; /* zone cliquable un peu plus grande */
  background-color: #121212;
  border-bottom: 1px solid rgb(50, 50, 50);
  text-align: center;
  position: relative;
  user-select: none;
}

#levelAdjustmentsHeader:hover {
  background-color: #a61a1a;
}

/* Header Brightness/Contrast: même style que Color/Level */
#exposureAdjustmentsHeader {
  margin-top: 0px;
  padding: 3px 15px; /* zone cliquable un peu plus grande */
  background-color: #121212;
  border-bottom: 1px solid rgb(50, 50, 50);
  text-align: center;
  position: relative;
  user-select: none;
}

#exposureAdjustmentsHeader:hover {
  background-color: #a61a1a;
}

/* ===== Slider personnalisé (style proche de la progressbar) ===== */
.custom-slider {
  margin-left: 15px;
  width: 100%;
  height: 20px;
  position: relative;
  background-color: #000; /* fond noir du slider */
  border: 1px solid rgb(50, 50, 50);
  border-radius: 6px;
  box-sizing: border-box;
  cursor: pointer;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
}

.custom-slider-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.custom-slider-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background-color: #454545; /* même teinte que la valeur de la progressbar */
  border-radius: 6px; /* borde sur toute la hauteur sans gap */
  transition: width 0.1s ease;
  z-index: 0;
}

.custom-slider-label {
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 0.8em;
  color: #fff;
  pointer-events: none;
  z-index: 1;
}

.custom-slider-right {
  position: absolute;
  right: 6px;
  top: 0;
  bottom: 0;
  height: 100%;
  transform: none;
  display: flex;
  align-items: center;
  z-index: 2;
  pointer-events: none; /* ne bloque pas le drag du slider */
}

.custom-slider-btn {
  background: #000; /* fond noir des boutons */
  border: 1px solid rgb(70,70,70);
  color: #c6c6c6;
  width: 18px;
  height: 18px;
  line-height: 16px;
  border-radius: 4px;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
}
.custom-slider-btn:hover { opacity: 0.9; }

.custom-slider-ctrls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  margin-right: 15px; /* marge droite égale à la marge gauche du slider */
}

.custom-slider-value {
  background-color: rgba(9,9,9,0.6);
  color: #fff;
  width: 44px;
  height: 18px;
  border: 1px solid rgb(70,70,70);
  border-radius: 4px;
  text-align: center;
  font-size: 12px;
}

/* Lecture seule du chiffre (non éditable) */
.custom-slider-readout {
  color: #fff;
  min-width: 38px;
  height: 18px;
  line-height: 18px;
  text-align: right;
  font-size: 12px;
  padding: 0 4px;
  background-color: transparent;
  border: none;
  pointer-events: none; /* purement informatif */
}

/* Empêcher la sélection de texte pendant le drag sur le slider et contrôles */
.custom-slider, .custom-slider *,
.custom-slider-ctrls, .custom-slider-ctrls * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent; /* désactive le surlignage tactile iOS/Android */
}

/* ======================================================================================= */


#outils {
  margin: 0;
  width: 40px;
  height: 100%;
  background-color: rgb(9, 9, 9);
  font-size: 0.95em;
  border-left: 1px solid rgb(50, 50, 50);
}

.zoom {
    margin: 10px;
    width: 20px;
    opacity: 80%;
}

/* remplacer le code du placeholder par : */
.zoom {
  margin: 10px;
  width: 20px;
  opacity: 0.8;            /* 0..1, pas 80% */
  transition: opacity 0.12s ease;
}

.zoom:hover {
  opacity: 1;
  cursor: pointer;
}

#fxMenu {
    margin: 10px;
    width: 20px;
    opacity: 0.8;
    transition: cubic-bezier(0.075, 0.82, 0.165, 1) 0.12s;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #ccc;
    font-family: 'Fredoka', sans-serif;
    font-size: 16px;
}
#fxMenu:hover {
    opacity: 1;
}


.tooltip {
  background-color: #33333333;
  color: #fff;
  padding: 30px 50px;
  border: 4px;
  font-size: 20px;
  z-index: 1000;
}