/* Main layout containers */
#wrapper {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: #000;
  box-sizing: border-box;
}

#streams {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  position: relative;
  text-align: center;
  box-sizing: border-box;
}

/* Grid adaptativo baseado no número de streams */
#streams:has(.stream-wrapper:only-child) {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

#streams:has(.stream-wrapper:nth-child(2):last-child) {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
}

#streams:has(.stream-wrapper:nth-child(3):last-child) {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

#streams:has(.stream-wrapper:nth-child(4):last-child) {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

#streams:has(.stream-wrapper:nth-child(n+5):nth-child(-n+6):last-child) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
}

#streams:has(.stream-wrapper:nth-child(n+7):nth-child(-n+9):last-child) {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

/* Menu handle redesenhado */
.menu-handle {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  z-index: 1200;
  cursor: pointer;
  background: #2196F3; /* Azul vivo sem transparência */
  transition: all 0.3s ease;
  opacity: 50%;
}

.menu-handle:hover {
  background: #1976D2; /* Azul um pouco mais escuro no hover */
}

.menu-handle::after {
  content: '';
  position: absolute;
  bottom: 25;
  left: 0;
  right: 0;
  width: 100%; /* Estende por toda a largura */
  height: 1px;
  background: #64B5F6; /* Azul mais claro para o indicador */
  transition: all 0.3s ease;
}

.menu-handle:hover::after {
  background: #90CAF9; /* Azul ainda mais claro no hover */
}

/* Ajustes para fullscreen */
:fullscreen #wrapper,
:-webkit-full-screen #wrapper,
:fullscreen #streams,
:-webkit-full-screen #streams {
  padding: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
}

/* Ajustes para o modo chat aberto */
body.chat-open #streams {
  width: calc(100vw - 450px);
}

/* Sobrescreve estilos conflitantes de stream-wrapper */
.stream-wrapper {
  position: relative;
  display: inline-block;
  margin: 2px;
  overflow: hidden;
  box-sizing: border-box;
  background: #000;
  border: none !important;
  transition: width 0.2s ease, height 0.2s ease;
}

/* Sobrescreve estilos conflitantes de stream */
.stream {
  width: 100%;
  height: 100%;
  position: relative;
  box-sizing: border-box;
}

/* Correção para o keyframes que estava causando erro */
@keyframes pulseHandle {
  0% { background-color: rgba(33, 150, 243, 0.3); }
  50% { background-color: rgba(33, 150, 243, 1); }
  100% { background-color: rgba(33, 150, 243, 0.3); }
}

@keyframes rotateBorder {
  0% { box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.3) !important; }
  50% { box-shadow: 0 0 0 5px rgba(33, 150, 243, 1) !important; }
  100% { box-shadow: 0 0 0 5px rgba(33, 150, 243, 0.3) !important; }
}

/* Help box layout */
#helpbox {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translate( 0, -320%);
  z-index: 1500;
  background-color: #242d47 !important;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  width: 80%;
  text-align: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 1px solid #444;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.9, 0, 0.2, 1), opacity 0.5s ease;
}

#helpbox.show {
  transform: translate(-50%, -50%);
  opacity: 1;
}

#helpbox h1 {
  margin: 0 0 20px 0;
  font-size: 2.5em;
  color: #2196F3;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#helpbox ol {
  text-align: left;
  margin: 15px 0;
  padding-left: 25px;
  font-size: 13px;
}

#helpbox li {
  margin-bottom: 8px;
}

#helpbox a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}

#helpbox a:hover {
  text-decoration: underline;
  color: #ffffff;
}

#helptext {
  margin: 20px 0;
  line-height: 1.6;
  font-size: 14px;
}

#helptext ol {
  text-align: left;
  padding-left: 30px;
}

#helptext li {
  margin-bottom: 10px;
}

.api-info-box {
  background-color: #222222 !important;
  border-left: 3px solid #2196F3 !important;
  border-radius: 4px;
  padding: 15px;
  margin-top: 15px;
}

.api-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.api-title {
  margin: 0;
  color: #2196F3;
}

.api-toggle-icon {
  color: #2196F3;
  transition: transform 0.3s ease;
}

.api-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  opacity: 0;
}

.api-info-box.expanded .api-content {
  max-height: 500px;
  opacity: 1;
  margin-top: 15px;
}

.api-info-box.expanded .api-toggle-icon {
  transform: rotate(180deg);
}

.link-blue {
  color: #2196F3;
}

/* Social links layout */
#social-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border-radius: 4px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: white;
  text-decoration: none !important;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 13px;
  min-width: 36px;
  height: 36px;
}

.social-link.with-text i {
  margin-right: 8px;
}

.social-link.icon-only {
  width: 36px;
  padding: 0;
  justify-content: center;
}

.social-link:hover,
.social-link:focus,
.social-link:active {
  text-decoration: none !important;
  color: white;
}

/* Estilos específicos para cada rede social */
.social-link[href*="discord"] {
  background: #5865F2;
}

.social-link[href*="x.com"] {
  background: #000000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.social-link[href*="x.com"] i {
  font-size: 16px;
}

.social-link[href*="x.com"]:hover {
  background: #141414;
}

.social-link[href*="gmail"] {
  background: #EA4335;
}

.social-link[href*="youtube"] {
  background: #FF0000;
}

/* Remove sublinhado de todos os links */
a, a:hover, a:focus, a:active {
  text-decoration: none !important;
}

#helpbox a, #helpbox a:hover {
  text-decoration: none !important;
  color: #ffffff;
}

/* Total viewers overlay */
.total-viewers-overlay {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 20px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: min-content;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  color: #fff;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.total-viewers-overlay i {
  font-size: 16px;
  color: #2196F3;
  transition: color 0.3s ease;
}

.total-viewers-overlay span {
  display: inline-block;
  transition: transform 0.3s ease;
}

.total-viewers-overlay:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.total-viewers-overlay:hover i {
  color: #64B5F6;
}

.total-viewers-overlay:hover span {
  transform: scale(1.1);
}

#total-viewers-count {
  font-weight: bold;
  color: #fff;
}

/* Responsividade para o total-viewers-overlay */
@media (max-width: 768px) {
  .total-viewers-overlay {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  .total-viewers-overlay i {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .total-viewers-overlay {
    padding: 4px 10px;
    font-size: 12px;
    min-width: auto;
  }
  
  .total-viewers-overlay i {
    font-size: 12px;
  }
}

#helpbox #social-links {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  border-radius: 4px;
  background: none;
}

/* Indicador de áudio ativo */
.audio-active-indicator {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(33, 150, 243, 0.9); /* Azul padrão do tema */
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
  transform: scale(0.8);
}

.audio-active-indicator::before {
  content: '\f028';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: white;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.audio-active-indicator.active {
  opacity: 1;
  transform: scale(1);
}

/* Estilos do modo rotativo */
/* Indicador de foco ativo - completamente separado do áudio */
.stream-wrapper.focus-rotating {
  position: relative;
  box-shadow: 0 0 0 5px #2196F3 !important;
  border: none !important;
  animation: rotateBorder 2s infinite;
  z-index: 10;
  overflow: visible !important; /* Garante que a borda não seja cortada */
  transition: all 0.5s ease-in-out !important;
}

.stream-wrapper.focus-rotating.focused {
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5), 0 0 0 5px rgba(33, 150, 243, 0.8) !important;
  z-index: 1000 !important;
  transition: all 0.5s ease-in-out !important;
}

.stream-wrapper.focus-rotating.unfocused {
  opacity: 0.3;
  transition: all 0.5s ease-in-out !important;
}

/* Estilo para o player com áudio ativo */
.stream-wrapper.audio-active {
  box-shadow: 0 0 0 4px rgba(33, 150, 243, 0.7) !important;
  z-index: 9;
  position: relative;
}

/* Badge de gravado com fundo dinâmico */
.recorded-badge {
  background-color: rgba(229, 57, 53, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  position: absolute;
  top: 5px;
  right: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: fit-content;
  width: auto;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(2px);
  transition: all 0.3s ease;
  line-height: 1;
}

.recorded-badge:hover {
  transform: scale(1.05);
  background-color: rgba(244, 67, 54, 0.95);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

/* Responsividade para o recorded-badge */
@media (max-width: 768px) {
  .recorded-badge {
    font-size: 10px;
    padding: 3px 6px;
  }
}

@media (max-width: 480px) {
  .recorded-badge {
    font-size: 9px;
    padding: 2px 5px;
  }
} 