body {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  font-family: sans-serif;
}

video {
  display: none;
}

#canvas {
  width: 600px;
  height: auto;
  border-radius: 15px;
  cursor: grab;
  background: black;
  box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
}

#canvas:active {
  cursor: grabbing;
}

.controls {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#startbutton {
  background: turquoise;
  box-shadow: 3px 4px 8px 2px rgba(128, 128, 128, 0.504);
  transition: 0.5s;
}

#downloadBtn {
  background: #b33dcd;
  box-shadow: 3px 4px 8px 2px rgba(128, 128, 128, 0.504);
  transition: 0.5s;
}

#startbutton:hover,
#downloadBtn:hover {
  transform: scale(1.1);
}

.choix-lunettes {
  width: 200px;
  height: auto;
  cursor: pointer;
  border-radius: 8px;
  transition: 0.3s;
}

.choix-lunettes:hover {
  transform: scale(1.15);
}

.container-global {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  padding: 40px;
  box-sizing: border-box;
}

.galerie-stickers {
  display: flex;
  flex-direction: column; 
  gap: 15px;
  flex-shrink: 0;
  max-height: 70vh;  
  overflow-y: auto;    
  padding-right: 10px; 
  padding-bottom: 20px; 
  scrollbar-width: thin;
  scrollbar-color: rgba(128, 128, 128, 0.5) #f0f0f0;
}

.galerie-stickers::-webkit-scrollbar {
  width: 6px;
}
.galerie-stickers::-webkit-scrollbar-thumb {
  background-color: turquoise;
  border-radius: 10px;
}

.galerie-stickers img.choix-lunettes {
  flex-shrink: 0; 
}

.colonne-historique {
  width: 230px;
  flex-shrink: 0;
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 15px;
  padding: 15px;
  height: 80vh;
  overflow-y: auto;
}

.mini-pola {
  background: white;
  padding: 5px 5px 15px 5px;
  margin-bottom: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
  transform: rotate(-3deg);
  transition: 0.3s;
  min-height: 100px;
}

.mini-pola img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.btn-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-pola:hover .btn-delete {
  opacity: 1;
}

.mini-pola {
  position: relative;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.studio-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}


.btn-like {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 10;
}

.btn-like:hover {
  transform: scale(1.3);
}

/* Modale photo - même verre blanc que les pop-up (voir alert.css) */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;

  /* Voile blanc translucide : la page reste visible, mais floutée */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}

.modal-content {
  margin: 5% auto;
  padding: 26px;
  width: 80%;
  max-width: 900px;
  position: relative;
  color: #333;

  /* La plaque de verre blanc */
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(20px) saturate(180%) brightness(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(180%) brightness(1.15);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 24px;
  box-shadow:
    0 8px 32px rgba(31, 38, 135, 0.18),
    0 2px 10px rgba(255, 255, 255, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(255, 255, 255, 0.3);
}

/* Le reflet : une lumière diffuse qui vient du coin haut-gauche */
.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.2) 35%,
    rgba(255, 255, 255, 0) 60%
  );
}

/* Le contenu passe au-dessus du reflet */
.modal-body {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 20px;
}

#modalImg {
  max-width: 60%;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(31, 38, 135, 0.2);
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 12px;
  z-index: 2;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #9a2bb5;
}

.modal-interactions {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.comment-item {
  background: rgba(255, 255, 255, 0.35);
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-left: 3px solid turquoise;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #333;
}

.comment-date {
  display: block;
  margin-bottom: 4px;
  color: #666;
}

.comment-date {
  font-size: 0.75em;
}

#submitComment {
  background: turquoise;
  color: #1a1a1a;
  border: none;
  padding: 10px;
  margin-left: 10px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: bold;
  align-self: flex-end;
  box-shadow: 0 4px 14px rgba(64, 224, 208, 0.45);
  transition: 0.2s;
}

#submitComment:hover { transform: translateY(-1px); }

.navbar {
  top: 0;
  left: 0;
  width: 90%;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1000;
}

.navbar ul {
  display: flex;
  justify-content: start;
  align-items: center;
  align-items: center;
}

.navbar li {
  list-style: none;
  padding: 15px;
}

.navbar a,
.navbar a:visited {
  color: #cf52eb;
  text-decoration: none;
  filter: drop-shadow(4px 4px 2px rgba(0, 0, 0, 0.2));
  font-size: 20px;
  font-weight: bold;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  border: 1px solid #222;
  padding: 12px;
  letter-spacing: 2px;
  transition: 0.5s;
  box-shadow: 2px 3px 5px 0px rgba(128, 128, 128, 0.352);
  display: inline-block;
}

a:hover,
a:visited:hover {
  padding: 16px;
  transform: scale(1.1);
}
.navbar li:first-of-type a {
  color: #cf52eb;
  border: 1px solid #cf52eb;
}
.navbar li:nth-of-type(2) a {
  color: turquoise;
  border: 1px solid turquoise;
}

.navbar button {
  margin-left: 20px;
}

.navbar a.logout-btn,
.navbar button.logout-btn {
  background: transparent;
  border: 1px solid turquoise;
  color: turquoise;
  padding: 10px 30px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
  box-shadow: 2px 2px 15px rgba(64, 224, 208, 0.5);
  text-decoration: none;
  filter: none;
  font-size: 1.1rem;
  letter-spacing: normal;
}

#guest-menu a.logout-btn:first-child {
  border: 1px solid #b33dcd;
  color: #b33dcd;
  box-shadow: 2px 2px 15px #b33dcd70;
  margin-right: 15px;
}

.navbar a.logout-btn:hover,
.navbar button.logout-btn:hover {
  transform: scale(1.1);
  letter-spacing: 0.5px;
  color: turquoise;
}

#guest-menu a.logout-btn:first-child:hover {
  color: #b33dcd;
  border: 1px solid #b33dcd;
}

h1 {
  font-size: 5rem;
  font-weight: bolder;
  background: url(../images/pola.jpg) center/cover;
  background-clip: text;
  background-size: 30% auto;
  filter: drop-shadow(4px 4px 2px rgba(0, 0, 0, 0.2));
  color: transparent;
  text-transform: uppercase;
  animation: moveBackground 32s linear infinite;
  margin: 0px;
}

@keyframes moveBackground {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 100% 50%;
  }
}

header p {
  font-size: 1.5rem;
  line-height: 1.6;
  max-width: 400px;
  text-align: center;
  opacity: 0.8;
  color: turquoise;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.43);
}

.custom-file-upload {
  border: 1px solid #ccc;
  display: inline-block;
  padding: 6px 12px;
  cursor: pointer;
  background-color: #f0f0f0;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  box-shadow: 3px 4px 8px 2px rgba(128, 128, 128, 0.504);
}

.custom-file-upload:hover {
  background-color: turquoise;
}

#resetCamBtn {
  background: #5555552b;
  color: white;
  display: none;
  box-shadow: 3px 4px 8px 2px rgba(128, 128, 128, 0.504);
}
.controls,
.upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
}
#startbutton,
.custom-file-upload,
#resetCamBtn {
  width: 85vw; 
  max-width: 320px;
  height: 48px; 
  margin: 6px 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 8px; 
  border: none;
  box-sizing: border-box;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); 
  transition: transform 0.2s;
}

#startbutton {
  background: turquoise;
  color: #1a1a1a;
}

.custom-file-upload {
  background: #e0e0e0;
  color: #333;
}

#resetCamBtn {
  background: #555;
  color: white;
}

footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 10px 20px;
  box-sizing: border-box;
  z-index: 1000;
  text-align: end;
}

footer p {
  margin: 0;
  font-size: 0.8rem;
  color: #888;
}

footer span {
  color: turquoise;
  font-weight: bold;
}

.size-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    width: 100%;
    max-width: 320px;
}

.size-control label {
    font-size: 0.9rem;
    color: #555;
    font-weight: bold;
}

#stickerSize {
    width: 100%;
    accent-color: turquoise;
    cursor: pointer;
}

#sizeValue {
    font-size: 0.8rem;
    color: turquoise;
    font-weight: bold;
}

/************************ Media Queries *****************************/

@media (max-width: 768px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
  }
  .navbar {
    flex-direction: column;
    padding: 10px;
    height: auto;
    gap: 10px;
  }
  ul {
    padding: 0;
    margin: 10px;
  }

  h1 {
    font-size: 2.5rem; 
    margin-top: 20px;
  }
  header {
    margin: 30px;
  }

  header p {
    font-size: 1rem;
    padding: 0 20px;
    max-width: 100%;
  }

  .btn-delete {
    opacity: 1;
    background: rgba(
      255,
      0,
      0,
      0.259
    ); 
    width: 28px; 
    height: 28px;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .mini-pola {
    overflow: visible;
  }

  .container-global {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding: 10px; 
    box-sizing: border-box; 
    width: 100%;
    align-items: center;
  }

  .studio-wrapper {
    order: 1;
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }

  #video,
  #canvas {
    max-width: 90vw;
    height: auto;
  }

  .galerie-stickers {
    order: 2;
    display: flex;
    flex-direction: row; 
    overflow-x: auto; 
    width: 100%;
    padding: 15px;
    gap: 15px;
    box-sizing: border-box;
    flex-wrap: nowrap;
  }

  .galerie-stickers img {
    width: 120px;
    height: 120px;
    flex-shrink: 0; 
    object-fit: contain;
    background: white;
  }
  .colonne-historique {
    height: 250px;
    order: 3;
    width: 100%;
    padding: 15px;
    border: none;
    background: #fdfdfd;
  }

  #thumbnails-container {
    display: flex;
    flex-direction: row; 
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
  }

  #thumbnails-container img {
    width: 200px;
    height: 200px;
    flex-shrink: 0; 
    object-fit: cover;
    border-radius: 5px;
  }

  .controls button,
  .custom-file-upload {
    width: 80vw;
    margin: 5px 0;
  }

  #startbutton {
    font-size: 1rem;
  }

  .controls,
  .upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  #startbutton,
  .custom-file-upload,
  #resetCamBtn {
    width: 80vw; 
    max-width: 300px; 
    height: 45px; 
    padding: 0; 
    margin: 5px 0; 
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    box-sizing: border-box; 
    border-radius: 5px; 
    cursor: pointer;
  }

  #startbutton,
  #resetCamBtn {
    border: none;
  }

  .upload-container {
    display: flex;
    flex-direction: column; 
    align-items: center; 
    width: 100%; 
    gap: 10px; 
  }

  footer {
    width: 100%;
    padding: 15px;
    background: white; 
    margin-top: auto;
    text-align: center; 
  }
}
/************************ Media Queries MONTAGE *****************************/

@media (max-width: 768px) {
  body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    overflow-y: auto; 
  }

   .navbar {
    flex-direction: column;
    width: 100%;
    padding: 10px 0;
    gap: 10px;
    box-sizing: border-box;
  }

  .navbar .logout-btn {
    padding: 5px 10px; 
    font-size: 0.8rem;
  }

  .navbar ul {
    padding: 0;
    margin: 10px;
  }

  h1 {
    font-size: 2.5rem !important;
    margin-top: 20px;
  }

  header p {
    font-size: 1rem;
    padding: 0 20px;
    max-width: 100%;
  }

  .container-global {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding: 10px; 
    width: 100%;
    align-items: center;
    box-sizing: border-box;
  }

  .studio-wrapper {
    order: 1;
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
  }

  #video,
  #canvas {
    max-width: 90vw;
    height: auto;
  }

  .galerie-stickers {
    order: 2;
    display: flex;
    flex-direction: row; 
    overflow-x: auto; 
    width: 100%;
    padding: 15px;
    gap: 15px;
    box-sizing: border-box;
    flex-wrap: nowrap;
  }

  .galerie-stickers img {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    object-fit: contain;
    background: white;
  }

  .colonne-historique {
    height: auto;
    order: 3;
    width: 100%;
    padding: 15px;
    border: none;
    background: #fdfdfd;
  }

  #thumbnails-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
  }

  #thumbnails-container img {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 5px;
  }

  .controls,
  .upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  #startbutton,
  .custom-file-upload,
  #resetCamBtn {
    width: 85vw;
    max-width: 320px;
    height: 48px;
    margin: 6px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    border-radius: 8px;
    box-sizing: border-box;
    border: none;
  }

  .btn-delete {
    opacity: 1 !important;
    background: rgba(255, 0, 0, 0.384);
    width: 28px;
    height: 28px;
    z-index: 100;
  }

  footer {
    position: relative; 
    width: 100%;
    padding: 15px;
    margin-top: auto;
    text-align: center;
  }
}