/* ==========================================
   Global Base Theme
   ========================================== */
:root {
  --bg: #0a0a0f;
  --card: #15151d;
  --accent: #e50914;
  --text: #fff;
  --muted: #aaa;
  --radius: 14px;
  --border: #222;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  margin: 0;
  padding: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ==========================================
   Header Navigation
   ========================================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 40px;
}

header .logo {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

header .logo span {
  color: #e50914;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 5px #e50914; }
  to { text-shadow: 0 0 15px #ff4b4b; }
}

header nav a {
  color: #ccc;
  margin-left: 25px;
  font-weight: 500;
  transition: 0.3s;
}

header nav a:hover {
  color: #fff;
}

header nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

/* ==========================================
   Player Section
   ========================================== 
#player-section {
  margin-top: 120px;
  text-align: center;
}

.video-player {
  width: 80%;
  max-width: 800px;
  height: 420px;
  border-radius: 10px;
  background: #000;
  border: 2px solid #111;
  box-shadow: 0 0 20px rgba(0,0,0,0.6);
} */

#playerTitle {
  margin-top: 15px;
  font-size: 22px;
  font-weight: 700;
}

#playerCategory {
  color: var(--muted);
  font-size: 14px;
}

/* ==========================================
   Toolbar + Search
   ========================================== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  background: #1a1a1a;
  color: #fff;
  outline: none;
  min-width: 200px;
}

.toolbar-right {
  display: flex;
  gap: 10px;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  border: none;
  font-size: 14px;
}

.btn-light {
  background: #222;
  color: #ddd;
}
.btn-light:hover { background: #2b2b2b; }

.btn-save {
  background: var(--accent);
  color: #fff;
}
.btn-save:hover { background: #ff1722; }

.btn-delete {
  background: #fff;
  color: #000;
  margin-left: 8px;
}
.btn-delete:hover {
  background: var(--accent);
  color: #fff;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 12px 0;
  text-align: center;
}
.alert.success { background: #103a24; color: #cfe9dd; }
.alert.danger { background: #3a1010; color: #f5cccc; }

/* ==========================================
   Tabs (Main + Sub)
   ========================================== */
.category-tabs {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  justify-content: flex-start;
  gap: 10px;
  margin: 10px 0 25px;
  padding-bottom: 5px;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  background: #1a1a1a;
  border: none;
  color: #ddd;
  padding: 10px 20px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  flex-shrink: 0;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
}
.tab-btn:hover { background: #2a2a2a; }

/* ==========================================
   Channel Grid (Live TV)
   ========================================== */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
  margin-top: 20px;
  justify-items: center;
  align-items: stretch;
}

.channel-card {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid #1d1d1d;
  width: 100%;
  max-width: 145px;
  position: relative;
}
.channel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(229, 9, 20, 0.3);
}

/* Logo area */
.channel-card .logo-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.channel-card img {
  width: 60%;
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}
.channel-card:hover img { transform: scale(1.05); }

/* Info */
.channel-info {
  padding: 10px 8px 12px;
}
.channel-info h3 {
  font-size: 12px;
  margin: 4px 0;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.channel-info p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

/* Responsive grid adjustments */
@media (max-width: 1400px) {
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 1100px) {
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 900px) {
  .channel-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
}
/* ✅ Mobile: exactly 2 columns */
@media (max-width: 600px) {
  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 10px;
  }
  .channel-card {
    min-width: unset;
    max-width: unset;
    width: 100%;
  }
  .channel-card img { width: 70%; }
}

/* ==========================================
   Manage Page Layout
   ========================================== */
.manage-section {
  max-width: 1200px;
  margin: 120px auto;
  padding: 20px;
}

.channel-table {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.channel-row {
  display: flex;
  gap: 22px;
  background: #1b1b1b;
  border: 1px solid #2a2a2a;
  padding: 20px;
  border-radius: 12px;
  align-items: flex-start;
}

.logo-cell {
  flex: 0 0 180px;
}

.logo-cell img {
  width: 150px;
  height: 90px;
  object-fit: contain;
  background: #000;
  border-radius: 6px;
  margin-bottom: 10px;
}

.no-logo {
  width: 150px;
  height: 90px;
  background: #2a2a2a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  margin-bottom: 10px;
}

.field-label {
  font-size: 12px;
  color: #aaa;
  margin: 8px 0 6px;
  display: block;
}

.info-cell {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.info-cell input,
.info-cell select {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #2a2a2a;
  color: #fff;
  margin-bottom: 10px;
}

.flex { display: flex; gap: 12px; }
.flex-1 { flex: 1; }

.action-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

/* ==========================================
   Stylish Upload Button
   ========================================== */
.file-btn {
  position: relative;
  display: inline-block;
  background: linear-gradient(145deg, #222, #111);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  overflow: hidden;
  margin-top: 6px;
  text-align: center;
  font-size: 14px;
}
.file-btn input[type="file"] {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.file-btn:hover {
  background: linear-gradient(145deg, #333, #111);
  transform: scale(1.03);
  transition: all 0.2s;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 900px) {
  .channel-row { flex-direction: column; }
  .logo-cell { flex: auto; }
  .action-cell { align-items: stretch; }
  .video-player { width: 95%; height: 300px; }
}

/* Add top spacing below fixed header */
body:not(.home) main { margin-top: 70px; }

/* ===============================
   Smaller logo size on homepage
   =============================== */
body.home .channel-card img { width: 40%; height: auto; }
body.home .channel-card { max-width: 130px; }

/* ===============================
   Hero Section
   =============================== */
.hero-section {
  position: relative;
  text-align: center;
  color: #fff;
  background: url('/assets/hero-bg.jpg') center/cover no-repeat;
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 20px;
}
.hero-section::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.95));
  z-index: 1;
}
.hero-content { position: relative; z-index: 2; max-width: 700px; }
.hero-content h1 {
  font-size: 3rem; font-weight: 800; line-height: 1.1; margin-bottom: 15px;
}
.hero-content p { font-size: 1.1rem; color: #ccc; margin-bottom: 25px; }

.hero-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-buttons a {
  background: #e50914;
  color: #fff;
  padding: 12px 26px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
}
.hero-buttons a.secondary {
  background: #1a1a1a;
  border: 1px solid #333;
}
.hero-buttons a:hover { background: #ff1b25; }

/* ✅ Mobile Fixes */
@media (max-width: 768px) {
  .hero-content h1 { font-size: 2rem; }
  .hero-content p { font-size: 0.95rem; }
  .hero-buttons { flex-direction: column; gap: 10px; }
  .hero-buttons a { width: 90%; max-width: 320px; }
}

/* ==========================================================
   Premium Carousel / Card Styles for Homepage Sections
   ========================================================== */
.channel-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.channel-carousel::-webkit-scrollbar { display: none; }

.channel-card {
  min-width: 150px;
  flex-shrink: 0;
  background: #0d0d0d;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  scroll-snap-align: start;
}
.channel-card:hover {
  transform: scale(1.06);
  box-shadow: 0 0 18px rgba(229,9,20,0.35);
}
.channel-thumb {
  background: #000;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.channel-thumb img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.channel-card:hover img { transform: scale(1.05); }
.channel-meta {
  padding: 10px 8px 14px;
  text-align: center;
}
.channel-meta h3 {
  color: #fff;
  font-size: 13px;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Section titles + "View All" */
section h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
}
section a[href*="View All"] {
  color: #e50914;
  text-decoration: none;
  font-weight: 600;
}

/* Mobile layout improvements */
@media (max-width: 768px) {
  section { padding: 20px 20px !important; }
  .channel-card { min-width: 120px; }
  .channel-meta h3 { font-size: 12px; }
}
/* ===============================
   📱 Live TV Mobile Fixes
   =============================== */
@media (max-width: 768px) {
  /* ✅ 2-column grid on mobile */
  .channel-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 10px 80px;
  }

  /* ✅ Bigger logos and proper sizing */
  .channel-card {
    width: 100%;
    max-width: none;
    background: #111;
    border-radius: 10px;
  }
  .channel-card .logo-wrapper {
    aspect-ratio: 16 / 9;
    background: #000;
  }
  .channel-card img {
    width: 90%;
    height: auto;
    object-fit: contain;
  }
  .channel-info h3 {
    font-size: 13px;
    color: #fff;
    margin: 6px 0;
  }

  /* ✅ Fix for subcategory tabs visibility */
  .category-tabs,
  .tabs-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding: 10px 10px 5px;
    scrollbar-width: none;
  }
  .category-tabs::-webkit-scrollbar,
  .tabs-container::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex-shrink: 0;
    scroll-snap-align: start;
    background: #1a1a1a;
    border: none;
    color: #ddd;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
  }
  .tab-btn.active {
    background: var(--accent);
    color: #fff;
  }

  /* ✅ Beautified mobile search bar */
  .search-bar {
    display: flex;
    justify-content: center;
    padding: 10px;
    margin: 10px 0 20px;
  }
  .search-bar input {
    width: 100%;
    max-width: 95%;
    padding: 12px 14px;
    border-radius: 30px;
    border: 1px solid #2a2a2a;
    background: #111;
    color: #fff;
    font-size: 14px;
    outline: none;
  }
  .search-bar input::placeholder {
    color: #777;
  }
}
/* ===============================
   📱 Adjust Logo Size on Mobile
   =============================== */
@media (max-width: 768px) {
  .channel-card img {
    width: 70%;
    max-width: 80px;
    height: auto;
    object-fit: contain;
  }

  .channel-info h3 {
    font-size: 12px;
    line-height: 1.2;
  }

  .channel-card {
    padding-bottom: 6px;
    border-radius: 10px;
  }

  /* Keep the grid as 2 columns */
  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 10px 80px;
  }
}
/* ==========================================
   🔧 Force 2-column layout on mobile (Live TV)
   ========================================== */
@media (max-width: 768px) {
  .channel-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
    padding: 10px 12px 90px !important;
    justify-items: center !important;
    align-items: start !important;
  }

  .channel-card {
    width: 100% !important;
    max-width: none !important;
    background: #111;
    border-radius: 10px;
  }

  .channel-card .logo-wrapper {
    aspect-ratio: 16 / 9;
  }

  .channel-card img {
    width: 75% !important;
    height: auto !important;
    object-fit: contain;
  }

  .channel-info h3 {
    font-size: 12px !important;
    color: #fff;
    margin: 6px 0 !important;
    text-align: center;
  }
}
/* ==========================================
   🎬 Force Larger Movie Logos on Mobile
   ========================================== */
@media (max-width: 768px) {
  /* Target any movie card grid or page */
  body.movies-page .channel-card img,
  body[data-page="movies"] .channel-card img,
  .movies-page .channel-card img,
  .channel-grid.movies .channel-card img,
  .channel-grid[data-section="movies"] .channel-card img,
  .channel-grid .channel-card img {
    width: 95% !important;
    max-width: 130px !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Slightly enlarge card to fit bigger logos */
  body.movies-page .channel-card,
  .channel-grid.movies .channel-card {
    max-width: 160px !important;
  }

  /* Optional text adjustment */
  .channel-info h3 {
    font-size: 13px !important;
    line-height: 1.3;
  }
}
/* ==========================================
   🏠 Homepage — Responsive 2-column layout
   ========================================== */
@media (max-width: 768px) {
  body.home .channel-carousel {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px !important;
    overflow-x: hidden !important;
    padding: 10px 14px 80px !important;
  }

  body.home .channel-card {
    width: 100% !important;
    border-radius: 12px;
    background: #111;
  }

  body.home .channel-card img {
    width: 85% !important;
    max-width: 110px !important;
    height: auto !important;
    object-fit: contain !important;
  }

  body.home .channel-meta h3 {
    font-size: 12px !important;
    text-align: center;
    color: #fff;
  }

  body.home section {
    padding: 20px 14px !important;
  }

  body.home section h2 {
    font-size: 18px !important;
  }

  body.home .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}
/* ==========================================
   🎬 Inline "View All" beside heading
   ========================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 15px;
  gap: 8px;
}

.section-header h2 {
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-header .view-all {
  color: #e50914;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s;
}

.section-header .view-all:hover {
  color: #ff3b3b;
}

/* Smaller, inline layout on mobile */
@media (max-width: 768px) {
  .section-header h2 {
    font-size: 18px;
    gap: 6px;
  }
  .section-header .view-all {
    font-size: 14px;
  }
}
.auth-page {
  max-width: 400px;
  margin: 100px auto;
  text-align: center;
  background: #111;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(229,9,20,0.2);
}
.auth-page input {
  width: 90%;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #333;
  border-radius: 6px;
  background: #222;
  color: #fff;
}
.auth-page button {
  background: #e50914;
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
}
.auth-page button:hover {
  background: #ff1a1a;
}
/* --- My Account Dropdown --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  background: transparent;
  color: #ccc;
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 6px;
}

.dropbtn:hover {
  background: #151515;
  color: #fff;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: #111;
  min-width: 150px;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  z-index: 9999;
}

.dropdown-content a {
  color: #ccc;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  font-size: 14px;
}

.dropdown-content a:hover {
  background-color: #1a1a1a;
  color: #fff;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown:hover .dropbtn {
  color: #fff;
  background: #151515;
}
/* ==== Header Logout Button ==== */
.header-logout-form {
  display: inline-block;
  margin-left: 10px;
}

.header-logout-btn {
  background: #e50914;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.25s ease;
}

.header-logout-btn:hover {
  background: #ff1b25;
}

/* On mobile screens */
@media (max-width: 768px) {
  .header-logout-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 16px;
    font-size: 15px;
  }
}

</* --- Action Buttons Cleanup --- */
.user-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-actions select {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.user-actions select:focus {
  border-color: #e50914;
  outline: none;
}

.user-actions button {
  background: #e50914;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
}

.user-actions button:hover {
  background: #ff1b25;
}

.user-actions .delete-btn {
  background: transparent;
  border: 1px solid #e50914;
  color: #e50914;
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.user-actions .delete-btn:hover {
  background: #e50914;
  color: #fff;
}
.channel-carousel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding: 10px 20px;
}

.channel-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.channel-card:hover {
  transform: scale(1.12);
  z-index: 10;
  box-shadow: 0 10px 20px rgba(0,0,0,0.6);
}

.channel-thumb img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.channel-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.channel-meta h3 {
  margin: 0;
  font-size: 14px;
  color: #fff;
}
