/* Basic Reset */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

/* Root Colors for Dark Mode */
:root {
  --secondary: #facc15;
  --bg-dark: #0f172a;
  --bg-color: #0f172a;
  --text-color: #ffffff;
  --header-bg: #1e293b;
  --card-bg: #1e293b;
  --badge-bg: #facc15;
  --badge-text: #0f172a;
  --p-text: #94a3b8;
  --menu-bg: #31425e;
  --search-bg: #334155;
  --cat-bg: #475569;
  --player-sd: rgba(0, 0, 0, 0.6);
}

/* Light Mode Colors */
.light-mode {
  --bg-color: #f9fafb;
  --text-color: #111827;
  --header-bg: #e2e8f0;
  --card-bg: #e2e8f0;
  --badge-bg: #f59e0b;
  --badge-text: #ffffff;
  --p-text: #4c535e;
  --menu-bg: #a9aeb7;
  --search-bg: #d2d9e1;
  --cat-bg: #9faab9;
  --player-sd: rgba(0, 0, 0, 0.3);
}

/* Header */
header {
  background: var(--header-bg);
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--secondary);
  text-decoration: none;
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  padding: 0.5rem;
  border-radius: 8px;
}

.nav-menu a:hover,
.nav-menu a.active {
  background-color: var(--menu-bg);
  color: var(--secondary);
  font-weight: bold;
  box-shadow: 0 0 15px var(--secondary);
}

/* Badge inside nav */
.nav-menu a .badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--secondary);
  color: var(--bg-dark);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Search Bar */
.search-bar {
  display: flex;
  justify-content: center;
  padding: 20px;
}

.search-bar input {
  width: 50%;
  padding: 12px 20px;
  border: none;
  border-radius: 25px;
  background: var(--search-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: background-color 0.3s, color 0.3s;
}

/* Categories */
.categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 0 20px 20px;
}

.categories button {
  background-color: var(--cat-bg);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s, color 0.3s;
}

.categories button:hover,
.categories button.active {
  background-color: var(--secondary);
  color: #000;
}

/* Channel Grid */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  padding: 20px;
  margin-bottom : 40px;
}

/* Channel Card */
.channel-card {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.channel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px var(--secondary);
}

.channel-card img {
  max-width: 100%;
  height: 80px;
  object-fit: contain;
}

.channel-card .title {
  margin-top: 10px;
  font-weight: bold;
}

.channel-card .tagline {
  font-size: 0.9rem;
  color: var(--p-text);
}

/* Heart Icon */
.heart-icon {
  position: absolute;
  top: 15px;
  right: 15px;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
}

/* HD Badge */
.hd-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--secondary);
  color: #000;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: bold;
}

/* Footer */
footer {
  background-color: var(--bg-color);
  color: var(--p-text);
  text-align: center;
  padding: 10px;
  font-size: 0.9rem;
  border-top: 1px solid var(--header-bg);
}

footer a {
  text-decoration: none;
  color: var(--secondary);
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 600px) {
    .search-bar input {
        width: 90%;
    }
}

@media (max-width: 768px) {

    main {
        padding-top: 60px;
        padding-bottom: 55px;
    }
    
    header {
        font-size: 20px;
        position: fixed;
        width: 100%;
        z-index: 1000;
        padding: 20px 30px;
        border-bottom: 1px solid var(--search-bg);
    }

    .nav-menu {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        padding: 15px 30px;
        background: var(--header-bg);
        justify-content: space-between; /* 🔥 auto gap */
        align-items: center;
        z-index: 9999;
        border-top: 1px solid var(--search-bg);
    }
    
    .nav-menu span {
        display: none;
    }

    .nav-menu a i {
        font-size: 20px;
        display: block;
    }

    #themeToggle {
        position: fixed;
        top: 20px;      /* 🔥 top */
        right: 30px;    /* 🔥 right */
        bottom: auto;   /* ❌ remove bottom */
        left: auto;     /* ❌ remove left */
    }
    
    footer, #backToTopBtn {
    display: none !important;
    }
}
/* Theme Toggle Button */
#themeToggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 1000;
}

/* Back To Top Button */
#backToTopBtn {
  display:none;
  position:fixed;
  bottom:20px;
  right:20px;
  z-index:9999;
  font-size: 1.2rem;
  color: var(--text-color);
  cursor: pointer;
  user-select: none;
}

/* Single page design */
.myPlayer {
  position: relative;
  width: 70%;
  overflow: hidden;
  border: 1px solid var(--header-bg);
  box-shadow: 0 4px 12px var(--player-sd);
  margin: 30px auto;  /* উপরে 30px margin, বাম-ডানে auto (center) */
  display: block;
}

/* 16:9 Aspect Ratio Maintain */
.myPlayer::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 ratio */
}

.myPlayer iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.player-text {
  text-align: center;
  padding: 0 20px;
  color: var(--p-text);    
}

#channelInfo, .channelLike {
  padding: 15px;
  color: #333; /* ডিফল্ট টেক্সট কালার, কালো-ডার্ক গ্রে */
  font-family: Arial, sans-serif;
}

#channelInfo h2, .channelLike h2 {
  background-color: var(--header-bg);
  color: var(--text-color);
  padding: 10px 15px;
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: normal;
}

.channelLike h2 {
  margin: 0;
}

#channelInfo .infoImg {
  background: var(--card-bg);
  border-radius: 15px;
  padding: 25px;
  overflow: hidden; /* ফ্লোট হলে কন্টেইনার সঠিক সাইজ নেবে */
}

#channelInfo .infoImg img {
  float: left;
  margin-right: 15px;
  max-width: 150px;
  max-height: 80px;
  object-fit: contain;
}

#channelInfo .infoImg p {
  margin: 6px 0;
  line-height: 1.5;
  font-size: 14px;
  color: var(--p-text);
}

#channelInfo .infoImg p b {
  color: var(--p-text);
}

/* clearfix for floated image */
#channelInfo .infoImg::after {
  content: "";
  display: block;
  clear: both;
}

.embed-code {
  margin-top: 25px;
  width: 100%;
  height: 120px;
  padding: 10px;
  font-size: 14px;
  font-family: monospace;
  background: var(--bg-color);
  border: 1px solid var(--header-bg);
  border-radius: 5px;
  resize: none;
  color: var(--p-text);
  line-height: 1.4;
}

.embed-code:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 6px rgba(250, 204, 21, 0.8);
}

.show-more-btn {
  background: var(--card-bg);
  grid-column: 1 / -1; /* পুরো গ্রিডের প্রস্থ জুড়ে দেবে */
  padding: 10px 20px;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  border: none;
  color: var(--p-text);
  border-radius: 10px;
}

.show-more-btn:hover {
  box-shadow: 0 0 15px var(--secondary);
}