body {
  font-family: "Inter", sans-serif;
  background-color: #121212;
  color: white;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.carousel-item {
  transition: opacity 0.5s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    visibility: hidden;
  }
}

.loader {
  width: 48px;
  height: 48px;
  display: inline-block;
  /* Utiliza o SVG como fundo e remove as bordas antigas */
  background-image: url("https://samuelpassamani.github.io/XCam/xcam-player/src/buffer.svg");
  background-repeat: no-repeat;
  background-size: contain;
  border: none;
  /* Mantém a animação de rotação */
  animation: rotation 1s linear infinite;
}

@keyframes rotation {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.badge-live {
  background: linear-gradient(90deg, #ff007f, #ff4500);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }

  100% {
    opacity: 1;
  }
}

.pagination-btn {
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(.pagination-active) {
  background-color: rgba(255, 255, 255, 0.1);
}

.pagination-active {
  background: linear-gradient(90deg, #ff007f, #4169e1);
}

/* Retro elements */
.retro-grid {
  background-image: linear-gradient(rgba(64, 64, 64, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 64, 64, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

.retro-glow {
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5), 0 0 20px rgba(255, 0, 127, 0.3);
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  overflow-y: auto;
}

.modal-content {
  background-color: #1a1a1a;
  border-radius: 8px;
  margin: 20px auto;
  width: 90%;
  max-width: 1200px;
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background-color: rgba(255, 0, 127, 0.5);
}

/* Country flags */
.flag-icon {
  width: 20px;
  height: 15px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 2px;
}

/* Estilos para o container da pré-visualização */
.card-preview-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  cursor: pointer;
  /* Fundo preto enquanto o iframe carrega */
}

.card-preview-container .badge-live,
.card-preview-container .absolute.bottom-2.right-2 {
  z-index: 20;
  pointer-events: none;
}

.card-preview-container iframe {
  aspect-ratio: 16/9;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  z-index: 10;
}

.card-preview-container img.card-poster {
  aspect-ratio: 16/9;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Efeito gradiente para tags dos cards */
.card-tag {
  background: #232323;
  color: #ccc;
  transition: background 0.3s, color 0.3s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(255, 0, 127, 0.1);
  cursor: pointer;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  display: inline-block;
}

.card-tag:hover {
  background: linear-gradient(90deg, #ff007f, #800080);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 0, 127, 0.25);
}

.ad-slot {
  min-height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
}

/* --- BOTÕES DE ORDEM: visual, tamanho e alinhamento --- */
.order-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0;
  transition: background 0.2s, box-shadow 0.2s;
  outline: none;
  cursor: pointer;
  opacity: 1;
  vertical-align: middle;
  height: 2.5rem;
  width: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-btn:hover:not(.selected) .order-icon-img {
  /* O src será trocado via JS, não precisa filtro */
}

.order-btn.selected,
.order-btn.selected:focus {
  background: linear-gradient(90deg, #ff007f, #ffd700);
  box-shadow: 0 0 12px #ffd70099;
  opacity: 1;
}

.order-icon-square {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.order-icon-img {
  width: 1.5rem;
  height: 1.5rem;
  display: block;
  object-fit: contain;
  margin: 0;
  padding: 0;
}

#carousel {
  height: 40vw;
  max-height: 90vh;
  min-height: 320px;
}

/* Carousel: Viewer count (top-left) and badge-live (top-right) styling */
.carousel-item .viewer-count {
  position: absolute !important;
  top: 0.6rem !important;
  left: 0.6rem !important;
  z-index: 60 !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.4rem !important;
  background-color: rgba(0, 0, 0, 0.65) !important;
  color: #ffffff !important;
  padding: 0 0.6rem !important;
  height: 1.8rem !important;
  border-radius: 0.45rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.carousel-item .viewer-count svg {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  stroke: currentColor;
}

.carousel-item .badge-live {
  position: absolute !important;
  top: 0.6rem !important;
  right: 0.6rem !important;
  z-index: 60 !important;
  padding: 0 0.6rem !important;
  height: 1.8rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0.45rem !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  background: linear-gradient(90deg, #ff007f, #ff4500) !important;
}

/* Responsividade - esconder label "espectadores" em telas pequenas */
.carousel-item .viewer-label {
  margin-left: 0.35rem;
}
@media (max-width: 640px) {
  .carousel-item .viewer-label {
    display: none;
  }
  .carousel-item .viewer-count {
    padding: 0 0.5rem !important;
    font-size: 0.95rem !important;
  }
}