/* ============================================================
   TV OUTDOOR & INDOOR - ESTILOS VISUAIS
   Design Fiel à Referência & Player de Mídia de Alto Padrão
   ============================================================ */

:root {
  --primary-red: #e6222b;
  --dark-navy: #0f172a;
  --text-muted: #8898aa;
  --slate-border: #e2e8f0;
  --bg-pairing: #ffffff;
  --card-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.06), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-pairing);
  color: var(--dark-navy);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
}

/* ==============================================
   TELA DE PAREAMENTO (Idêntica à foto enviada)
   ============================================== */
.pairing-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  background-color: #f8fafc;
  padding: 2rem;
  z-index: 10;
  -webkit-transition: opacity 0.6s ease, -webkit-transform 0.6s ease;
  transition: opacity 0.6s ease, transform 0.6s ease;
  overflow: hidden;
  user-select: none;
}

.pairing-container {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  text-align: center;
  max-width: 1200px;
  width: 100%;
  margin: auto;
}

/* AS 6 CAIXAS NUMÉRICAS GIGANTES */
.code-boxes {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: clamp(14px, 2.2vw, 32px);
  margin-bottom: 2.2rem;
}

.digit-box {
  width: clamp(96px, 10.5vw, 160px);
  height: clamp(130px, 14.5vw, 220px);
  margin: 0 4px;
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: clamp(18px, 2vw, 28px);
  box-shadow: 0 18px 40px -6px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(5rem, 7.5vw, 8.5rem);
  font-weight: 900;
  color: #0f172a;
  line-height: 1;
  -webkit-transition: -webkit-transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  -webkit-animation: boxPopIn 0.4s ease backwards;
  animation: boxPopIn 0.4s ease backwards;
}

.digit-box:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: #cbd5e1;
  box-shadow: 0 24px 48px -8px rgba(15, 23, 42, 0.12);
}

.digit-box:nth-child(1) { animation-delay: 0.05s; }
.digit-box:nth-child(2) { animation-delay: 0.10s; }
.digit-box:nth-child(3) { animation-delay: 0.15s; }
.digit-box:nth-child(4) { animation-delay: 0.20s; }
.digit-box:nth-child(5) { animation-delay: 0.25s; }
.digit-box:nth-child(6) { animation-delay: 0.30s; }

@keyframes boxPopIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* EXPIRAÇÃO DO CÓDIGO */
.expiry-info {
  font-size: clamp(1.15rem, 1.8vw, 1.6rem);
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin-bottom: 1.4rem;
}

/* MAC / IDENTIFICAÇÃO DO DISPOSITIVO */
.device-mac-info {
  margin-top: 0.5rem;
}

.device-mac-badge {
  display: inline-flex;
  align-items: center;
  font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: clamp(0.95rem, 1.3vw, 1.25rem);
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 8px 24px;
  border-radius: 30px;
  border: 1px solid #e2e8f0;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.device-mac-badge:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* BOTÃO FLUTUANTE DE TELA CHEIA (CANTO SUPERIOR DIREITO) */
.fullscreen-shortcut-btn {
  position: absolute;
  top: 24px;
  right: 28px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  transition: all 0.2s ease;
  z-index: 20;
}

.fullscreen-shortcut-btn:hover {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1);
  transform: translateY(-1px);
}

/* ==============================================
   OVERLAY DE SUCESSO AO PAREAR
   ============================================== */
.pairing-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background: #0f172a;
  background: rgba(15, 23, 42, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  z-index: 50;
  -webkit-animation: fadeIn 0.4s ease;
  animation: fadeIn 0.4s ease;
}

.success-card {
  background: #ffffff;
  padding: 3.5rem 4rem;
  border-radius: 28px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  -webkit-animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: scaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-icon-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #ecfdf5;
  display: -webkit-inline-box;
  display: -webkit-inline-flex;
  display: -ms-inline-flexbox;
  display: inline-flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.success-card h2 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--dark-navy);
  margin-bottom: 0.5rem;
}

.success-card p {
  font-size: 1.1rem;
  color: #64748b;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==============================================
   TELA DO PLAYER DE MÍDIA OUTDOOR (TELA CHEIA)
   ============================================== */
.player-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  background-color: #000000;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  z-index: 20;
  overflow: hidden;
}

.media-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  background: #000000;
}

.media-element {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  -o-object-fit: cover;
  opacity: 0;
  -webkit-transition: opacity 0.8s ease-in-out;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
}

.media-element.active {
  opacity: 1;
  pointer-events: auto;
}

video.media-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000000;
}

/* Telas Verticais (Totens, Celulares e Painéis Portrait): Full Screen total */
@media (max-aspect-ratio: 1/1) {
  video.media-element {
    object-fit: cover;
  }
}

.youtube-wrapper {
  background: #000000;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

.youtube-wrapper iframe, #outdoorYoutubePlayer {
  width: 100vw;
  height: 100vh;
  min-width: 100vw;
  min-height: 100vh;
  border: none;
  pointer-events: none;
}

/* WRAPPER E CARD PARA VÍDEOS / REELS DO INSTAGRAM - FULL SCREEN TOTAL */
.instagram-wrapper {
  background: #000000;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

.instagram-card-container {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: #000000;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.instagram-card-container iframe {
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  border: none;
  background: #000000;
}

/* WRAPPER UNIVERSAL PARA TODAS AS PLATAFORMAS (TIKTOK, VIMEO, FACEBOOK, KWAI, TWITCH) - FULL SCREEN TOTAL */
.embed-wrapper {
  background: #000000;
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  -ms-flex-pack: center;
  justify-content: center;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
}

.embed-wrapper iframe {
  width: 100vw;
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  border: none;
  background: #000000;
}

/* BOTÃO FLUTUANTE DE TELA CHEIA NO PLAYER */
.player-fullscreen-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  opacity: 0.35;
  transition: opacity 0.3s ease, transform 0.2s ease;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.player-fullscreen-btn:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* BARRA DE PROGRESSO */
.slide-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  z-index: 35;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-red);
  box-shadow: 0 0 10px var(--primary-red);
  transition: width 0.1s linear;
}

/* CABEÇALHO OVERLAY (LOGO & RELÓGIO) */
.outdoor-header-overlay {
  position: absolute;
  top: 24px;
  left: 32px;
  right: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 30;
  pointer-events: none;
}

.overlay-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.qr-badge-mini {
  background: var(--primary-red);
  color: #fff;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 4px;
}

.company-logo-mini {
  max-height: 34px;
  max-width: 120px;
  object-fit: contain;
  -o-object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  border-radius: 6px;
}

.outdoor-clock-widget {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  padding: 8px 20px;
  border-radius: 12px;
  color: #ffffff;
  text-align: right;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.clock-time {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.5px;
}

.clock-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-top: 2px;
}

/* RODAPÉ COM LETREIRO (TICKER) */
.outdoor-ticker-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  z-index: 30;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.ticker-badge {
  background: var(--primary-red);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-content-wrapper {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-text {
  display: inline-block;
  white-space: nowrap;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 600;
  padding-left: 100%;
  animation: marqueeScroll 25s linear infinite;
}

@keyframes marqueeScroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* PAUSE INDICATOR */
.pause-indicator {
  position: absolute;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  padding: 20px 32px;
  border-radius: 20px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 1px;
  z-index: 40;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* EMPTY PLAYLIST */
.empty-playlist-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

.empty-box {
  background: rgba(15, 23, 42, 0.9);
  padding: 3rem 4rem;
  border-radius: 24px;
  text-align: center;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.empty-box h3 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.empty-box p {
  color: #94a3b8;
  font-size: 1.1rem;
}

/* UTILITÁRIOS */
.hidden {
  display: none !important;
}

/* RESPONSIVIDADE PARA DIFERENTES RESOLUÇÕES */
@media (max-width: 900px) {
  .main-title { font-size: 2.2rem; }
  .access-url { font-size: 1.5rem; }
  .code-boxes { gap: 10px; }
  .digit-box { width: 52px; height: 72px; font-size: 2.2rem; border-radius: 12px; }
}

@media (min-width: 2560px) {
  /* Otimização para Telas 4K */
  .brand-logo .brand-name { font-size: 3rem; }
  .brand-logo .qr-badge { font-size: 2rem; padding: 8px 18px; }
  .main-title { font-size: 5rem; }
  .step-label { font-size: 1.3rem; }
  .access-url { font-size: 3.5rem; }
  .qrcode-box { width: 220px; height: 220px; }
  .digit-box { width: 110px; height: 140px; font-size: 5rem; border-radius: 24px; }
  .expiry-info { font-size: 1.5rem; }
}

/* ==============================================
   OVERLAY: ANÚNCIOS BLOQUEADOS (PLANO EXPIRADO)
   ============================================== */
.ads-blocked-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 12, 22, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  box-sizing: border-box;
  animation: fadeInBlocked 0.4s ease-out;
}

@keyframes fadeInBlocked {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.ads-blocked-card {
  max-width: 780px;
  width: 90%;
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.15), rgba(15, 23, 42, 0.96));
  border: 2px solid rgba(239, 68, 68, 0.7);
  border-radius: 32px;
  padding: 4rem 3rem;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 100px rgba(239, 68, 68, 0.3);
}

.blocked-lock-icon {
  width: 110px;
  height: 110px;
  margin: 0 auto 1.8rem;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
  animation: pulseLockGlow 2.5s infinite ease-in-out;
}

@keyframes pulseLockGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 65px rgba(239, 68, 68, 0.7);
  }
}

.blocked-main-text {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  letter-spacing: 2.5px;
  color: #ffffff;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  text-shadow: 0 4px 25px rgba(239, 68, 68, 0.7);
  line-height: 1.1;
}

.blocked-sub-text {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: #cbd5e1;
  max-width: 580px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.blocked-instruction-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.9rem 2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  color: #fca5a5;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.5px;
}

