/* Style pour la popup d'avatar */
#avatarPopup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    width: 400px;
    max-width: 90%;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none; /* La popup est cachée par défaut */
  }
  
  #avatarPopup .popup-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  
  #avatarPopup h1 {
    margin-top: 0;
    font-size: 1.5rem;
    text-align: center;
  }
  
  #avatarPopup .close-button {
    cursor: pointer;
    font-size: 24px;
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #777;
  }
  
  #avatarPopup .close-button:hover {
    color: #333;
  }
  
  /* Style pour la boîte de l'avatar */
  #avatarPopup .avatar-box {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  #avatarPopup .avatar-box img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ccc;
  }
  
  /* Style pour la boîte de la caméra */
  #avatarPopup .camera-box {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
  }
  
  #avatarPopup .camera-box video {
    width: 100%;
    max-height: 200px;
    border: 2px solid #ddd;
    border-radius: 10px;
  }
  
  /* Style pour les boutons de la popup */
  #avatarPopup .avatarButtons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
  }
  
  #avatarPopup .avatarButtons button {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    background-color: #333;
    color: white;
    transition: background-color 0.2s;
  }
  
  #avatarPopup #takePhoto {
    background-color: #00aaff;
  }
  
  #avatarPopup #savePhoto {
    background-color: #4CAF50;
  }
  
  #avatarPopup #savePhoto:disabled {
    background-color: #ccc;
    cursor: not-allowed;
  }
  
  #avatarPopup .avatarButtons button:hover:not(:disabled) {
    opacity: 0.9;
  }
  
  #avatarPopup #message {
    text-align: center;
    margin: 10px 0 0;
    color: #555;
    font-size: 14px;
  }
  
  /* Overlay pour assombrir l'arrière-plan */
  .popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
  }
  
  /* Animation d'ouverture */
  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  
  #avatarPopup.active,
  .popup-overlay.active {
    display: block;
    animation: fadeIn 0.3s ease forwards;
  }
  
  /* Styles pour mobile */
  @media screen and (max-width: 768px) {
    #avatarPopup {
      width: 90%;
      padding: 15px;
    }
    
    #avatarPopup .avatarButtons {
      flex-direction: column;
    }
    
    #avatarPopup .avatar-box img {
      width: 120px;
      height: 120px;
    }
    
    #avatarPopup .camera-box video {
      max-height: 180px;
    }
  }