*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #0f0f0f;
  color: #e0e0e0;
  font-family: Arial, sans-serif;
  height: 100vh;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
  flex-shrink: 0;
  gap: 12px;
  z-index: 100;
}

.logo {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logo i {
  font-size: 18px;
  color: #e50914;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a2a2a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 6px 12px;
  width: 220px;
}

.search-wrap i {
  font-size: 15px;
  color: #888;
  flex-shrink: 0;
}

.search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: #e0e0e0;
  font-size: 13px;
  width: 100%;
  min-width: 0;
}

.search-wrap input::placeholder {
  color: #666;
}

/* Hamburger — mobile only */
.menu-btn {
  display: none;
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.menu-btn:hover {
  color: #fff;
  background: #2a2a2a;
}
.menu-btn i {
  font-size: 22px;
}

/* Layout */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar */
.sidebar {
  width: 180px;
  background: #161616;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.25s ease;
  z-index: 50;
}

.categories {
  display: flex;
  flex-direction: column;
  padding: 12px 8px;
  gap: 2px;
  border-bottom: 1px solid #222;
}

.cat {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  color: #999;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.cat i {
  font-size: 15px;
  flex-shrink: 0;
}
.cat:hover {
  background: #222;
  color: #ddd;
}
.cat.active {
  background: #2a2a2a;
  color: #fff;
}

.section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  padding: 12px 14px 6px;
}

.channel-list-wrap {
  flex: 1;
  overflow-y: auto;
}
.channel-list-wrap::-webkit-scrollbar {
  width: 4px;
}
.channel-list-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.channel-list-wrap::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}

.channel-list {
  list-style: none;
  padding: 0 8px 12px;
}

.channel-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #aaa;
  transition:
    background 0.15s,
    color 0.15s;
}

.channel-list li:hover {
  background: #222;
  color: #fff;
}
.channel-list li.active {
  background: #222;
  color: #fff;
}

.ch-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #444;
  flex-shrink: 0;
}

.channel-list li.active .ch-dot {
  background: #e50914;
}

/* Overlay backdrop — mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
}

.sidebar-backdrop.visible {
  display: block;
}

/* Content */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #111;
  min-width: 0;
}

.player-wrap {
  flex: 1;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.no-stream {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #444;
  pointer-events: none;
}

.no-stream i {
  font-size: 40px;
}
.no-stream span {
  font-size: 13px;
}
.no-stream.hidden {
  display: none;
}

/* Info bar */
.info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #1a1a1a;
  border-top: 1px solid #222;
  flex-shrink: 0;
  min-height: 48px;
  gap: 8px;
}

.info-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.channel-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: #666;
  flex-wrap: wrap;
}

.info-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(229, 9, 20, 0.15);
  border: 1px solid rgba(229, 9, 20, 0.35);
  color: #e50914;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: #e50914;
  border-radius: 50%;
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.bitrate,
.audio-codec {
  font-size: 11px;
  color: #666;
}

.fs-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}

.fs-btn:hover {
  color: #fff;
  background: #2a2a2a;
}
.fs-btn i {
  font-size: 16px;
}

/* ── Mobile ── */
@media (max-width: 640px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
  }

  .menu-btn {
    display: flex;
  }

  .search-wrap {
    width: auto;
    flex: 1;
  }

  /* Sidebar slides in as a drawer */
  .sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: 220px;
    transform: translateX(-100%);
    z-index: 50;
    border-right: 1px solid #2a2a2a;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    flex-direction: column;
    overflow: visible;
  }

  /* Player full width, 16:9 */
  .player-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    flex: none;
    height: auto;
  }

  .player-wrap video {
    height: 100%;
  }

  .content {
    overflow: visible;
  }

  /* Info bar wraps on small screens */
  .info-bar {
    flex-wrap: wrap;
    min-height: auto;
    padding: 8px 12px;
    gap: 6px;
  }

  .info-left {
    flex: 1;
    min-width: 0;
  }

  .info-right {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  /* Hide less important stats on small screens */
  .bitrate,
  .audio-codec {
    display: none;
  }
}

/* ── Tablet ── */
@media (min-width: 641px) and (max-width: 900px) {
  .sidebar {
    width: 150px;
  }

  .cat span {
    display: none;
  }

  .search-wrap {
    width: 160px;
  }

  .bitrate {
    display: none;
  }
}

/* Volume */
.vol-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 72px;
  height: 3px;
  border-radius: 2px;
  background: #444;
  outline: none;
  cursor: pointer;
  accent-color: #fff;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

/* Quality */
.quality-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #666;
  font-size: 13px;
}

.quality-wrap i {
  font-size: 15px;
}

.quality-wrap select {
  background: #2a2a2a;
  border: 1px solid #333;
  color: #ccc;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  max-width: 80px;
}

.quality-wrap select:hover {
  border-color: #555;
}

/* Shared icon button */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition:
    color 0.15s,
    background 0.15s;
}

.icon-btn:hover {
  color: #fff;
  background: #2a2a2a;
}
.icon-btn i {
  font-size: 16px;
}

/* Reload spin animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.spinning {
  animation: spin 0.6s linear infinite;
}

/* Hide volume slider on very small screens */
@media (max-width: 640px) {
  .vol-slider {
    width: 50px;
  }
  .quality-wrap select {
    max-width: 60px;
  }
}
