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

body {
  background-color: #050712;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 32px;
  background: linear-gradient(to bottom, #050712, rgba(5, 7, 18, 0.6));
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.1em;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tabs {
  display: flex;
  gap: 12px;
}

.tab {
  background: transparent;
  border: none;
  color: #c1c7f5;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tab.active {
  background: #ffffff;
  color: #050712;
}

.main {
  flex: 1;
  padding: 0 32px 40px;
}

.search-section {
  display: none;
  margin-top: 12px;
  margin-bottom: 10px;
}

.search-section.visible {
  display: block;
}

.search-global {
  width: 260px;
}

.search-global input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 255, 0.8);
  background: #020617;
  color: #e5e7ff;
  font-size: 13px;
}

.page {
  display: none;
}

.page.visible {
  display: block;
}

.hero {
  position: relative;
  height: 260px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at top left, #2e3cf8, #050712 55%);
  margin-top: 12px;
  margin-bottom: 32px;
}

.hero-content {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
}

.hero-info {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.hero-tagline {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: #9ca3ff;
}

.hero-title {
  font-size: 26px;
  font-weight: 700;
}

.hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #e5e7ff;
}

.hero-description {
  font-size: 14px;
  color: #d1d5ff;
  max-width: 460px;
}

.hero-button {
  margin-top: 8px;
  padding: 10px 20px;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #050712;
}

.hero-button-secondary {
  margin-left: 10px;
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7ff;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 255, 0.6);
  font-size: 13px;
  cursor: pointer;
}

.hero-poster-wrapper {
  position: relative;
}

.hero-poster {
  position: absolute;
  inset: 16px 16px 16px 0;
  display: flex;
  justify-content: flex-end;
}

.hero-poster img {
  width: auto;
  height: 100%;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.9);
}

.rows {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.rows-page {
  margin-top: 8px;
}

.row h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 0 4px;
  cursor: grab;
  scrollbar-width: none;
}

.cards::-webkit-scrollbar {
  display: none;
}

.cards.dragging {
  cursor: grabbing;
}

.card {
  background: #0b0f1f;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  flex: 0 0 120px;
  max-width: 120px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

.card-body {
  padding: 6px 8px 10px;
}

.card-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3ff;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.8);
}

.page-title {
  font-size: 22px;
  margin: 20px 0;
}

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

.page-channels {
  margin-top: 20px;
}

.channels-player-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 16px;
  height: calc(100vh - 110px);
}

.channel-player {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.channel-player-video {
  flex: 1;
  min-height: 260px;
}

.channel-player-video iframe {
  width: 100%;
  border: none;
  height: 100%;
}

.epg-guide {
  background: #020617;
  border-top: 1px solid rgba(148, 163, 255, 0.25);
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.epg-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #e5e7ff;
}

.epg-title {
  font-weight: 600;
}

.epg-date {
  color: #9ca3ff;
}

.epg-timeline {
  display: flex;
  gap: 24px;
  font-size: 11px;
  color: #c7d2fe;
  padding: 4px 0;
  border-top: 1px solid rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.9);
}

.epg-programs {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.epg-card {
  min-width: 220px;
  max-width: 260px;
  background: #020617;
  border-radius: 8px;
  border: 1px solid rgba(30, 64, 175, 0.6);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.epg-card-current {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.5);
}

.epg-card-title {
  font-size: 13px;
  font-weight: 600;
}

.epg-card-time {
  font-size: 11px;
  color: #9ca3ff;
}

.epg-card-extra {
  font-size: 10px;
  color: #6b7280;
}

.channel-list-wrapper {
  background: #050816;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.channel-search {
  padding: 10px;
  border-bottom: 1px solid rgba(148, 163, 255, 0.25);
}

.channel-search input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 255, 0.8);
  background: #020617;
  color: #e5e7ff;
  font-size: 13px;
}

.channel-list {
  flex: 1;
  overflow-y: auto;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.channel-item:hover {
  background: rgba(15, 23, 42, 0.85);
}

.channel-item.active {
  background: rgba(55, 65, 194, 0.85);
}

.channel-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  background: #dc2626;
  margin-right: 4px;
}

.channel-thumb {
  width: 58px;
  height: 34px;
  background: linear-gradient(135deg, #4f46e5, #ec4899);
  border-radius: 6px;
  flex-shrink: 0;
}

.channel-name-block {
  display: flex;
  flex-direction: column;
}

.channel-name {
  font-size: 13px;
}

.channel-sub {
  font-size: 11px;
  color: #9ca3ff;
}

.player-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}

.player-overlay.visible {
  display: flex;
}

.player-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.player-overlay-content {
  position: relative;
  max-width: 960px;
  width: 100%;
  margin: 0 16px;
  background: #020617;
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9);
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1;
}

.player-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.player-title {
  font-size: 18px;
  font-weight: 600;
}

.player-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #9ca3ff;
}

.player-close {
  border: none;
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7ff;
  border-radius: 999px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.player-frame-container {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  min-height: 220px;
}

.player-frame-container iframe {
  width: 100%;
  height: 420px;
  border: none;
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .top-bar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
  }

  .search-global {
    width: 100%;
  }

  .hero {
    height: 230px;
  }

  .hero-content {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .channels-player-wrapper {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(200px, 240px) minmax(0, 1fr);
    height: auto;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 0 16px 24px;
  }

  .hero {
    height: 210px;
  }

  .hero-content {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }

  .hero-title {
    font-size: 22px;
  }

  .cards {
    gap: 8px;
  }

  .card {
    flex-basis: 110px;
    max-width: 110px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* Streaming Platforms Section */
.streaming-list {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}

.streaming-list::-webkit-scrollbar {
  display: none;
}

.streaming-item {
  flex: 0 0 auto;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
  background-color: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.streaming-item:hover {
  transform: scale(1.1);
  border-color: #fff;
}

.streaming-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  display: block;
}

/* Specific styling for logos that need padding or background adjustment */
.streaming-item.has-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.streaming-item.contain-mode img {
  object-fit: contain;
  padding: 12px; /* Add some padding so logos don't touch edges in contain mode */
}

/* Channel Options */
.channel-options {
  display: flex;
  gap: 10px;
  padding: 10px;
  background-color: #1a1a1a;
  border-bottom: 1px solid #333;
}

.channel-btn {
  padding: 8px 16px;
  background-color: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.channel-btn:hover {
  background-color: #4f46e5;
}

.channel-btn.active {
  background-color: #4f46e5;
  font-weight: bold;
}

/* Filter Buttons */
.channel-filters {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 10px;
}

.filter-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #c1c7f5;
  padding: 8px 4px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.filter-btn.active {
  background: #3b82f6; /* Blue similar to the screenshot Option 1 */
  color: #ffffff;
  border-color: #3b82f6;
}

.channel-search {
  margin-bottom: 12px;
}

