/* ==========================================================================
   VL IPTV WEB PLAYER - ESTILOS PRINCIPAIS
   Design Dark Glassmorphism, Otimizado para Desempenho e Fluidez
   ========================================================================== */

:root {
  --bg-base: #0a0d14;
  --bg-surface: #111723;
  --bg-card: rgba(22, 30, 46, 0.75);
  --bg-card-hover: rgba(30, 41, 62, 0.9);
  --bg-glass: rgba(18, 24, 38, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 210, 255, 0.3);

  --accent-cyan: #00d2ff;
  --accent-blue: #3a7bd5;
  --accent-gradient: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%);
  --accent-gradient-hover: linear-gradient(135deg, #30dcff 0%, #4f8ff0 100%);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --status-active: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;

  --header-height: 64px;
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-fast: 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-elevation: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 210, 255, 0.25);
}

/* Reset Global */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
  user-select: none;
}

/* Scrollbar Customizada */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Utilitários */
.hidden,
.account-pill.hidden,
.header-nav.hidden {
  display: none !important;
}

/* ==========================================================================
   HEADER / BARRA SUPERIOR
   ========================================================================== */
.app-header {
  height: var(--header-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 13, 20, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.brand-logo:hover {
  transform: scale(1.02);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.35);
}

.logo-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: -0.5px;
}
.brand-title strong {
  font-weight: 800;
  color: var(--accent-cyan);
}
.brand-tag {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: -3px;
}

/* Navegação Rápida */
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-btn {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}
.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.nav-btn.active {
  color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--border-glow);
}

/* Centro da Barra Superior: Notificação do Próximo Programa EPG */
.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 0 16px;
  min-width: 0;
}

.header-epg-reminder {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.35);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
  max-width: 480px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.header-epg-reminder:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.header-epg-reminder:focus {
  outline: 2px solid var(--accent-cyan) !important;
}

.header-epg-reminder.hidden {
  display: none !important;
}

.header-epg-reminder .reminder-icon-wrap {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.header-epg-reminder .reminder-icon-wrap svg {
  width: 16px;
  height: 16px;
  display: block;
}

.header-epg-reminder .reminder-channel-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  flex-shrink: 0;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-epg-reminder .reminder-prog-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

/* Letreiro / Marquee para títulos longos na notificação do header */
.reminder-title-track {
  max-width: 180px;
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, #000 6px, #000 calc(100% - 6px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6px, #000 calc(100% - 6px), transparent 100%);
}

.reminder-title-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}

.reminder-title-inner.is-marquee {
  animation: reminderTickerMarquee linear infinite;
}

.header-epg-reminder:hover .reminder-title-inner.is-marquee {
  animation-play-state: paused;
}

@keyframes reminderTickerMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.reminder-title-item {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  flex-shrink: 0;
}

.reminder-title-sep {
  padding: 0 10px;
  color: var(--accent-cyan);
  opacity: 0.5;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.header-epg-reminder .reminder-time-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Quando faltando <= 5 minutos: VERDE COM ANIMAÇÃO PULSANTE */
.header-epg-reminder.reminder-urgent {
  background: rgba(34, 197, 94, 0.2) !important;
  border-color: #22c55e !important;
  animation: pulseReminderGreen 1.8s infinite ease-in-out !important;
}

.header-epg-reminder.reminder-urgent .reminder-icon-wrap {
  background: rgba(245, 158, 11, 0.22) !important;
  color: #f59e0b !important;
}

.header-epg-reminder.reminder-urgent .reminder-time-tag {
  color: #4ade80 !important;
  background: rgba(34, 197, 94, 0.25) !important;
}

.header-epg-reminder .btn-dismiss-reminder {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 0;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.header-epg-reminder .btn-dismiss-reminder:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.header-epg-reminder .btn-dismiss-reminder:focus {
  outline: 1px solid var(--accent-cyan) !important;
}

.header-epg-reminder.reminder-urgent .btn-dismiss-reminder {
  color: rgba(255, 255, 255, 0.7);
}

.header-epg-reminder.reminder-urgent .btn-dismiss-reminder:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
}

@keyframes pulseReminderGreen {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Lado Direito do Header */
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.digital-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  border-right: 1px solid var(--border-color);
  padding-right: 16px;
  flex-shrink: 0;
  white-space: nowrap;
}
.clock-time {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.5px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--transition-fast);
}
.clock-time:hover {
  color: var(--accent-cyan);
}
.clock-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast);
}
.clock-date:hover {
  color: var(--accent-cyan);
}
.network-speed-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1.2;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}
.network-speed-tag:hover {
  filter: brightness(1.25);
  text-decoration: none;
}
.network-speed-tag.speed-zero {
  color: var(--text-muted);
  opacity: 0.65;
}

/* Pílula de Status da Conta (compacta e auto-redimensionável) */
.account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  width: auto;
  max-width: fit-content;
  min-width: 0;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-avatar svg {
  width: 14px;
  height: 14px;
}
.account-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  width: auto;
}
.account-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  white-space: nowrap;
}
.account-username {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
.account-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 3px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-active);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.account-badge.expired,
.account-badge.banned {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-danger);
}
.account-badge.trial {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.account-exp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.account-exp {
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
  transition: color var(--transition-fast);
}
.account-exp:hover {
  color: var(--text-primary);
}
.account-cons {
  font-size: 0.62rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1.5px 5px;
  border-radius: 3px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-icon {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}
.btn-logout:hover {
  color: var(--status-danger);
  background: rgba(239, 68, 68, 0.12);
}

/* ==========================================================================
   APP MAIN E SISTEMA DE VISUALIZAÇÕES (SPA)
   ========================================================================== */
.app-main {
  width: 100%;
  height: calc(100% - var(--header-height));
  position: relative;
  overflow: hidden;
}

.view-panel {
  display: none;
  width: 100%;
  height: 100%;
  overflow: hidden;
  animation: fadeIn 0.25s ease-out;
}
.view-panel.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   TELA 1: LOGIN CARD
   ========================================================================== */
.login-wrapper {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 48px;
  background: radial-gradient(circle at 50% 20%, rgba(0, 210, 255, 0.08) 0%, transparent 60%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.login-glass-card {
  width: 100%;
  max-width: 480px;
  margin: auto 0;
  flex-shrink: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-elevation), var(--shadow-glow);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo-glow {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 210, 255, 0.4);
}
.login-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.login-header p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Abas de Conexão */
.login-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}
.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  background: var(--bg-card);
  color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Formulário */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.input-icon-wrapper > svg:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  width: 18px;
  height: 18px;
}
.input-icon-wrapper input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 42px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}
.input-icon-wrapper input:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.15);
}
.btn-toggle-pwd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  z-index: 5;
}
.btn-toggle-pwd:hover {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}
.btn-toggle-pwd svg {
  position: static !important;
  left: auto !important;
  transform: none !important;
  width: 18px !important;
  height: 18px !important;
  pointer-events: none;
  display: block;
}

.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.form-checkbox input {
  accent-color: var(--accent-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--accent-gradient);
  border: none;
  outline: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.3);
  transition: all var(--transition-fast);
  position: relative;
  margin-top: 8px;
}
.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.45);
}
.btn-primary:active {
  transform: translateY(1px);
}

.login-privacy-note {
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

.btn-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.login-alert {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 0.85rem;
  margin-top: 14px;
}
.login-alert.info {
  background: rgba(0, 210, 255, 0.12);
  border-color: rgba(0, 210, 255, 0.35);
  color: #7dd3fc;
}

/* ==========================================================================
   SEÇÃO DE PERFIS E CONTAS SALVAS (MEMÓRIA LOCAL)
   ========================================================================== */
.saved-profiles-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-profiles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  white-space: nowrap;
}
.saved-profiles-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-profiles-title svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
}
.saved-profiles-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}
.btn-clear-all {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-clear-all:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
  transform: translateY(-1px);
}
.saved-profiles-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.saved-profiles-title svg {
  color: var(--accent-cyan);
}

.saved-profiles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.saved-profile-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.saved-profile-card:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.saved-profile-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  flex: 1;
}

.saved-profile-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(0, 210, 255, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.saved-profile-icon.m3u {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.saved-profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.saved-profile-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-profile-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-delete-saved {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  margin-left: 8px;
  flex-shrink: 0;
}
.btn-delete-saved:hover {
  color: var(--status-danger);
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.1);
}

.saved-profiles-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.btn-page-nav {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-page-nav:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}
.btn-page-nav.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
  font-weight: 800;
}

.login-security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

/* ==========================================================================
   TELA 2: DASHBOARD HUB (SMARTERS PRO STYLE)
   ========================================================================== */
.dashboard-container {
  width: 100%;
  height: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1300px;
  margin: 0 auto;
  overflow-y: auto;
}

.dashboard-welcome {
  margin-bottom: 28px;
}
.dashboard-welcome h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.dashboard-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.smarters-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: var(--shadow-elevation);
}
.smarters-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
  animation: pulseCategoryCard 2s infinite ease-in-out;
}

@keyframes pulseCategoryCard {
  0% {
    box-shadow: 0 16px 36px -10px rgba(0, 210, 255, 0.3), 0 0 0 0 rgba(0, 210, 255, 0.5);
  }
  70% {
    box-shadow: 0 20px 42px -8px rgba(0, 210, 255, 0.4), 0 0 0 12px rgba(0, 210, 255, 0);
  }
  100% {
    box-shadow: 0 16px 36px -10px rgba(0, 210, 255, 0.3), 0 0 0 0 rgba(0, 210, 255, 0);
  }
}

.card-glow {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 210, 255, 0.08) 0%, transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}
.smarters-card:hover .card-glow {
  opacity: 1;
}

.card-icon {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-live .card-icon {
  background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
  color: #fff;
}
.card-vod .card-icon {
  background: linear-gradient(135deg, #f857a6 0%, #ff5858 100%);
  color: #fff;
}
.card-series .card-icon {
  background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
  color: #fff;
}

.card-body h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 6px 0 4px;
  letter-spacing: -0.3px;
}
.card-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.card-badge-live, .card-badge-vod, .card-badge-series {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.card-badge-live { color: #00d2ff; }
.card-badge-vod { color: #ff5858; }
.card-badge-series { color: #a855f7; }

.card-footer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.counter-badge {
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}
.card-arrow {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 1.2rem;
  transition: transform var(--transition-fast);
}
.smarters-card:hover .card-arrow {
  transform: translateX(6px);
}

/* ==========================================================================
   SEÇÃO CONTINUAR ASSISTINDO (HISTÓRICO RECENTE: CANAIS, FILMES, SÉRIES)
   ========================================================================== */
.continue-watching-section {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-elevation);
}

.continue-watching-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}

.continue-watching-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.continue-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-right: 0;
}

.history-tab-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}
.history-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.history-tab-btn.active {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.2);
}

.continue-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-rows-selector {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  transition: all var(--transition-fast);
}
.history-rows-selector:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(0, 210, 255, 0.4);
}
/* No celular na orientação vertical (portrait), o seletor de linhas de histórico não deve aparecer */
@media (orientation: portrait) {
  .history-rows-selector {
    display: none !important;
  }
}
@media (orientation: landscape) {
  .history-rows-selector {
    display: inline-flex;
  }
}
.rows-select-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.rows-select {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-family);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  padding: 2px;
}
.rows-select option {
  background: #0f141f;
  color: #fff;
  font-size: 0.82rem;
  padding: 6px 10px;
}

.btn-clear-history {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all var(--transition-fast);
}
.btn-clear-history:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
  transform: translateY(-1px);
}

.history-items-grid {
  display: grid;
  grid-template-columns: repeat(var(--history-cols, 4), minmax(0, 1fr));
  gap: 14px;
}

.history-card {
  background: rgba(10, 13, 20, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
  overflow: hidden;
  min-width: 0;
}
.history-card:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.history-card.history-card-placeholder {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px dashed rgba(255, 255, 255, 0.16) !important;
  opacity: 0.65;
  cursor: pointer;
}
.history-card.history-card-placeholder:hover {
  background: rgba(0, 210, 255, 0.05) !important;
  border-color: rgba(0, 210, 255, 0.45) !important;
  opacity: 1;
  transform: translateY(-2px);
}
.history-card.history-card-placeholder .placeholder-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  font-size: 1.25rem;
  font-weight: 700;
  width: 42px;
  height: 42px;
}

.history-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  flex: 1;
}

.history-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.history-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.history-thumb .thumb-placeholder {
  font-size: 1.1rem;
}

.history-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.history-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Letreiro Dinâmico da Direita para a Esquerda (Séries no Histórico) */
.history-subtitle.history-ticker {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  text-overflow: clip;
  mask-image: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 6px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6px, #000 calc(100% - 6px), transparent);
}
.history-subtitle.history-ticker .ticker-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScrollLeft 7.5s linear infinite;
  will-change: transform;
}
.history-card:hover .history-ticker .ticker-inner {
  animation-play-state: paused;
}
.history-subtitle.history-ticker .ticker-text {
  flex-shrink: 0;
}
.history-subtitle.history-ticker .ticker-sep {
  margin: 0 8px;
  opacity: 0.45;
  color: var(--accent-cyan);
  flex-shrink: 0;
}
@keyframes tickerScrollLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.btn-del-history-item {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-del-history-item:hover {
  color: var(--status-danger);
  background: rgba(239, 68, 68, 0.15);
  transform: scale(1.1);
}

.history-empty-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.history-pagination.hidden {
  display: none !important;
}
.hist-page-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}
.hist-page-btn:hover:not(:disabled) {
  background: rgba(0, 210, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}
.hist-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.hist-page-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 95px;
  text-align: center;
  user-select: none;
}

/* ==========================================================================
   SEÇÃO PROGRAMAS FAVORITOS DO EPG (LEMBRETES DE PROGRAMAÇÃO)
   ========================================================================== */
.epg-favorites-section {
  margin-top: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-elevation);
}
.epg-favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 16px;
}
.epg-fav-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.epg-fav-icon {
  font-size: 1.15rem;
}
.epg-fav-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.epg-fav-card {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.epg-fav-card:hover {
  background: rgba(0, 210, 255, 0.08);
  border-color: rgba(0, 210, 255, 0.35);
  transform: translateY(-2px);
}
.epg-fav-card:focus {
  outline: 2px solid var(--accent-cyan) !important;
}
.epg-fav-card .epg-fav-timing {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-top: 3px;
  display: inline-block;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 100%;
}
.epg-fav-card .epg-fav-timing.urgent {
  color: #22c55e;
  font-weight: 800;
}
.epg-fav-timing-track {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 3px;
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 10px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 10px), transparent 100%);
}
.epg-fav-timing-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}
.epg-fav-timing-inner.is-marquee {
  animation: epgFavTickerMarquee linear infinite;
}
.epg-fav-card:hover .epg-fav-timing-inner.is-marquee {
  animation-play-state: paused;
}
@keyframes epgFavTickerMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.epg-fav-timing-item {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
  flex-shrink: 0;
}
.epg-fav-timing-item.urgent {
  color: #22c55e;
  font-weight: 800;
}
.epg-fav-timing-sep {
  padding: 0 10px;
  color: var(--accent-cyan);
  opacity: 0.4;
  font-size: 0.65rem;
  flex-shrink: 0;
}

/* EPG do canal ao vivo exibido no card de Continuar Assistindo */
.history-live-epg {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 2px;
}
.history-live-epg .channel-badge-now {
  font-size: 0.5rem;
  padding: 1px 4px;
}
.history-live-epg .channel-prog-title,
.history-live-epg .channel-ticker-item {
  font-size: 0.72rem;
}
.history-card:hover .channel-ticker-inner.is-marquee {
  animation-play-state: paused;
}
.btn-del-epg-fav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}
.btn-del-epg-fav:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   TELA 3: LIVE TV PLAYER COM 3 COLUNAS
   ========================================================================== */
.live-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 280px 320px 1fr;
  overflow: hidden;
  transition: grid-template-columns var(--transition-smooth);
}

.live-layout.cinema-mode {
  grid-template-columns: 1fr !important;
}
.live-layout.cinema-mode .col-categories,
.live-layout.cinema-mode .col-channels {
  display: none !important;
}
.live-layout.cinema-mode .col-player {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  height: 100% !important;
}
.live-layout.cinema-mode #btn-player-toggle-cols {
  background: var(--accent-cyan) !important;
  color: #000 !important;
}

/* Colunas Laterais */
.col-categories, .col-channels {
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.col-header {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.col-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}
.badge-mini {
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 10px;
  color: var(--text-secondary);
}

.search-box {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}
.search-input-wrap {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}
.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.82rem;
  outline: none;
}
.search-box input:focus {
  border-color: var(--accent-cyan);
}
.btn-clear-search {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 2;
  padding: 0;
  line-height: 1;
}
.btn-clear-search:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}
.btn-clear-search.hidden {
  display: none !important;
}

.categories-list, .channels-list {
  flex: 1;
  overflow-y: auto;
  contain: content;
}

/* Itens da Categoria */
.cat-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
}
.cat-item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.cat-item.active {
  background: rgba(0, 210, 255, 0.12);
  border-left: 3px solid var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}
.cat-name {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Itens do Canal */
.channel-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  transition: all var(--transition-fast);
}
.channel-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.channel-item.active {
  background: rgba(0, 210, 255, 0.15);
  border-left: 3px solid var(--accent-cyan);
}

.channel-logo-wrap {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.channel-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.channel-logo-wrap .fallback-tv-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.channel-info-text {
  flex: 1;
  overflow: hidden;
}
.channel-name {
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.channel-item.active .channel-name {
  color: var(--accent-cyan);
  font-weight: 700;
}
.channel-epg-current {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  display: flex;
  align-items: center;
  min-height: 16px;
  min-width: 0;
}

.channel-badge-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.52rem;
  font-weight: 800;
  color: #fff;
  background: #ef4444;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  margin-right: 5px;
  flex-shrink: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

/* Letreiro / Marquee para títulos longos de programas no ar */
.channel-ticker-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 14px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 14px), transparent 100%);
}

.channel-prog-title {
  color: var(--text-secondary);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-ticker-inner {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  will-change: transform;
}

.channel-ticker-inner.is-marquee {
  animation-name: channelTickerMarquee;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.channel-item:hover .channel-ticker-inner.is-marquee {
  animation-play-state: paused;
}

@keyframes channelTickerMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.channel-ticker-item {
  color: var(--text-secondary);
  font-size: 0.72rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.channel-item.active .channel-prog-title,
.channel-item.active .channel-ticker-item {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.channel-ticker-sep {
  color: var(--accent-cyan);
  font-size: 0.65rem;
  padding: 0 10px;
  flex-shrink: 0;
  opacity: 0.6;
}

.channel-item-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.btn-channel-epg {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-channel-epg:hover {
  color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.12);
  transform: scale(1.1);
}

/* COLUNA DO PLAYER */
.col-player {
  height: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.player-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}
#video-player.ratio-fill { object-fit: fill; }
#video-player.ratio-cover { object-fit: cover; }
#video-player.ratio-4-3 { aspect-ratio: 4/3; }

/* Spinner de Buffering */
.player-buffering {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.75);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
  z-index: 15;
  pointer-events: none;
}
.spinner-circle {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 210, 255, 0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.player-buffering span {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  min-width: 44px;
  text-align: center;
}

/* OSD (On-Screen Display) */
.player-osd {
  position: absolute;
  top: 55px;
  right: 20px;
  background: rgba(10, 13, 20, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 25;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: slideInDown 0.3s ease-out;
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-15px); }
  to { opacity: 1; transform: translateY(0); }
}
.osd-logo-wrap {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.osd-logo-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.osd-info {
  display: flex;
  flex-direction: column;
}
.osd-channel-number {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 800;
}
.osd-channel-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}
.osd-channel-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Overlay de Controles do Player */
.player-controls-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 25%, transparent 70%, rgba(0,0,0,0.85) 100%);
  opacity: 1;
  transition: opacity var(--transition-smooth);
  pointer-events: auto;
  z-index: 10;
}
.player-controls-overlay.autohide {
  opacity: 0;
  pointer-events: none;
}

.player-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.player-stream-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.live-dot {
  width: 8px;
  height: 8px;
  background: var(--status-danger);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--status-danger);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.4; }
  100% { opacity: 1; }
}
.format-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  background: rgba(0, 210, 255, 0.25);
  border: 1px solid var(--accent-cyan);
  border-radius: 4px;
  color: var(--accent-cyan);
}

.player-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  outline: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.ctrl-btn:hover {
  background: var(--accent-cyan);
  color: #000;
  transform: scale(1.08);
}
#btn-stop-player:hover {
  background: var(--status-danger);
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}
.ctrl-text-btn {
  border-radius: var(--radius-sm);
  width: auto;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 20px;
}
#volume-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* ==========================================================================
   GRAVAÇÃO DE TV AO VIVO NO PC (BOTÃO REC)
   ========================================================================== */
.btn-record {
  position: relative;
  transition: all var(--transition-fast);
}
.btn-record .rec-icon circle {
  transition: fill var(--transition-fast);
}
.btn-record:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
  border: 1px solid #ef4444;
}
.btn-record.recording {
  background: rgba(239, 68, 68, 0.9) !important;
  color: #fff !important;
  width: auto !important;
  padding: 0 12px !important;
  border-radius: 20px !important;
  gap: 6px;
  animation: pulseRecording 1.5s infinite ease-in-out;
}
.btn-record.recording .rec-icon circle {
  fill: #fff;
}
.btn-record .rec-timer {
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
@keyframes pulseRecording {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ==========================================================================
   EPG: BARRA INFERIOR ESTILO TV A CABO (LADO A LADO, LOGO E 2 PRÓXIMOS)
   ========================================================================== */
.player-epg-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 74px;
  background: linear-gradient(180deg, rgba(12, 18, 30, 0.95) 0%, rgba(7, 11, 20, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.75);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
}
.player-epg-bar.hidden {
  display: none !important;
}

.epg-bar-logo-wrap {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 4px;
}
.epg-bar-channel-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.epg-bar-fallback-icon {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.epg-bar-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.epg-now-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}
.epg-channel-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.epg-live-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.epg-now-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.epg-now-time {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.epg-progress-container {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  overflow: hidden;
}
.epg-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #00d2ff 0%, #0072ff 100%);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.epg-upcoming-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.epg-upcoming-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.epg-upcoming-badge {
  font-size: 0.58rem;
  font-weight: 800;
  color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  min-width: 58px;
  text-align: center;
}
.epg-upcoming-badge.badge-later {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.3);
}
.epg-upcoming-time {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.epg-upcoming-title {
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

#btn-toggle-epg-bar.active {
  color: var(--accent-cyan);
  background: rgba(0, 210, 255, 0.15);
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.25);
}

@media (max-width: 768px) {
  .player-epg-bar {
    left: 8px;
    right: 8px;
    bottom: 66px;
    padding: 8px 12px;
    gap: 10px;
  }
  .epg-bar-logo-wrap {
    width: 44px;
    height: 44px;
  }
  .epg-now-title {
    font-size: 0.85rem;
  }
  .epg-upcoming-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .epg-upcoming-item {
    width: 100%;
  }
}

/* Modal de Grade EPG Completa */
.epg-modal-card {
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  background: #0f141f;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.25s ease-out;
}
.epg-modal-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}
.epg-modal-header .btn-icon {
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.epg-modal-header .btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.epg-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.epg-modal-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px;
}
.epg-header-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}
.epg-channel-category {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}
.epg-modal-search {
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}
.epg-modal-search .search-input-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.epg-modal-search .search-input-wrap input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
}
.epg-search-empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--text-muted);
}
.epg-search-empty h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.epg-search-empty p {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.epg-modal-body {
  padding: 16px 24px;
  overflow-y: auto;
  max-height: calc(85vh - 80px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.epg-program-item {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all var(--transition-fast);
}
.epg-program-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(0, 210, 255, 0.3);
}
.epg-program-item.now-playing {
  background: rgba(0, 210, 255, 0.08);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 210, 255, 0.15);
}
.epg-time-col {
  width: 120px;
  min-width: 120px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.epg-prog-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  line-height: 1.2;
}
.epg-prog-time {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.epg-badge-now {
  font-size: 0.6rem;
  font-weight: 800;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
  padding: 1px 5px;
  border-radius: 3px;
  align-self: flex-start;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.epg-details-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.epg-prog-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}
.epg-prog-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.epg-action-col {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: 10px;
}
.btn-epg-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.btn-epg-fav:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #f59e0b;
  transform: scale(1.08);
}
.btn-epg-fav:focus {
  outline: 2px solid var(--accent-cyan) !important;
}
.btn-epg-fav:not(.active) {
  opacity: 0.75;
}
.btn-epg-fav:not(.active):hover {
  opacity: 1;
}
.btn-epg-fav.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
}
.btn-epg-fav svg {
  width: 19px;
  height: 19px;
  display: block;
}
.epg-loading, .epg-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   TELA 4 & 5: CATÁLOGO VOD E SÉRIES
   ========================================================================== */
.media-hub-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 280px 1fr;
}
.media-hub-sidebar {
  height: 100%;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.media-hub-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  overflow-y: auto;
}
.media-hub-topbar {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.search-media {
  width: 300px;
  border-bottom: none;
  padding: 0;
}

.media-grid {
  flex: 1;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: max-content;
  align-items: start;
  gap: 22px;
  overflow-y: auto;
}

.media-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  height: max-content;
}
.media-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 210, 255, 0.2);
}

.media-poster-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  min-height: 260px;
  background: #111723;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 2.5rem;
}
.media-poster-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-title-box {
  padding: 10px 12px;
  background: rgba(10, 13, 20, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.media-title {
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

/* ==========================================================================
   MODAL DE VÍDEO (VOD / SÉRIES)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
#modal-series-details {
  z-index: 210;
}
#modal-vod-player {
  z-index: 300;
}
.modal-dialog {
  width: 90%;
  max-width: 960px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-elevation);
}
.modal-vod-dialog {
  width: 92%;
  max-width: 1080px;
  background: #000;
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 210, 255, 0.18);
  position: relative;
}
.modal-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.modal-body {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
  overflow: hidden;
}
.modal-vod-body {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#modal-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  outline: none;
}
#modal-video.ratio-fill { object-fit: fill; }
#modal-video.ratio-cover { object-fit: cover; }
#modal-video.ratio-4-3 { aspect-ratio: 4/3; }

/* Timeline e Controles Customizados VOD / Séries */
.modal-player-bottom-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.vod-timeline-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 0 4px;
}
.vod-time-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  font-family: var(--font-family);
  min-width: 60px;
  text-align: center;
  user-select: none;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.vod-seekbar-wrap {
  position: relative;
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: height 0.15s ease;
}
.vod-seekbar-wrap:hover {
  height: 10px;
}
.vod-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00d2ff, #0077ff);
  border-radius: 4px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
  transition: width 0.1s linear;
}
.vod-seekbar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  z-index: 5;
}

/* Balãozinho indicador de tempo (Tooltip) na Linha do Tempo */
.vod-timeline-tooltip {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(10, 14, 23, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--accent-cyan);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 210, 255, 0.4);
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 8;
}
.vod-timeline-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(10, 14, 23, 0.95) transparent transparent transparent;
}
.vod-timeline-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

/* Bolinha seguidora do cursor na Linha do Tempo */
.vod-timeline-hover-dot {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid var(--accent-cyan);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--accent-cyan), 0 0 14px rgba(0, 210, 255, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 7;
}
.vod-timeline-hover-dot.visible {
  opacity: 1;
  visibility: visible;
}
#vod-volume-slider {
  width: 70px;
  height: 4px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}
#btn-vod-stop:hover {
  background: var(--status-danger);
  color: #fff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Modal de Retomar Reprodução (Resume Prompt) */
.modal-resume-prompt {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-resume-prompt.hidden {
  display: none !important;
}
.resume-prompt-card {
  background: rgba(17, 24, 39, 0.96);
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-radius: 14px;
  padding: 24px 28px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 210, 255, 0.15);
  animation: resumePopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
@keyframes resumePopIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.resume-prompt-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.resume-prompt-icon {
  font-size: 2rem;
  background: rgba(0, 210, 255, 0.12);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.resume-prompt-titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.resume-prompt-titles h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.resume-prompt-titles p {
  font-size: 0.88rem;
  color: var(--accent-cyan);
  margin: 0;
  font-weight: 600;
}
.resume-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-resume {
  width: 100%;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.92rem;
}
.btn-resume-continue {
  background: linear-gradient(135deg, #00d2ff 0%, #0077ff 100%);
  color: #050a14;
  border: none;
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.35);
}
.btn-resume-continue:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 210, 255, 0.55);
}
.btn-resume-restart {
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.btn-resume-restart:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Botão Flutuante Próximo Episódio */
.btn-next-episode {
  position: absolute;
  bottom: 66px;
  right: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 16, 26, 0.88);
  color: #00d2ff;
  border: 1.5px solid #00d2ff;
  border-radius: 28px;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 210, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulseNextBtn 2s infinite ease-in-out;
}
.btn-next-episode.hidden {
  display: none !important;
}
.btn-next-episode:hover {
  background: #00d2ff;
  color: #000;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 210, 255, 0.6);
}
.btn-next-episode .next-ep-icon {
  font-size: 0.95rem;
  transition: transform 0.2s;
}
.btn-next-episode:hover .next-ep-icon {
  transform: translateX(3px);
}
@keyframes pulseNextBtn {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 210, 255, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 210, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 210, 255, 0);
  }
}

/* ==========================================================================
   MODAL DE SÉRIES E EPISÓDIOS
   ========================================================================== */
.modal-series-dialog {
  max-width: 880px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}
.modal-series-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.series-details-header {
  display: flex;
  gap: 20px;
}
.series-modal-poster {
  width: 130px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: #111;
  border: 1px solid var(--border-color);
}
.series-modal-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.series-modal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.series-modal-info h3 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
}
.series-modal-plot {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
}
.seasons-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.season-tab-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.season-tab-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.season-tab-btn.active {
  background: var(--accent-cyan);
  color: #000;
  border-color: var(--accent-cyan);
}
.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.episode-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.episode-item:hover {
  background: rgba(0, 210, 255, 0.1);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}
.episode-item-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}
.episode-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.badge-status-completed {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.18);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.45);
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-status-progress {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.45);
  letter-spacing: 0.3px;
  line-height: 1.2;
  white-space: nowrap;
  animation: pulseProgressBadge 2s infinite ease-in-out;
}
@keyframes pulseProgressBadge {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}
.episode-play-icon {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */
/* ==========================================================================
   RESPONSIVIDADE (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Barra Superior no Mobile */
  .app-header {
    height: 64px;
    width: 100%;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    background: #0a0d14 !important;
    padding: 0 16px;
    gap: 12px;
    flex-wrap: nowrap;
  }
  .app-header::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
  }

  /* Na TELA DE LOGIN: barra fixa, não deslizante, relógio na extrema direita */
  body:not(.logged-in) .app-header,
  .app-header:not(.logged-in) {
    justify-content: space-between !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
  }
  body:not(.logged-in) .header-right,
  .app-header:not(.logged-in) .header-right {
    margin-left: auto !important;
  }

  /* APÓS FAZER LOGIN: barra deslizável horizontalmente de ponta a ponta com toque suave */
  body.logged-in .app-header,
  .app-header.logged-in {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }
  body.logged-in .app-header::-webkit-scrollbar,
  .app-header.logged-in::-webkit-scrollbar {
    display: none !important;
  }
  body.logged-in .header-right,
  .app-header.logged-in .header-right {
    margin-left: 0 !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
  }
  .header-right {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    gap: 12px !important;
  }

  .header-center {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .header-epg-reminder {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 4px !important;
    padding: 6px 14px !important;
    gap: 8px !important;
    max-width: none !important;
    width: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  }
  .header-epg-reminder.hidden {
    display: none !important;
  }
  .header-epg-reminder .reminder-icon-wrap {
    width: 24px !important;
    height: 24px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .header-epg-reminder .reminder-icon-wrap svg {
    width: 15px !important;
    height: 15px !important;
    display: block !important;
  }
  .header-epg-reminder .reminder-channel-tag {
    font-size: 0.70rem !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    max-width: 120px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: normal !important;
  }
  .header-epg-reminder .reminder-title-track {
    max-width: 200px !important;
    min-width: 90px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
  }
  .header-epg-reminder .reminder-title-inner {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
  }
  .header-epg-reminder .reminder-title-item {
    font-size: 0.80rem !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    line-height: normal !important;
  }
  .header-epg-reminder .reminder-title-sep {
    padding: 0 8px !important;
    flex-shrink: 0 !important;
  }
  .header-epg-reminder .reminder-time-tag {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    line-height: normal !important;
  }
  .header-epg-reminder .btn-dismiss-reminder {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    margin-left: 2px !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .header-epg-reminder .btn-dismiss-reminder svg {
    width: 14px !important;
    height: 14px !important;
    display: block !important;
  }

  .brand-logo {
    flex-shrink: 0 !important;
    gap: 10px;
  }
  .logo-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0 !important;
  }
  .brand-title {
    font-size: 1.1rem;
    white-space: nowrap;
  }
  .brand-tag {
    font-size: 0.65rem;
    display: block;
    white-space: nowrap;
  }

  /* Navegação Horizontal Integrada no Topo (SEM Barra Inferior) */
  .header-nav {
    position: static !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }
  .header-nav.hidden {
    display: none !important;
  }
  .header-nav .nav-btn {
    flex-direction: row;
    padding: 8px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0 !important;
    gap: 8px;
    border-radius: var(--radius-sm);
  }
  .header-nav .nav-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0 !important;
  }

  /* Relógio Visível sem Esmagar */
  .digital-clock {
    display: flex !important;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 16px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0 !important;
    white-space: nowrap;
  }
  .clock-time {
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
  }
  .clock-date {
    font-size: 0.7rem;
    display: block;
    white-space: nowrap;
    text-transform: none;
    cursor: pointer;
  }

  /* Dados do Usuário e Botão de Sair Visíveis sem Esmagar (Apenas quando autenticado) */
  .account-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    flex-shrink: 0 !important;
    width: auto;
    max-width: fit-content;
    white-space: nowrap;
  }
  .account-pill.hidden {
    display: none !important;
  }

  /* Na tela de login, remove a divisória direita do relógio */
  .header-right:has(.account-pill.hidden) .digital-clock {
    border-right: none !important;
    padding-right: 0 !important;
  }
  .account-avatar {
    width: 24px;
    height: 24px;
    flex-shrink: 0 !important;
  }
  .account-avatar svg {
    width: 13px;
    height: 13px;
  }
  .account-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex-shrink: 0 !important;
  }
  .account-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    white-space: nowrap;
  }
  .account-username {
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .account-badge {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
  .account-cons {
    font-size: 0.6rem;
    padding: 1px 4px;
  }
  .account-exp-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    font-size: 0.65rem;
    gap: 6px;
    white-space: nowrap;
  }

  .btn-icon {
    padding: 4px;
    flex-shrink: 0 !important;
  }
  .btn-logout {
    color: var(--status-danger) !important;
  }

  /* App Main - sem barra inferior nenhuma */
  .app-main {
    height: calc(100% - 64px);
    padding-bottom: 0 !important;
    box-sizing: border-box;
  }

  /* 2. Tela Dashboard (Início) */
  .dashboard-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px 14px 40px;
    justify-content: flex-start;
    display: flex;
    flex-direction: column;
  }
  .dashboard-welcome,
  .dashboard-cards-grid,
  .continue-watching-section {
    flex-shrink: 0 !important;
  }
  .dashboard-welcome {
    margin-bottom: 14px;
  }
  .dashboard-welcome h2 {
    font-size: 1.25rem;
    font-weight: 800;
  }
  .dashboard-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .smarters-card {
    padding: 16px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    border-radius: var(--radius-md);
  }
  .card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    flex-shrink: 0;
  }
  .card-icon svg {
    width: 28px;
    height: 28px;
  }
  .card-body {
    flex: 1;
    min-width: 0;
  }
  .card-body h3 {
    font-size: 1.1rem;
    margin: 2px 0;
  }
  .card-body p {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .card-badge-live, .card-badge-vod, .card-badge-series {
    font-size: 0.58rem;
  }
  .card-footer-info {
    margin-top: 8px;
    padding-top: 8px;
  }
  .counter-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
  }

  .continue-watching-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 14px;
    border-radius: var(--radius-md);
    height: auto !important;
    overflow: visible;
  }
  .epg-favorites-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    margin-top: 18px;
    padding: 14px;
    border-radius: var(--radius-md);
    flex-shrink: 0 !important;
  }
  .epg-favorites-header {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
  .continue-watching-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 12px 10px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 12px;
  }
  .continue-title {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    justify-self: start;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin: 0;
  }
  .continue-header-actions {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .history-rows-selector {
    display: none !important;
  }
  .btn-clear-history {
    margin-left: 0;
    align-self: center;
    font-size: 0.68rem;
    padding: 4px 8px;
    flex-shrink: 0;
  }
  .continue-watching-tabs {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .continue-watching-tabs::-webkit-scrollbar {
    display: none;
  }
  .history-tab-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .history-items-grid {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
  }
  .history-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 10px;
    flex-shrink: 0;
    overflow: hidden;
  }
  .history-card-left {
    min-width: 0;
    overflow: hidden;
    flex: 1;
  }
  .history-card-info {
    min-width: 0;
    overflow: hidden;
    flex: 1;
  }
  .history-thumb {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .history-title {
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .history-subtitle {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .history-subtitle.history-ticker {
    text-overflow: clip;
    max-width: 100%;
  }

  /* 3. Tela Live TV (Canais Ao Vivo no Mobile Vertical) */
  @media (orientation: portrait) {
    .live-layout {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
    }
    .col-player {
      width: 100%;
      height: 220px;
      flex-shrink: 0;
      position: relative;
      background: #000;
    }
    .col-categories {
      width: 100%;
      height: auto;
      max-height: 48px;
      border-right: none;
      border-bottom: 1px solid var(--border-color);
      flex-shrink: 0;
      overflow: hidden;
    }
    .col-categories .col-header,
    .col-categories .search-box {
      display: none !important;
    }
    .col-categories .categories-list {
      display: flex;
      flex-direction: row;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: nowrap;
      padding: 8px 10px;
      gap: 6px;
      -webkit-overflow-scrolling: touch;
    }
    .col-categories .cat-item {
      padding: 4px 12px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.05);
      border: 1px solid var(--border-color);
      flex-shrink: 0;
      border-left: 1px solid var(--border-color);
      border-bottom: none;
    }
    .col-categories .cat-name {
      font-size: 0.76rem;
    }
    .col-categories .cat-count {
      display: none;
    }
    .col-categories .cat-item.active {
      background: var(--accent-cyan);
      color: #000;
      border-color: var(--accent-cyan);
      font-weight: 700;
      border-left: 1px solid var(--accent-cyan);
    }
    .col-channels {
      flex: 1;
      width: 100%;
      height: auto;
      border-right: none;
      overflow-y: auto;
    }
  }
  .col-channels .col-header {
    height: 44px;
    padding: 0 12px;
  }
  .col-channels .col-header h3 {
    font-size: 0.85rem;
  }
  .col-channels .search-box {
    padding: 8px 12px;
  }
  .col-channels .search-box input {
    height: 32px;
    font-size: 0.78rem;
  }
  .channel-item {
    padding: 8px 12px;
    gap: 10px;
  }
  .channel-logo-wrap {
    width: 36px;
    height: 36px;
  }
  .channel-name {
    font-size: 0.8rem;
  }
  .channel-epg-current {
    font-size: 0.68rem;
    min-height: 15px;
  }
  .channel-badge-now {
    font-size: 0.48rem;
    padding: 0 3px;
  }
  .channel-prog-title {
    font-size: 0.68rem;
  }

  /* Player Controls no Mobile */
  .player-controls-overlay {
    padding: 10px 12px;
  }
  .player-stream-info {
    font-size: 0.78rem;
  }
  .volume-container {
    display: none !important;
  }
  #btn-aspect-ratio {
    display: none !important;
  }
  /* Na vertical, o botão de expandir o player fica oculto */
  @media (orientation: portrait) {
    #btn-player-toggle-cols {
      display: none !important;
    }
  }
  /* Na horizontal (landscape), o botão de expandir o player DEVE APARECER */
  @media (orientation: landscape) {
    #btn-player-toggle-cols {
      display: inline-flex !important;
    }
  }
  /* Barra de botões do player deslizável horizontalmente no celular */
  .player-bottombar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important; /* Firefox */
    padding-bottom: 2px !important;
    touch-action: pan-x !important;
  }
  .player-bottombar::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari, Edge */
  }
  .controls-left, .controls-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }
  .ctrl-btn {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
  }
  .player-osd {
    bottom: 45px;
    left: 10px;
    right: 10px;
    padding: 8px 12px;
    gap: 10px;
  }
  .osd-logo-wrap {
    width: 38px;
    height: 38px;
  }
  .osd-channel-name {
    font-size: 0.95rem;
  }

  /* 4. Telas Filmes (VOD) e Séries */
  .media-hub-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }
  .media-hub-sidebar {
    width: 100%;
    height: auto;
    max-height: 48px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow: hidden;
  }
  .media-hub-sidebar .col-header,
  .media-hub-sidebar .search-box {
    display: none !important;
  }
  .media-hub-sidebar .categories-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 8px 10px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .media-hub-sidebar .cat-item {
    padding: 4px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    border-left: 1px solid var(--border-color);
    border-bottom: none;
  }
  .media-hub-sidebar .cat-name {
    font-size: 0.76rem;
  }
  .media-hub-sidebar .cat-item.active {
    background: var(--accent-cyan);
    color: #000;
    border-color: var(--accent-cyan);
    font-weight: 700;
    border-left: 1px solid var(--accent-cyan);
  }
  .media-hub-content {
    flex: 1;
    width: 100%;
    height: auto;
    overflow-y: auto;
  }
  .media-hub-topbar {
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .media-hub-topbar h3 {
    font-size: 0.88rem;
  }
  .search-media {
    width: 100%;
  }
  .search-media input {
    height: 34px;
    font-size: 0.78rem;
  }
  .media-grid {
    padding: 10px;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .media-poster-wrap {
    min-height: 190px;
    font-size: 2rem;
  }
  .media-title-box {
    padding: 6px 8px;
  }
  .media-title {
    font-size: 0.75rem;
  }

  /* 5. Modais de Vídeo e Séries */
  .modal-dialog {
    width: 95%;
    max-width: 95%;
    border-radius: var(--radius-md);
  }
  .modal-header {
    padding: 10px 14px;
  }
  .modal-header h4 {
    font-size: 0.88rem;
  }
  .modal-series-body {
    padding: 12px;
    gap: 14px;
  }
  .series-details-header {
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
  }
  .series-modal-poster {
    width: 90px;
    flex-shrink: 0;
  }
  .series-modal-info h3 {
    font-size: 1rem;
  }
  .series-modal-plot {
    font-size: 0.75rem;
    max-height: 60px;
  }
  .seasons-tabs {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .season-tab-btn {
    padding: 4px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  .episodes-list {
    max-height: 240px;
  }
  .episode-item {
    padding: 8px 10px;
  }
  .episode-title {
    font-size: 0.75rem;
  }
  .badge-status-completed,
  .badge-status-progress {
    font-size: 0.65rem;
    padding: 1.5px 6px;
  }
  .btn-next-episode {
    bottom: 62px;
    right: 14px;
    padding: 7px 13px;
    font-size: 0.78rem;
    gap: 6px;
    border-radius: 20px;
  }
  .resume-prompt-card {
    padding: 16px;
    gap: 14px;
  }
  .resume-prompt-icon {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }
  .resume-prompt-titles h4 {
    font-size: 0.95rem;
  }
  .resume-prompt-titles p {
    font-size: 0.8rem;
  }
  .btn-resume {
    padding: 10px 14px;
    font-size: 0.82rem;
  }
  .modal-vod-dialog {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .vod-time-label {
    font-size: 0.7rem;
    min-width: 48px;
  }
  .vod-timeline-container {
    gap: 6px;
  }
  .modal-player-bottom-area {
    gap: 8px;
  }
  .controls-left, .controls-right {
    gap: 6px;
  }
  #vod-volume-slider {
    width: 45px;
  }
  .ctrl-btn {
    width: 34px;
    height: 34px;
  }
  .history-pagination {
    gap: 8px;
  }
  .hist-page-btn {
    padding: 5px 10px;
    font-size: 0.72rem;
  }
  .hist-page-info {
    font-size: 0.72rem;
    min-width: 80px;
  }
  .epg-modal-card {
    width: 95%;
    max-height: 90vh;
  }
  .epg-modal-header {
    padding: 12px 14px;
  }
  .epg-modal-search {
    padding: 8px 14px;
  }
  .epg-modal-search .search-input-wrap input {
    height: 34px;
    font-size: 0.8rem;
    padding: 0 30px 0 10px;
  }
  .epg-modal-body {
    padding: 12px 14px;
  }
}

/* Tablet (769px a 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .media-hub-layout {
    grid-template-columns: 220px 1fr;
  }
  .live-layout {
    grid-template-columns: 220px 260px 1fr;
  }
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 16px;
  }
  .dashboard-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

/* Barra de botões deslizável no player de TV ao vivo em tablets e celular girado na horizontal */
@media (max-width: 1024px), (orientation: landscape) and (max-height: 600px) {
  .player-bottombar {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding-bottom: 2px !important;
    touch-action: pan-x !important;
  }
  .player-bottombar::-webkit-scrollbar {
    display: none !important;
  }
  .controls-left, .controls-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }
  .ctrl-btn {
    width: 34px !important;
    height: 34px !important;
    flex-shrink: 0 !important;
  }
  /* Celular na horizontal: botão de expandir o player visível */
  @media (orientation: landscape) {
    #btn-player-toggle-cols {
      display: inline-flex !important;
    }
  }
}

/* Expansão total do player no modo cinema */
.live-layout.cinema-mode {
  grid-template-columns: 1fr !important;
}
.live-layout.cinema-mode .col-categories,
.live-layout.cinema-mode .col-channels {
  display: none !important;
}
.live-layout.cinema-mode .col-player {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  height: 100% !important;
}
.live-layout.cinema-mode #btn-player-toggle-cols {
  background: var(--accent-cyan) !important;
  color: #000 !important;
}

/* Celular na horizontal (landscape): colunas de categorias e canais à esquerda do player (estilo PC) e barra superior deslizável */
@media (orientation: landscape) and (max-height: 650px) {
  /* Barra superior deslizável sem sobreposição no celular horizontal */
  body.logged-in .app-header,
  .app-header.logged-in {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    touch-action: pan-x !important;
  }
  .app-header.logged-in::-webkit-scrollbar {
    display: none !important;
  }
  .header-left, .header-right {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
  }
  .header-center {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex: 0 0 auto !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .header-epg-reminder {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 4px !important;
    padding: 6px 14px !important;
    gap: 8px !important;
    max-width: none !important;
    width: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4) !important;
  }
  .header-epg-reminder.hidden {
    display: none !important;
  }

  /* Layout Live TV em colunas à esquerda do player (como no computador) */
  .live-layout {
    display: grid !important;
    grid-template-columns: 190px 230px 1fr !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  .col-categories {
    width: 190px !important;
    height: 100% !important;
    max-height: none !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
  }
  .col-categories .col-header,
  .col-categories .search-box {
    display: flex !important;
  }
  .col-categories .categories-list {
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    white-space: normal !important;
    padding: 0 !important;
    gap: 0 !important;
  }
  .col-categories .cat-item {
    border-radius: 0 !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-left: 3px solid transparent !important;
    padding: 8px 12px !important;
  }
  .col-categories .cat-item.active {
    background: rgba(0, 210, 255, 0.1) !important;
    border-left: 3px solid var(--accent-cyan) !important;
    color: var(--accent-cyan) !important;
  }
  .col-categories .cat-count {
    display: inline-block !important;
  }
  .col-channels {
    width: 230px !important;
    height: 100% !important;
    border-right: 1px solid var(--border-color) !important;
    border-bottom: none !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    overflow-y: auto !important;
  }
  .col-player {
    width: 100% !important;
    height: 100% !important;
    flex: 1 !important;
    position: relative !important;
  }

  /* Expansão total do player no modo cinema (oculta as colunas da esquerda) */
  .live-layout.cinema-mode {
    grid-template-columns: 1fr !important;
  }
  .live-layout.cinema-mode .col-categories,
  .live-layout.cinema-mode .col-channels {
    display: none !important;
  }
  .live-layout.cinema-mode .col-player {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    height: 100% !important;
  }
  .live-layout.cinema-mode #btn-player-toggle-cols {
    background: var(--accent-cyan) !important;
    color: #000 !important;
  }

  .epg-modal-card {
    max-height: 94vh !important;
  }
  .epg-modal-header {
    padding: 8px 14px !important;
  }
  .epg-modal-search {
    padding: 6px 14px !important;
  }
  .epg-modal-search .search-input-wrap input {
    height: 32px !important;
  }
  .epg-modal-body {
    padding: 8px 14px !important;
  }

  /* Dashboard no celular horizontal: alinhamento ao topo para não cortar linhas e rolagem suave */
  .dashboard-container {
    height: 100% !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    padding: 10px 16px 50px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .dashboard-welcome {
    margin-bottom: 8px !important;
  }
  .dashboard-welcome h2 {
    font-size: 1.15rem !important;
    margin-bottom: 2px !important;
  }
  .dashboard-welcome p {
    display: none !important;
  }
  .dashboard-cards-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 10px !important;
  }
  .smarters-card {
    padding: 10px 14px !important;
    gap: 6px !important;
  }
  .smarters-card .card-icon {
    font-size: 1.35rem !important;
  }
  .smarters-card h3 {
    font-size: 0.92rem !important;
  }
  .smarters-card p {
    display: none !important;
  }
  .smarters-card .card-footer-info {
    margin-top: 4px !important;
  }
  .continue-watching-section {
    margin-top: 8px !important;
    padding: 12px 14px !important;
    flex-shrink: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .history-rows-selector {
    display: inline-flex !important;
  }

  /* Continuar Assistindo e Favoritos EPG dinamicamente no celular horizontal */
  .history-items-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--history-cols, 3), minmax(0, 1fr)) !important;
    gap: 10px !important;
    max-height: none !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    width: 100% !important;
  }
  .history-card {
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 8px 10px !important;
  }
}

/* Tooltip flutuante e clique na validade da conta (Mobile & PC) */
.account-exp {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: color var(--transition-fast);
}
.account-exp:hover,
.account-exp.active {
  color: var(--accent-cyan) !important;
}

.account-exp-tooltip {
  position: fixed;
  background: rgba(12, 17, 29, 0.98);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 16px rgba(0, 210, 255, 0.4);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  z-index: 999999;
  pointer-events: none;
  animation: expTooltipPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.account-exp-tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 20px;
  width: 8px;
  height: 8px;
  background: rgba(12, 17, 29, 0.98);
  border-left: 1px solid var(--accent-cyan);
  border-top: 1px solid var(--accent-cyan);
  transform: rotate(45deg);
}

@keyframes expTooltipPop {
  0% {
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
