#broadcaster-container {
  position: relative;
  overflow: visible; /* au cas où */
}

/* 📷 Section vidéo cachée par défaut */
#webcam-section {
  position: relative;
  overflow: visible;
  z-index: 1;

  display: none;
  visibility: hidden;
  opacity: 0;
  transition: all 0.3s ease;

  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

#webcam-section.active {
  display: flex;
  visibility: visible;
  opacity: 1;
}

#remoteVideo {
  width: 100%;
  height: auto;
  object-fit: cover;
  background: #000;
  display: block !important;
}

/* 🎥 Styling de la vidéo locale */
#localVideo {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  background-color: black;
  border-radius: 12px;
}

#webcam-status-badge {
  top: 0.5rem;
  right: 0.5rem;
  z-index: 9999;
  padding: 0.25rem 0.5rem;
  color: #ffc107;
  font-weight: 600;
  font-size: 0.85rem;
  /* on s’appuie uniquement sur la classe visible */
  display: none;
  visibility: hidden;
}

#webcam-status-badge.visible {
  display: block !important;
  visibility: visible !important;
}



/* 🎛️ Panneau de contrôle */
#webcam-controls {
  font-size: 0.9rem;
  background: rgba(33, 37, 41, 0.75);
  border-radius: 16px;
  padding: 20px;
  margin-top: 1rem;
  color: #f8f9fa;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

#webcam-controls .form-check-label {
  font-weight: 500;
}

#webcam-controls .btn,
#webcam-controls select {
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 20px;
}

/* 💰 Sélecteur gold */
.gold-fee-selector {
  min-width: 110px;
  border-radius: 20px;
}


/****** CSS OVERLAY WEBCAMS PAYANTE ******/
#video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.7); /* Plus clair */
  color: black;
  font-weight: bold;
  font-size: 18px;
  display: none;
  visibility: hidden;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  z-index: 5;
  backdrop-filter: blur(4px); /* Flou léger */
  border-radius: 10px;
}


#video-overlay.active {
  display: flex;
  visibility: visible;
}

#overlay-message {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 20px;
}

#view-paid-webcam {
  background-color: #ff9800;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#view-paid-webcam:hover {
  background-color: #e68900;
  transform: scale(1.05);
}


.toast-message {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: rgba(220, 53, 69, 0.95); /* Bootstrap red */
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  z-index: 9999;
  font-size: 0.9rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
  animation: fadeInOut 4.5s ease-in-out;
}

.custom-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) scale(0.95);
  background-color: #333;
  color: white;
  padding: 10px 18px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 9999;
  font-size: 14px;
}
.custom-toast.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.custom-toast.success { background-color: #28a745; }
.custom-toast.error { background-color: #dc3545; }
.custom-toast.info { background-color: #007bff; }

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(20px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(20px); }
}

.video-container {
  position: relative;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

/* Keep audio button hidden until necessary */
.enable-audio-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}
.enable-audio-btn:hover {
  background: rgba(0,0,0,0.8);
}

#gold-fee {
  height: calc(1.5em + 0.5rem + 2px); /* même hauteur que btn-sm */
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 50rem; /* arrondi pill comme btn rounded-pill */
}
/***** WEBCAMS LIST CONTAINER *****/
.webcam-list-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

#webcam-list {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;             /* Firefox */
  scrollbar-color: #9d5b07 transparent; /* Firefox */
}

#webcam-list::-webkit-scrollbar {
  width: 6px;
}

#webcam-list::-webkit-scrollbar-track {
  background: transparent;
}

#webcam-list::-webkit-scrollbar-thumb {
  background-color: #9d5b07;
  border-radius: 4px;
}

/***** THUMBNAILS *****/
.webcam-thumb {
  width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease;
  border-radius: 6px;
  overflow: hidden;
}

.webcam-thumb:hover {
  transform: scale(1.03);
}

/***** VIDEO OR IMAGE THUMBNAIL *****/
.webcam-thumb video,
.webcam-thumb img.webcam-preview {
  width: 100%;
  height: 90px;
  object-fit: cover;
  background-color: #000;
  border-radius: 5px;
  display: block;
}

/***** NICKNAME TAG *****/
.broadcaster-nickname {
  margin-top: 5px;
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
}

/***** NO WEBCAMS MESSAGE *****/
.no-webcams-message {
  font-size: 1.2em;
  color: #ccc;
  margin: 30px;
  text-align: center;
}

/**** USERS LIST *******/
.member-list li {
  margin-bottom: 0;
}

.member-list li a {
  text-decoration: none;
  color: #FFB939;
  font-weight: bold;
}

/***** EMOTICONES ******/
#emoji-button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  vertical-align: middle;
}

.emoji-picker {
  z-index: 9999 !important;
  position: absolute !important;
}

/******* CHAT NOTIFICATIONS ******/
#chat-notification {
  background: red;
  color: white;
  border-radius: 50%;
  padding: 1px 6px;
  font-size: 0.75em;
  margin-left: 6px;
  vertical-align: middle;
  display: none;
}

/******* INDEX CHAT MESSAGES ****/
.ban-user-link {
  text-decoration: none;
}

.chat-thumb {
  max-width: 200px !important;
  max-height: 200px !important;
  object-fit: contain;
  border-radius: 6px;
  display: block;
  margin-top: 5px;
}

.chat-banned-message {
  padding: 10px;
  background: #ffcccc;
  color: #a00;
  border-radius: 6px;
  margin: 10px;
  font-weight: bold;
}

.chat-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
}
.chat-toast.success {
  background-color: #28a745;
}
.chat-toast.error {
  background-color: #dc3545;
}
.chat-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/******* CHAT MESSAGES *********/
#chat-box::-webkit-scrollbar {
  width: 6px;
}

#chat-box::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#chat-box::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 10px;
}

#chat-box::-webkit-scrollbar-thumb:hover {
  background: #999;
}

#chat-box {
  scrollbar-width: thin;
  scrollbar-color: #ccc #f1f1f1;
}

#chat-container {
    display: flex;
    flex-direction: column;
    height: 250px; /* You can adjust this */
    border: 1px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    font-family: Arial, sans-serif;
  }
  
  #chat-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
  }

  #chat-box-wrapper {
    position: relative;
    flex: 5;
  }
  
  #chat-box {
    height: 100%;
    overflow-y: auto;
    padding: 5px 60px 10px 10px;
    background: #ffffff;
    border-right: 1px solid #ddd;
    padding-bottom: 10px;
  }
  
  #users-box {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
    padding: 4px 10px;
  }
  
  #users-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }
  
  .user-owner {
    font-weight: bold;
    color: #880029;
}

  #input-section {
    display: flex;
    border-top: 1px solid #ccc;
    padding: 10px;
    background: #f9f9f9;
  }
  
  #message-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
  }
  
  #send-button {
    margin-left: 10px;
    padding: 10px 20px;
    background: #880029;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  #send-button:hover {
    background: #aa0033;
  }  

  .my-message {
    text-align: right;
    background: #dcf8c6;
    margin: 5px;
    padding: 8px;
    border-radius: 5px;
  }
  
  .their-message {
    text-align: left;
    background: #fff;
    margin: 5px;
    padding: 8px;
    border-radius: 5px;
  }
  
  .timestamp {
    font-size: 0.8em;
    color: #666;
    margin-left: 5px;
  }

  #clear-chat-wrapper {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 10;
    background: #fff;
    padding: 0px 8px 0px 0px;
    border-radius: 5px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Clear Chat Link */
#clear-chat-link {
    padding-top: 5px;
    font-size: 0.85em;
    font-weight: bold;
    color: #000000;
    text-decoration: none;
    opacity: 0.7;
}

/* Clear Chat Link Hover */
#clear-chat-link:hover {
    opacity: 1;
    color: #FFB939;
}

/* Mobile-specific Clear Chat Styles */
@media (max-width: 768px) {
    #clear-chat-wrapper {
        position: relative; /* Position below the send button */
        top: auto;
        right: auto;
        margin-top: 10px; /* Space below the send button */
    }

    /* Adjust the link positioning */
    #clear-chat-link {
        padding-top: 0;
        font-size: 0.85em;
        font-weight: bold;
        color: #000000;
        text-decoration: none;
        opacity: 0.7;
    }
}

.chat-username.owner {
  color: red;
  font-weight: bold;
}
  
.chat-username {
  font-weight: bold;
  text-decoration: none;
  color: inherit; /* Keeps link color consistent with surrounding text */
}

.chat-username:hover {
    color: #880029; /* Optional: add a hover effect if you want */
}