* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
  color: #333;
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 15px 20px;
  font-size: 28px;
  font-weight: bold;
  background: linear-gradient(90deg, #4a6fa5, #6b93c5);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo span {
  color: #f8f9fa;
  margin-left: 5px;
}

#categories-container {
  position: relative;
  max-width: 1200px;
  margin: 0 auto 20px;
  padding: 0 20px;
}

#categories {
  display: flex;
  overflow-x: auto;
  padding: 10px 5px;
  gap: 10px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#categories::-webkit-scrollbar { display: none; }

.category-btn {
  flex: 0 0 auto;
  padding: 12px 24px;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
  background: #6c757d;
  white-space: nowrap;
  font-size: 16px;
}
.category-btn.active {
  background: #4a6fa5;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(74, 111, 165, 0.4);
}
.category-btn:hover {
  background: #5a6268;
  transform: scale(1.05);
}

.scroll-indicator {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(108, 117, 125, 0.7);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.3s;
  color: white;
  font-weight: bold;
}
.scroll-indicator:hover { opacity: 1; }
.scroll-left { left: 5px; }
.scroll-right { right: 5px; }

#searchBox {
  display: block;
  margin: 10px auto 20px;
  padding: 12px 15px;
  width: 90%;
  max-width: 500px;
  border-radius: 25px;
  border: 1px solid #ced4da;
  font-size: 16px;
  background: white;
  color: #333;
  outline: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
#searchBox::placeholder { color: #6c757d; }
#searchBox:focus {
  border-color: #4a6fa5;
  box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.2);
}

.category-section {
  margin-bottom: 30px;
  padding: 0 20px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.category-title {
  font-size: 22px;
  margin-bottom: 15px;
  padding-bottom: 8px;
  border-bottom: 2px solid;
  display: inline-block;
  color: #4a6fa5;
}
.Sports .category-title { color: #007bff; border-bottom-color: #007bff; }
.News .category-title { color: #dc3545; border-bottom-color: #dc3545; }
.Entertainment .category-title { color: #fd7e14; border-bottom-color: #fd7e14; }
.Documentary .category-title { color: #6f42c1; border-bottom-color: #6f42c1; }

.channels-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
  padding: 10px 0;
}
.channel {
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  color: white;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  position: relative;
  overflow: hidden;
}
.channel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s;
}
.channel:hover::before { opacity: 1; }

.channel.Sports { background: #007bff; }
.channel.News { background: #dc3545; }
.channel.Entertainment { background: #fd7e14; }
.channel.Documentary { background: #6f42c1; }

.channel:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}
.channel img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.channel span { 
  font-size: 14px; 
  color: white; 
  text-align: center; 
  position: relative;
  z-index: 2;
}

#playerSection { 
  display: none; 
  text-align: center; 
  padding: 20px; 
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  margin: 20px auto;
  max-width: 1200px;
}

#sameCategoryList {
  display: flex;
  overflow-x: auto;       
  overflow-y: hidden;     
  gap: 12px;
  padding: 10px 0;
  margin-bottom: 10px;
  justify-content: flex-start; 
  scroll-behavior: smooth;     
  -webkit-overflow-scrolling: touch;
  max-width: 1200px;
  margin: 0 auto;
}
#sameCategoryList .channel {
  flex: 0 0 auto;        
  width: 120px;
  height: 120px;
  font-size: 12px;
}
#sameCategoryList::-webkit-scrollbar { height: 8px; }
#sameCategoryList::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  border-radius: 4px;
}

#playerWrapper { 
  position: relative; 
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
#player { 
  width: 100%; 
  height: 60vh; 
  max-width: 1200px; 
  margin: 0 auto; 
  border-radius: 16px; 
  overflow: hidden; 
  box-shadow: 0 8px 16px rgba(0,0,0,0.1); 
}
#fullscreenBtn {
  position: absolute; 
  top: 12px; 
  right: 12px;
  padding: 10px 16px; 
  background: #4a6fa5; 
  color: white; 
  border: none; 
  border-radius: 8px; 
  cursor: pointer; 
  z-index: 1000; 
  transition: all 0.3s;
  font-size: 14px;
  font-weight: bold;
}
#fullscreenBtn:hover { 
  background: #3a5a85; 
  transform: scale(1.05); 
}

.back-btn {
  display: inline-block; 
  margin-top: 15px; 
  padding: 12px 20px; 
  background: #4a6fa5; 
  color: white; 
  border-radius: 10px; 
  cursor: pointer; 
  text-decoration: none; 
  font-weight: bold; 
  transition: all 0.3s;
  font-size: 16px;
}
.back-btn:hover { 
  background: #3a5a85; 
  transform: scale(1.05); 
}

footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  color: #6c757d;
  border-top: 1px solid #e9ecef;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  .channels-container {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  .channel { min-height: 120px; padding: 10px; }
  .channel img { width: 60px; height: 60px; }
  .channel span { font-size: 12px; }
  .scroll-indicator { display: none; }
  #categories { padding: 8px 5px; }
  .category-btn { padding: 10px 18px; font-size: 14px; }
  #player { height: 40vh; }
  #fullscreenBtn { padding: 8px 12px; font-size: 12px; top: 8px; right: 8px; }
  .back-btn { padding: 10px 16px; font-size: 14px; }
  #playerSection { padding: 15px; margin: 10px; }
  #sameCategoryList .channel { width: 100px; height: 100px; }
  .category-title { font-size: 18px; }
}
@media (max-width: 480px) {
  .channels-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .channel { min-height: 110px; }
  .channel img { width: 50px; height: 50px; }
  #player { height: 35vh; }
  header { padding: 10px 15px; font-size: 22px; }
  .logo { font-size: 22px; }
}

/* Fullscreen specific styles */
:fullscreen #playerWrapper,
:-webkit-full-screen #playerWrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: black;
}
:fullscreen #player,
:-webkit-full-screen #player {
  width: 100%;
  height: 100%;
  max-width: none;
  border-radius: 0;
}
:fullscreen #fullscreenBtn,
:-webkit-full-screen #fullscreenBtn {
  top: 20px;
  right: 20px;
}