/*
Theme Name: Live TV Stream
Theme URI: https://example.com
Author: Your Name
Description: A responsive Live TV streaming WordPress theme. Add channels with m3u8 (HLS) links from the dashboard, customize your logo, Telegram promo, social links, ad spaces, and announcement ticker — all from the Customizer.
Version: 1.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: livetv-stream
*/

/* ====== Reset ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', 'Noto Sans Bengali', Tahoma, sans-serif;
  background: #0f0f12;
  color: #f1f1f1;
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

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

/* ====== Header ====== */
.site-header {
  background: #16161c;
  border-bottom: 1px solid #26262e;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-branding img {
  height: 40px;
  width: auto;
}

.site-title {
  font-size: 22px;
  font-weight: 700;
  color: #ff3b3b;
  letter-spacing: 0.5px;
}

.site-title a {
  display: block;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  gap: 22px;
}

.main-navigation a {
  font-weight: 600;
  font-size: 15px;
  color: #d4d4d8;
  transition: color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation a.active {
  color: #ff3b3b;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #f1f1f1;
  font-size: 26px;
  cursor: pointer;
}

/* ====== Layout ====== */
.live-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ====== Player Section ====== */
.player-wrap {
  background: #16161c;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.live-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #ff3b3b;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.live-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1.4s infinite;
}

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

.player-info {
  padding: 16px 20px;
}

.player-info h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.player-info .meta {
  font-size: 14px;
  color: #9a9aa3;
}

.player-info .description {
  margin-top: 10px;
  font-size: 14px;
  color: #c5c5cc;
}

.player-error {
  display: none;
  padding: 40px 20px;
  text-align: center;
  color: #ff7b7b;
  font-size: 15px;
}

/* ====== Channel List Sidebar ====== */
.channel-sidebar {
  background: #16161c;
  border-radius: 14px;
  padding: 16px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  position: sticky;
  top: 90px;
}

.channel-sidebar h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #26262e;
}

.category-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.category-filters button {
  background: #26262e;
  border: none;
  color: #d4d4d8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-filters button:hover,
.category-filters button.active {
  background: #ff3b3b;
  color: #fff;
}

.channel-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: #1d1d24;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.channel-item:hover {
  background: #26262e;
  transform: translateX(-2px);
}

.channel-item.active {
  background: #ff3b3b1a;
  border: 1px solid #ff3b3b;
}

.channel-item .logo {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #0f0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.channel-item .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-item .info {
  flex: 1;
  min-width: 0;
}

.channel-item .name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-item .cat {
  font-size: 12px;
  color: #9a9aa3;
}

.channel-item .live-dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ====== Channel Grid (Archive Page) ====== */
.channel-grid-wrap {
  padding: 24px 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.channel-grid-wrap h1 {
  font-size: 26px;
  margin-bottom: 20px;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.channel-card {
  background: #16161c;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.channel-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(255,59,59,0.15);
}

.channel-card .logo {
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: #0f0f12;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.channel-card .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.channel-card .name {
  font-size: 14px;
  font-weight: 600;
}

.channel-card .cat {
  font-size: 12px;
  color: #9a9aa3;
  margin-top: 4px;
}

/* ====== Footer ====== */
.site-footer {
  background: #16161c;
  border-top: 1px solid #26262e;
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: #9a9aa3;
}

/* ====== Responsive ====== */
@media (max-width: 1024px) {
  .live-layout {
    grid-template-columns: 1fr;
  }
  .channel-sidebar {
    max-height: 420px;
    position: static;
  }
}

@media (max-width: 768px) {
  .main-navigation {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #16161c;
    border-bottom: 1px solid #26262e;
    padding: 10px 20px;
  }
  .main-navigation.open {
    display: block;
  }
  .main-navigation ul {
    flex-direction: column;
    gap: 14px;
    padding: 10px 0;
  }
  .menu-toggle {
    display: block;
  }
  .live-layout {
    padding: 12px;
    gap: 12px;
  }
  .player-info h1 {
    font-size: 18px;
  }
  .channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 18px;
  }
  .player-info {
    padding: 12px 14px;
  }
  .channel-sidebar {
    padding: 12px;
  }
}

/* ====== Promo Bar (Telegram) ====== */
.promo-bar {
  background: #ff3b3b;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
  text-align: center;
  position: relative;
}

.promo-bar .promo-icon {
  margin-right: 4px;
}

.promo-bar a.promo-btn {
  background: #fff;
  color: #ff3b3b;
  padding: 5px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.promo-bar .promo-close {
  background: rgba(255,255,255,0.25);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 600px) {
  .promo-bar {
    font-size: 12px;
    padding: 10px 40px 10px 14px;
  }
}

/* ====== News Ticker ====== */
.news-ticker {
  background: #1d1d24;
  border-bottom: 1px solid #26262e;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 36px;
}

.news-ticker .ticker-label {
  background: #ff3b3b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  letter-spacing: 1px;
}

.news-ticker .ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.news-ticker .ticker-text {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-scroll 25s linear infinite;
  font-size: 13px;
  color: #d4d4d8;
}

@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

/* ====== Floating Telegram Button ====== */
.telegram-float {
  position: fixed;
  bottom: 22px;
  right: 22px;
  width: 56px;
  height: 56px;
  background: #ff3b3b;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  z-index: 999;
  transition: transform 0.2s ease;
}

.telegram-float:hover {
  transform: scale(1.08);
}

@media (max-width: 600px) {
  .telegram-float {
    width: 48px;
    height: 48px;
    bottom: 16px;
    right: 16px;
  }
  .telegram-float svg {
    width: 22px;
    height: 22px;
  }
}

/* ====== Social Links in Nav ====== */
.social-links {
  list-style: none;
  display: flex;
  gap: 14px;
  margin-top: 0;
}

.social-links a {
  font-size: 18px;
  display: block;
  transition: transform 0.2s ease;
}

.social-links a:hover {
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .social-links {
    margin-top: 14px;
    border-top: 1px solid #26262e;
    padding-top: 14px;
  }
}

@media (min-width: 769px) {
  .main-navigation {
    display: flex;
    align-items: center;
    gap: 24px;
  }
}

/* ====== Ad Slots ====== */
.ad-slot {
  max-width: 1600px;
  margin: 12px auto;
  padding: 0 20px;
  text-align: center;
  overflow: hidden;
}

.ad-slot.ad-header {
  margin-top: 0;
  padding-top: 12px;
}

.ad-slot.ad-below-player {
  padding: 14px 20px 0;
}

.ad-slot.ad-sidebar {
  margin: 0 0 14px 0;
  padding: 0;
}

.ad-slot.ad-footer {
  padding: 20px;
}

/* ====== Schedule Note ====== */
.schedule-note {
  margin-top: 8px;
  display: inline-block;
  background: #26262e;
  color: #ffd166;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
}

/* ====== Sidebar Widgets ====== */
.sidebar-widgets .widget {
  margin-bottom: 16px;
}

.sidebar-widgets .widget-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ====== No Channels Message ====== */
.no-channels {
  padding: 14px;
  color: #9a9aa3;
  font-size: 14px;
}

/* ====== Footer Disclaimer ====== */
.footer-disclaimer {
  margin-top: 6px;
  font-size: 12px;
  color: #7a7a82;
}
