/* VIDEO_CONFERENCE_V2_5_0
 * Modulo grafico isolato: non modifica webcam pubbliche o videochiamate PVT.
 */

#conferenceLaunchButton {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 70, 70, .65);
  border-radius: 8px;
  background: linear-gradient(180deg, #e93636, #a90f18);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(170, 15, 24, .25);
}

#conferenceLaunchButton:hover { filter: brightness(1.08); }
#conferenceLaunchButton[hidden] { display: none !important; }
#conferenceLaunchButton .conference-button-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.16);
  animation: conferencePulse 1.15s ease-in-out infinite;
}

.video-conference-panel {
  position: relative;
  z-index: 8;
  width: 100%;
  flex: 0 0 auto;
  border-bottom: 1px solid rgba(51, 71, 94, .28);
  background: linear-gradient(180deg, rgba(15, 27, 43, .98), rgba(22, 38, 58, .97));
  color: #fff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}
.video-conference-panel[hidden] { display: none !important; }

.video-conference-head {
  min-height: 42px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
}
.video-conference-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-right: auto;
}
.video-conference-title strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.video-conference-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff303b;
  box-shadow: 0 0 0 4px rgba(255,48,59,.16);
  animation: conferencePulse 1.15s ease-in-out infinite;
}
.video-conference-count {
  font-size: 11px;
  color: #cad7e6;
}
.video-conference-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.video-conference-control {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 7px;
  background: rgba(255,255,255,.10);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.video-conference-control:hover { background: rgba(255,255,255,.18); }
.video-conference-control.is-off { background: #6e2530; border-color: #9a3c49; }
.video-conference-control.leave { background: #a7141f; border-color: #dc3545; }

.video-conference-stage {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 146px;
  max-height: 230px;
  padding: 8px 10px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
}
.video-conference-stage::-webkit-scrollbar { height: 7px; }
.video-conference-stage::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }

.video-conference-tile {
  position: relative;
  flex: 0 0 clamp(190px, 23vw, 285px);
  min-height: 128px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  background: #080f18;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
}
.video-conference-tile video {
  width: 100%;
  height: 100%;
  min-height: 128px;
  display: block;
  object-fit: cover;
  background: #080f18;
}
.video-conference-tile.is-local video { transform: scaleX(-1); }
.video-conference-tile.is-camera-off video { opacity: .10; }
.video-conference-avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 800;
  color: #d8e7f7;
  background: radial-gradient(circle at 50% 38%, #2b4868, #101b28 70%);
  opacity: 0;
  pointer-events: none;
}
.video-conference-tile.is-camera-off .video-conference-avatar-fallback { opacity: 1; }
.video-conference-tile-meta {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 5px 7px;
  border-radius: 7px;
  background: rgba(0,0,0,.68);
  backdrop-filter: blur(4px);
}
.video-conference-tile-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
}
.video-conference-media-icon {
  margin-left: auto;
  font-size: 12px;
  opacity: .95;
}
.video-conference-waiting {
  display: grid;
  place-items: center;
  flex: 1 0 260px;
  min-height: 128px;
  padding: 20px;
  border: 1px dashed rgba(255,255,255,.18);
  border-radius: 10px;
  color: #b9c7d8;
  font-size: 12px;
  text-align: center;
}

.conference-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(218, 24, 35, .12);
  color: #dc1c28;
  font-size: 8px;
  line-height: 1.4;
  font-weight: 900;
  letter-spacing: .05em;
  vertical-align: middle;
  white-space: nowrap;
}
.conference-live-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e21d2b;
  box-shadow: 0 0 0 2px rgba(226,29,43,.16);
  animation: conferencePulse 1.1s ease-in-out infinite;
}

.video-conference-toast {
  position: fixed;
  left: 50%;
  top: 82px;
  z-index: 999999;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(20, 29, 41, .96);
  color: #fff;
  font-size: 12px;
  box-shadow: 0 12px 35px rgba(0,0,0,.28);
}
.video-conference-toast.error { background: rgba(150, 18, 30, .97); }

@keyframes conferencePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.78); }
}

@media (max-width: 760px) {
  #conferenceLaunchButton { padding: 0 8px; font-size: 10px; }
  .video-conference-head { flex-wrap: wrap; }
  .video-conference-title { width: 100%; }
  .video-conference-actions { width: 100%; }
  .video-conference-control { flex: 1; }
  .video-conference-stage { min-height: 132px; max-height: 190px; }
  .video-conference-tile { flex-basis: 78vw; min-height: 116px; }
  .video-conference-tile video { min-height: 116px; }
}


/* VIDEO_CONFERENCE_V2_5_2_MODULE_ROW */
#chatScreen > .module-row #conferenceLaunchButton {
  flex: 0 0 auto;
  height: 34px;
  min-height: 34px;
  margin: 0 6px;
  white-space: nowrap;
  position: relative;
  z-index: 3;
}
@media (max-width: 700px) {
  #chatScreen > .module-row #conferenceLaunchButton {
    width: 34px;
    min-width: 34px;
    padding: 0;
    gap: 0;
  }
  #chatScreen > .module-row #conferenceLaunchButton span:last-child {
    display: none;
  }
}


/* VIDEO_CONFERENCE_V2_5_3_ROOM_INDICATORS */
.select-room-tag.tag-conference {
  background: rgba(218, 31, 49, .88);
  border-color: rgba(255, 185, 191, .86);
  color: #fff;
  box-shadow: 0 2px 8px rgba(140, 9, 22, .28);
}

.room-item-tag.tag-conference {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid rgba(190, 25, 42, .42);
  border-radius: 999px;
  background: rgba(218, 31, 49, .12);
  color: #9f1020;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.conference-room-tab-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  max-width: 105px;
  padding: 2px 5px;
  border: 1px solid rgba(148, 12, 27, .55);
  border-radius: 999px;
  background: linear-gradient(180deg, #e63a48, #a90f1d);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(120, 12, 24, .24);
}

.room-tab:has(.conference-room-tab-badge) {
  max-width: 320px;
}

@media (max-width: 700px) {
  .conference-room-tab-badge span:last-child,
  .room-item-tag.tag-conference span:last-child {
    display: none;
  }

  .conference-room-tab-badge,
  .room-item-tag.tag-conference {
    padding-left: 4px;
    padding-right: 4px;
  }
}


/* VIDEO_CONFERENCE_V2_5_7_INTERNAL_LIVE_BADGE */
#roomsList .room-item-tag.tag-conference {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 34px !important;
  max-width: 42px !important;
  height: 20px !important;
  padding: 2px 7px !important;
  margin: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

#roomsList .room-item-tag.tag-conference span {
  display: inline !important;
  font-size: 9px !important;
  line-height: 1 !important;
}


/* VIDEO_CONFERENCE_V2_5_5_HIDDEN_FIX */
#conferenceLaunchButton[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}


/* VIDEO_CONFERENCE_V2_6_0_PUBLIC_VIEW_AND_FULLSCREEN */
.video-conference-view-mode {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid rgba(107, 194, 255, .42);
  border-radius: 999px;
  background: rgba(31, 132, 204, .16);
  color: #bfe6ff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .05em;
  white-space: nowrap;
}
.video-conference-view-mode[hidden],
.video-conference-actions[hidden] {
  display: none !important;
}

.video-conference-tile-expand {
  display: inline-grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 23px;
  margin-left: 2px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 5px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.video-conference-tile-expand:hover {
  background: rgba(255,255,255,.24);
}

.video-conference-tile:fullscreen,
.video-conference-tile.is-expanded {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  flex: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #000;
  z-index: 2147483647;
}
.video-conference-tile:fullscreen video,
.video-conference-tile.is-expanded video {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  object-fit: contain !important;
  background: #000;
}
.video-conference-tile:fullscreen.is-local video,
.video-conference-tile.is-expanded.is-local video {
  transform: scaleX(-1);
}
.video-conference-tile:fullscreen .video-conference-tile-meta,
.video-conference-tile.is-expanded .video-conference-tile-meta {
  left: 14px;
  right: 14px;
  bottom: 14px;
  padding: 8px 10px;
}
.video-conference-tile.is-expanded:not(:fullscreen) {
  position: fixed !important;
  inset: 0 !important;
}

@media (max-width: 760px) {
  .video-conference-view-mode {
    font-size: 7px;
  }
}


/* VIDEO_CONFERENCE_TILE_MUTE_V2_6_3 */
.video-conference-tile-meta {
  z-index: 20;
  pointer-events: auto;
}

.video-conference-media-icon.video-conference-tile-mute {
  display: inline-grid;
  place-items: center;
  flex: 0 0 25px;
  width: 25px;
  height: 23px;
  margin-left: auto;
  padding: 0;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 5px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  pointer-events: auto;
  position: relative;
  z-index: 25;
}

.video-conference-media-icon.video-conference-tile-mute:hover {
  background: rgba(255,255,255,.24);
}

.video-conference-media-icon.video-conference-tile-mute.is-muted {
  background: rgba(197,54,72,.38);
  border-color: rgba(255,112,128,.55);
}

.video-conference-media-icon.video-conference-tile-mute:disabled {
  cursor: default;
  opacity: .55;
}

.video-conference-tile-expand {
  position: relative;
  z-index: 25;
  pointer-events: auto;
}


/* HIDE_PUBLIC_WEBCAM_IN_CONFERENCE_ROOM_V3_1_3 */
#chatScreen > .module-row
[data-action="webcam"].conference-public-webcam-hidden {
  display: none !important;
}
