/* FULLSCREEN CANVAS */
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;
  z-index: 0;
  touch-action: none;
}

#login-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  background-color: hsla(0, 0%, 86%, 0.179);
  backdrop-filter: blur(8px) !important;
  z-index: 9999 !important;
  /* Très élevé */
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

#login-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

#login-container {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center !important;
  width: 300px !important;
  z-index: 10000 !important;
  /* Plus élevé que l'overlay */
}

h2 {
  color: grey;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

#password-input {
  width: 90%;
  padding: 12px 15px;
  margin: 0.5rem 0 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border 0.3s;
}

#submit-btn {
  width: 100%;
  padding: 12px;
  background: #ab9ff2;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#submit-btn:hover {
  background: grey !important;
}

.error-message {
  color: red !important;
  margin-top: 10px !important;
  display: none !important;
}

/* Style pour SweetAlert */
.swal2-container {
  padding-top: 20px !important;
  align-items: flex-start !important;
  z-index: 10001 !important;
  /* Le plus élevé */
}

/* Masquer l'appli avant connexion */
.app-content {
  display: none;
}

/* Afficher après connexion */
.authenticated .app-content {
  display: block;
}

/* FULLSCREEN CANVAS */
canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;
  z-index: 0;
  touch-action: none;
}

/* NOUVEAU SYSTEME DE TOOLBAR */
.toolbar-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  transition: transform 0.3s ease;
}

.toolbar-handle {
  display: none; /* Caché par défaut sur desktop */
  height: 30px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  text-align: center;
  cursor: pointer;
  padding-top: 8px;
}

.toolbar {
  max-width: 100%;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  scrollbar-width: none; /* Pour Firefox */
}

.toolbar::-webkit-scrollbar {
  display: none; /* Pour Chrome/Safari */
}

/* Style pour mobile */
@media (max-width: 768px) {
  .toolbar-container {
    transform: translateY(calc(100% - 38px)); /* Montre juste la poignée */
  }
  
  .toolbar-container.expanded {
    transform: translateY(0);
  }
  
  .toolbar-handle {
    display: block;
  }
  
  .toolbar {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding: 12px;
    gap: 10px;
  }
  
  .toolbar button {
    font-size: 16px;
    min-width: 40px;
  }
  
  #brushSize {
    bottom: 120px;
    width: 120px;
  }
}

/* BOUTONS et autres styles existants... */
.toolbar button {
  background: none;
  border: none;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  transition: transform 0.2s;
}

.toolbar button:hover {
  color: #9a86fb;
  transform: scale(1.1);
}

/* Animation de la poignée */
.toolbar-handle i {
  transition: transform 0.3s;
}

.toolbar-container.expanded .toolbar-handle i {
  transform: rotate(180deg);
}
.toolbar button:hover {
  color: #9a86fb;
}
/* COLOR PICKER */
#colorPicker {
  border: none;
  background: none;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
}

#brushSize {
  position: absolute;
  bottom: 80px;
  /* au-dessus de la toolbar */
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  display: none;
  z-index: 11;
}