/* ============================================
   BS-TV Online — Site v2
   Style v0.1.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ---------- Design Tokens ---------- */
/* Paleta BS-TV: vermelho, azul, amarelo (cores do logo) + bordas pretas */
:root {
  --bg-primary: #060608;
  --bg-surface: #0e0e12;
  --bg-surface-hover: #16161c;
  --bg-elevated: #1a1a20;
  --bg-card: #121216;

  --accent: #e63946;          /* vermelho — cor principal */
  --accent-glow: rgba(230, 57, 70, 0.2);
  --accent-soft: #ff6b6b;
  --accent-blue: #2563eb;     /* azul do logo */
  --accent-yellow: #eab308;   /* amarelo do logo */
  --live-pulse: #e63946;

  --text-primary: #f0f0f5;
  --text-secondary: #9090a0;
  --text-muted: #55556a;

  --border: #111111;          /* bordas pretas */
  --border-light: #1a1a1a;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, -apple-system, sans-serif;

  --max-width: 1200px;
  --nav-height: 64px;

  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: #5b8def;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 3rem 0;
}

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 6, 8, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, var(--accent), var(--accent-yellow), var(--accent-blue)) 1;
  height: var(--nav-height);
}

.nav__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav__brand img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav__brand span {
  background: linear-gradient(135deg, var(--accent), var(--accent-yellow), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.nav__links a {
  display: block;
  padding: 0.5rem 0.875rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.nav__live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 100px;
  text-decoration: none;
}

.nav__live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: pulse-live 1.5s ease-in-out infinite;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ---------- Hero / Player Section ---------- */
.hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ---------- EPG Bar ---------- */
.epg {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  overflow: hidden;
}

.epg__label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.epg__label .day {
  color: var(--accent-yellow);
  font-weight: 700;
}

.epg__track {
  display: flex;
  gap: 2px;
  width: 100%;
  min-height: 70px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.epg__item {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-left: 3px solid transparent;
  transition: all var(--transition-base);
  cursor: default;
}

.epg__item:hover {
  background: var(--bg-surface-hover);
}

.epg__item--past {
  opacity: 0.4;
}

.epg__item--current {
  background: var(--bg-card);
  border-left-color: var(--accent);
  box-shadow: inset 0 0 20px var(--accent-glow);
  position: relative;
}

.epg__item--current::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--progress, 0%);
  height: 2px;
  background: var(--accent);
  transition: width 60s linear;
}

.epg__item--next {
  opacity: 0.7;
}

.epg__time {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.epg__item--current .epg__time {
  color: var(--accent-soft);
}

.epg__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg__remaining {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
}

.epg__remaining::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse-live 1.5s ease-in-out infinite;
}

.epg__empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Program Cards Grid ---------- */
.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.program-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
}

.program-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.program-card__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-elevated);
}

.program-card__body {
  padding: 1rem;
}

.program-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.program-card__schedule {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- Schedule Table (grade.html) ---------- */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.schedule-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: var(--nav-height);
  z-index: 10;
}

.schedule-table tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.schedule-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.schedule-table .current-row {
  background: rgba(230, 57, 70, 0.08);
  border-left: 3px solid var(--accent);
}

/* ---------- Info Sections ---------- */
.info-block {
  max-width: 720px;
}

.info-block p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.info-block h2 {
  margin-bottom: 1rem;
}

/* ---------- Social Links ---------- */
.social-links {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.social-link:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--accent-blue);
}

/* ---------- Partners Section ---------- */
.partners {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
  opacity: 0.6;
  transition: opacity var(--transition-base);
}

.partners:hover {
  opacity: 1;
}

.partners img {
  height: 48px;
  filter: grayscale(1) brightness(1.5);
  transition: filter var(--transition-base);
}

.partners img:hover {
  filter: none;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 2px solid;
  border-image: linear-gradient(90deg, var(--accent-blue), var(--accent-yellow), var(--accent)) 1;
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer a {
  color: var(--text-secondary);
}

/* ---------- Utilities ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--live {
  background: var(--accent);
  color: white;
}

.badge--free {
  background: #10b981;
  color: white;
}

.badge--category {
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ---------- Download Button ---------- */
.download-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--accent-red);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition-base);
}

.download-btn:hover {
  background: #c62d38;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(230, 57, 70, 0.3);
}

/* ---------- Afiliadas ---------- */
.affiliates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
}

.affiliate-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--transition-base);
}

.affiliate-card:hover {
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.affiliate-card__logo {
  max-width: 120px;
  height: auto;
  margin: 0 auto 0.75rem;
  display: block;
}

.affiliate-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.affiliate-card__region {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    bottom: auto;
    flex-direction: column;
    background: rgba(6, 6, 8, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.5rem;
    gap: 0;
    z-index: 99;
    border-radius: 0 0 0 12px;
    border: 1px solid rgba(255,255,255,0.06);
    border-top: none;
    border-right: none;
    min-width: 200px;
    box-shadow: -4px 8px 24px rgba(0,0,0,0.5);
  }

  .nav__links.open {
    display: flex;
  }

  .nav__links a {
    padding: 0.875rem 1.25rem;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: background 0.15s ease;
  }

  .nav__links a:hover,
  .nav__links a:active {
    background: rgba(255,255,255,0.06);
  }

  .nav__toggle {
    display: block;
  }

  .player-wrapper {
    border-radius: 0;
  }

  .epg__track {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .epg__item {
    min-width: 200px;
    scroll-snap-align: start;
    flex: 0 0 auto;
  }

  .programs-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2rem 0;
  }
}
