#broadcaster-container {
  position: relative;
  overflow: visible;
}

/* Webcam cachée par défaut */
#webcam-section {
  position: relative;
  z-index: 1;
  display: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#webcam-section.active {
  display: block;
  visibility: visible;
  opacity: 1;
}

/* Cadre stable pour éviter le scintillement */
.video-container {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
  border-radius: 12px;
}

/* Vidéo distante */
#remoteVideo {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
  background: #000;
  display: block;
  opacity: 0;
  transition: opacity 0.18s ease;
  border-radius: 12px;
}

#remoteVideo.ready {
  opacity: 1;
}

/* Vidéo locale */
#localVideo {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
  background-color: #000;
  border-radius: 12px;
}

/* Bouton audio */
.enable-audio-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.enable-audio-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Bloc payant simple, sous la vidéo */
#paid-message-section {
  display: none;
  margin-top: 15px;
  text-align: center;
}

#overlay-message {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
}

#view-paid-webcam {
  display: none;
}

/* Solde gold */
#gold-balance-display {
  display: none;
}

/* Panneau contrôles */
#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;
}

.gold-fee-selector {
  min-width: 110px;
  border-radius: 20px;
}

#gold-fee {
  height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border-radius: 50rem;
}

/* =========================================================
   VIEWER DESKTOP : cadre fixe pour empêcher les flux mobiles
   d'être trop grands dans view.php
   ========================================================= */
/* =========================================================
   VIEWER DESKTOP : adaptatif mobile + desktop
   ========================================================= */
.admin-status-select {
    font-weight: 400;
    transition: all 0.2s ease;
}

.admin-status-select.is-normal {
    border: 2px solid #059e0d;
    background-color: #fff5f5;
    color: #027926;
}

.admin-status-select.is-suspended {
    border: 2px solid #fd7e14;
    background-color: #fff3cd;
    color: #8a4b08;
}

.admin-status-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(253, 126, 20, 0.15);
}

.admin-profile-controls {
  width: 100%;
  max-width: 230px;
  margin: 0 auto;
}

.admin-profile-controls .form-group {
  width: 100%;
  margin-bottom: 10px;
}

.admin-profile-controls label {
  display: block;
  text-align: left;
  color: #fff;
  margin-bottom: 4px;
  font-size: 14px;
}

.admin-profile-controls select,
.admin-profile-controls .admin-status-select {
  width: 100%;
  height: 34px;
  display: block;
  box-sizing: border-box;
}

.admin-profile-actions {
  text-align: center;
}

.admin-profile-controls select {
  min-width: 100% !important;
  max-width: 100% !important;
}

#viewer-container {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

#viewer-container #webcam-section {
  max-width: 100%;
}

#viewer-container .video-container {
  width: 100%;
  max-width: 640px;
  max-height: 480px;
  margin: 0 auto;
  background: transparent;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  text-align: center;

  /* ✅ stabilité visuelle */
  aspect-ratio: var(--viewer-video-ratio, 4 / 3);
}

#viewer-container #remoteVideo {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 480px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  border-radius: 12px;
}

/***** WEBCAMS LIST CONTAINER *****/
/* Limiter la colonne GAUCHE à 8 vignettes max */
.left-column-top #webcam-list > *:nth-child(n+7) {
  display: none !important;
}

.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: #b46cb8 transparent; /* Firefox */
}

/* Firefox : déjà le plus fin possible */
#webcam-list{
  scrollbar-width: thin;                 /* le minimum sur Firefox */
  scrollbar-color: #b46cb8 transparent;  /* couleur du pouce + piste */
}

/* Chrome, Edge, Safari */
#webcam-list::-webkit-scrollbar{
  width: 6px;            /* ajuste: 6px, 5px, même 4px si tu veux */
  height: 6px;
}
#webcam-list::-webkit-scrollbar-track{
  background: transparent;
}
#webcam-list::-webkit-scrollbar-thumb{
  background-color: #b46cb8;
  border-radius: 4px;
  /* Astuce : bordure transparente pour "affiner" visuellement */
  border: 2px solid transparent;
  background-clip: content-box;
}

/* (Optionnel) éviter un petit shift quand la barre apparaît/disparaît */
#webcam-list{
  scrollbar-gutter: stable; /* pris en charge par Chrome/Edge/Firefox récents */
}

/***** 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;
}

#online-users-list span {
  margin-left: auto;
  margin-right: auto;
}

.member-list li a {
  text-decoration: none;
  color: #b46cb8;
  font-weight: bold;
  font-size: 16px;
}

.member-list li a:hover {
  text-decoration: none;
  color: #555;
  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 ****/
.private-message {
    color: #d63384;
    background-color: #f8d7da;
    padding: 5px;
    border-radius: 4px;
}

.chat-private {
  background-color: #fff0f6;
  color: #d63384;
  padding: 6px;
  border-radius: 4px;
  margin: 4px 0;
}

.chat-private-self {
  background-color: #f3e6ff;
  color: #800080;
  padding: 6px;
  border-radius: 6px;
  margin: 5px 0;
}

.chat-private-received {
  background-color: #ffe6eb;
  color: #d63384;
  padding: 6px;
  border-radius: 6px;
  margin: 5px 0;
}

#cancel-pv {
  padding: 5px 10px;
  background-color: #800080;
  color: #FFFFFF;
}

.pv-tag {
  font-weight: bold;
  color: #a600a6;
}

.pv-countdown {
  font-style: italic;
  opacity: 0.8;
}

.pv-user-link {
  font-weight: bold;
  color: #580858;
  text-decoration: none;
}

.pv-user-link a {
  font-weight: bold;
  color: #580858;
  text-decoration: none;
}

.pv-user-link a:hover {
  font-weight: bold;
  color: #c76cc7;
  text-decoration: none;
}

#message-input.pv-active {
  border: 2px solid #a600a6;
  background-color: #fff0fb;
}

.ban-user-link {
  text-decoration: none;
}

.chat-link {
  word-break: break-word;
  overflow-wrap: anywhere;
  display: inline;
}

.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 20px 10px 10px;
    background: #ffffff;
    border-right: 1px solid #ddd;
    padding-bottom: 10px;
  }
  
  #chat-box .chat-image-thumbnail {
    display: block;
    width: 88px;
    height: auto;
    margin-top: 5px;
    object-fit: cover;
    border-radius: 8px;
  }

  #chat-box .chat-image-modal {
      display: inline-block;
      line-height: 0;
  }

  .lg-outer .lg-img-wrap {
    padding: 20px;
  }

  .lg-outer .lg-object {
      display: block;
      width: auto !important;
      height: auto !important;
      max-width: calc(100vw - 40px) !important;
      max-height: calc(100vh - 80px) !important;
      object-fit: contain;
  }

  #chat-box .chat-image-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
    border-radius: 8px;
    color: #cfa9f3;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    vertical-align: middle;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
  }

  #chat-box .chat-image-link:hover {
      color: #860680;
      text-decoration: none;
  }

  #chat-box .chat-image-link i {
      font-size: 0.8rem;
  }

  #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;
    width: 120px;
  }
  
  #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 {
    display: none;
    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 */
}

/***** Suppression du compte *****/
.delete-danger-box {
  border: 1px solid rgba(220, 53, 69, .35);
  background: linear-gradient(135deg, rgba(220,53,69,.12), rgba(255,255,255,.04));
  border-radius: 14px;
  padding: 16px;
  animation: deleteFadeIn .35s ease;
}

.delete-danger-active {
  box-shadow: 0 0 0 4px rgba(220, 53, 69, .12);
  border-color: #dc3545 !important;
}

.delete-shake {
  animation: deleteShake .35s ease;
}

@keyframes deleteFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes deleteShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}