/* Stream wrapper */
.stream-wrapper {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 36px 0;
  overflow: visible;
  z-index: 1;
  text-align: center;
  box-sizing: border-box;
  background: #000;
  width: 100%;
  height: calc(100% - 72px);
  border: none;
  vertical-align: top;
  font-size: 0;
}

.stream-wrapper > * {
  font-size: 14px;
}

/* Base styles para todos os estados do stream-wrapper::before */
.stream-wrapper::before,
.stream-wrapper.is-live::before,
.stream-wrapper.was-live::before {
  content: '';
  position: absolute;
  top: 36px;
  left: 0;
  right: 0;
  bottom: 36px;
  width: 100%;
  height: calc(100% - 72px);
  z-index: 2;
  cursor: move;
  background: transparent;
  pointer-events: none;
  transform: none;
  max-width: none;
  max-height: none;
}

/* Adiciona estilos específicos para stream ao vivo */
.stream-wrapper.is-live {
  background: #000;
  margin: 0;
  padding: 36px 0;
  border: none;
}

/* Adiciona estilos específicos para stream gravado */
.stream-wrapper.was-live {
  background: #000;
  margin: 0;
  padding: 36px 0;
  border: none;
}

.stream-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: auto;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}

/* Channel overlay */
.channel-overlay {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translate(-50%, 0);
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.2;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  z-index: 100;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.channel-overlay.always-visible {
  opacity: 1;
  visibility: visible;
}

/* Stream controls */
.stream-controls {
  position: absolute;
  top: 4px;
  right: 10px;
  display: flex;
  gap: 5px;
  z-index: 101;
  opacity: 0;
  padding: 5px;
  border-radius: 4px;
}

.stream-wrapper:hover .stream-controls {
  opacity: 1;
}

.stream-control-btn {
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Focus mode */
.stream-wrapper.focused {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 1000 !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5) !important;
  margin: 0 !important;
  width: min(95vw, calc(95vh * 16/9)) !important;
  height: min(calc(95vw * 9/16), 95vh) !important;
}

.stream-wrapper.focused .stream-controls {
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stream-wrapper.focused:hover .stream-controls {
  opacity: 1;
}

.stream-wrapper.unfocused {
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Drag and drop - Agora consistente para todos os estados */
.stream-wrapper:hover::before,
.stream-wrapper.is-live:hover::before,
.stream-wrapper.was-live:hover::before {
  pointer-events: auto;
}

.stream-wrapper.dragging {
  z-index: 100;
  cursor: move;
  opacity: 0.8;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.stream-wrapper.drag-over {
  z-index: 99;
}

/* Indicador de rotação ativa */
.focus-rotation-indicator {
  position: absolute;
  top: 4px;
  left: 10px;
  background: rgba(33, 150, 243, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 101;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.focus-rotation-indicator i {
  font-size: 14px;
}

.stream-wrapper.focused .focus-rotation-indicator {
  opacity: 1;
  visibility: visible;
} 