* {
  font-family: 'Poppins', sans-serif;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Background --- */
body {
  background: linear-gradient(135deg, #001b3a 0%, #000814 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
  animation: fadeIn 1s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Header (Modern & Responsive) --- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  margin: 1rem;
  border-radius: 20px;
  background: rgba(0, 37, 75, 0.6);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  animation: fadeIn 1s ease;
  transition: all 0.3s ease;
}

header:hover {
  background: rgba(0, 53, 107, 0.75);
}

/* Make header elements responsive */
header #logo {
  max-height: 50px;
  transition: transform 0.3s ease;
}
header #logo:hover {
  transform: scale(1.05);
}

.channel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-direction: column;
}


.channel-logo-placeholder {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6em;
  border-radius: 12px;
  background: linear-gradient(135deg, #004f9e, #0076d4);

background: rgba(0, 37, 75, 0.6);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);

  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.channel-meta h2 {
  font-size: 1.3em;
  color: #fff;
  font-weight: 700;
  margin: 0 0 5px 0;
}

.channel-meta .epg-title {
  color: #9dc4ff;
  font-weight: 500;
  font-size: 0.95em;
}

.loading {
  color: #9dc4ff;
  font-style: italic;
}

#search {
  background: rgba(255,255,255,0.12);
  background: rgba(0, 37, 75, 0.6);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0.6rem 1.2rem;
  color: #fff;
  transition: all 0.3s ease;
}

#search:focus {
  background: rgba(255,255,255,0.2);
  box-shadow: 0 0 15px rgba(69,155,204,0.5);
  outline: none;
}

/* --- Category Buttons --- */
#categoryButtons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 1.2rem 0;
  animation: fadeIn 1.2s ease;
}

#categoryButtons button {
  padding: 0.7rem 1.5rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #003870 0%, #0052a3 100%);
  background-size: 200% 200%;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.35s ease;
  backdrop-filter: blur(15px) saturate(160%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#categoryButtons button:hover {
  transform: scale(1.08);
  animation: gradientShift 3s ease infinite;
  box-shadow: 0 6px 28px rgba(69, 155, 204, 0.5);
}

/* --- Category Button Icons --- */
#categoryButtons .material-symbols-rounded {
  vertical-align: middle;
  font-size: 1.4em;
  margin-right: 6px;
}

/* --- Quality Selector (Glass Gradient) --- */
#qualitySelector {
  margin-top: 15px;
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadeIn 1.2s ease;
}

#qualitySelector label {
  color: #a6c8ff;
  font-weight: 600;
}

#qualitySelector select {
  background: linear-gradient(135deg, #003870 0%, #0052a3 100%);
  border: none;
  border-radius: 10px;
  padding: 0.5rem 1.2rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

#qualitySelector select:hover {
  transform: scale(1.05);
  animation: gradientShift 3s ease infinite;
  box-shadow: 0 6px 22px rgba(69, 155, 204, 0.5);
}

/* --- Back Button --- */
#backButton {
  align-self: flex-start;
  margin-bottom: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(90deg, #002c57 0%, #004d99 100%);
  background-size: 200% 200%;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

#backButton:hover {
  transform: scale(1.07);
  animation: gradientShift 3s ease infinite;
  box-shadow: 0 6px 25px rgba(69,155,204,0.5);
}

/* --- Gradient Animation --- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- Responsive Header Adjustments --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
    gap: 0.8rem;
    padding: 1rem;
  }

  #search {
    width: 90%;
  }
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(255,136,0,0.4); }
  50% { box-shadow: 0 0 25px rgba(69,155,204,0.6); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Glass Base --- */
.glass {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

#logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 1.5rem;
  height: auto; /* remove 100% height */
}

#logo img {
  max-width: 1000px; /* or any size you want */
  width: auto;       /* maintain aspect ratio */
  height: auto;
  flex-shrink: 0;    /* prevent flex from shrinking it */
}

#search::placeholder {
  color: #bbb;
 font-size: 15px;
}

/* --- Live Event --- */
#liveEvent {
  position: relative;
  width: 100%;
  max-height: 80vh;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 1rem;
  animation: fadeIn 1.2s ease;
  transition: transform 0.3s ease;
}

#liveEvent:hover {
  transform: scale(1.02);
}

.event-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(12px) brightness(0.5);
  z-index: 1;
}

.event-content {
  position: relative;
  z-index: 2;
  padding: 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #fff;
  animation: fadeIn 1.5s ease;
}

.event-content img {
  max-width: 60%;
  border-radius: 16px;
  margin-bottom: 0.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  animation: fadeIn 1.8s ease;
}

.event-content h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.event-content p {
  font-size: 1.1rem;
  margin-bottom: 0.8rem;
  color: #ddd;
}

.event-content button {
  padding: 0.7rem 1.4rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #001b3a 50%, #000814 100%);
  background-size: 200% 200%;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.event-content button:hover {
  transform: scale(1.07);
  animation: gradientShift 3s ease infinite;
}

/* --- Channel List --- */
.channel-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
  max-height: 90vh;
  overflow-y: auto;
}

.channel {
  width: 300px;
  min-height: 90px;
  border-radius: 18px;
  position: relative;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
align-items: center;

margin: 1rem 1rem 1rem 1rem;

}

.channel:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 8px 24px rgba(69,155,204,0.4);
}

.channel-logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.channel:hover .channel-logo {
  transform: scale(1.1);
}

.channel-info {
  display: flex;
  flex-direction: column;
  align-items: center;;
   padding: 1rem;
  flex-grow: 1;
  justify-content: center;
  text-align: center;
}

.channel-name {
  font-weight: 600;
  font-size: 1.2rem;
  margin-top: 0.8rem;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.channel-theme {
  font-size: 0.95rem;
  margin-top: 0.3rem;
  color: #a6c8ff;
  letter-spacing: 0.5px;
  font-style: italic;
}

/* --- Player Page --- */
#playerPage {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  animation: fadeIn 0.8s ease;
}

video, audio {
  max-width: 100%;
  border-radius: 15px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  animation: fadeIn 1s ease;
}

#channelDescription {
background: linear-gradient(135deg, #001b3a 0%, #000814 100%);
display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  margin: 1rem;
  border-radius: 20px;
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  max-width: 800px;
  text-align: center;
  color: #ddd;
  animation: fadeIn 1.2s ease;
  padding: 11px;

}

/* --- Loading Spinner --- */
#loadingOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  display: none;
  backdrop-filter: blur(10px);
}

.spinner {
  width: 70px;
  height: 70px;
  border: 6px solid rgba(255,255,255,0.2);
  border-top-color: #FF8800;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .channel {
    width: 90%;
    min-height: 1px;
  }


  .event-content img {
    max-width: 80%;
  }

  .event-content h2 {
    font-size: 1.6rem;
  }

  .event-content p {
    font-size: 1rem;
  }

  #liveEvent {
    max-height: 60vh;
  }
}