/* ===== VARIABLES & BASE STYLES ===== */
:root {
  --primary-color: #1a73e8;
  --primary-dark: #0d5bba;
  --secondary-color: #333;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #666;
  --error-color: #d32f2f;
  --white: #fff;
  --shadow: 0 2px 5px rgba(0,0,0,0.1);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--light-gray);
  color: var(--secondary-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== HEADER & NAVIGATION ===== */
header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  box-shadow: var(--shadow);
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.logo a {
  color: var(--white);
  text-decoration: none;
}

/* Search Bar */
.search-container {
  display: flex;
  flex: 1;
  min-width: 250px;
  max-width: 500px;
  margin: 20px 0;
}

#searchInput {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 16px;
}

#searchButton {
  padding: 0 15px;
  background-color: var(--primary-dark);
  color: var(--white);
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
}

/* Category Navigation */
.category-nav, .category-filter {
  display: flex;
  gap: 10px;
  padding: 15px 20px;
  background-color: var(--light-gray);
  overflow-x: auto;
  margin: 15px 0;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar, 
.category-filter::-webkit-scrollbar {
  display: none;
}

.category-btn {
  padding: 8px 15px;
  background-color: var(--medium-gray);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s;
}

.category-btn.active {
  background-color: var(--primary-color);
  color: var(--white);
}

/* ===== CHANNEL GRID & CARDS ===== */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
  padding: 20px;
}

.channel-card, .related-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s;
  text-decoration: none;
  color: var(--secondary-color);
}

.channel-card:hover, 
.related-card:hover {
  transform: translateY(-5px);
}

.channel-thumbnail, 
.related-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.channel-details {
  padding: 15px;
}

.channel-details h3, 
.related-card span {
  margin: 0 0 5px 0;
  font-size: 16px;
}

.channel-details p {
  margin: 0 0 10px 0;
  color: var(--dark-gray);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-badge {
  display: inline-block;
  padding: 3px 8px;
  background-color: var(--medium-gray);
  border-radius: 4px;
  font-size: 12px;
  color: #555;
}

/* ===== CONTENT VIEWER ===== */
.player-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
}

#content-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.content-viewer {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 30px;
  border-radius: 8px;
  overflow: hidden;
}

.image-viewer {
  background: var(--light-gray);
  text-align: center;
  padding: 20px;
}

.video-viewer {
  background: #000;
  width: 100%;
  height: 100%;
}

.displayed-content {
  max-width: 100%;
  max-height: 100%;
  display: block;
  margin: 0 auto;
}

.image-viewer .displayed-content {
  object-fit: contain;
}

.video-viewer iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===== CHANNEL INFO ===== */
.channel-info {
  margin: 20px 0;
  padding: 20px;
  background: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.channel-info h1 {
  margin: 0 0 10px 0;
  color: var(--primary-color);
}

/* ===== RELATED CHANNELS ===== */
.related-container {
  margin: 40px 0;
}

.related-container h3 {
  margin-bottom: 15px;
  color: #555;
}

.related-channels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.related-card span {
  display: block;
  padding: 10px;
  text-align: center;
}

/* ===== CONTENT SECTION ===== */
.content-section {
  padding: 20px;
  background: var(--white);
  margin: 20px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.content-section h2 {
  color: var(--primary-color);
  margin-top: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.feature-card {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.feature-card i {
  font-size: 40px;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.feature-card h3 {
  margin: 10px 0;
  color: var(--secondary-color);
}

/* ===== BUTTONS & ACTIONS ===== */
.content-actions {
  text-align: center;
  margin-top: 15px;
}

.switch-btn, .back-btn {
  padding: 8px 16px;
  margin: 0 10px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.switch-btn {
  background-color: var(--primary-color);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.switch-btn:hover {
  background-color: var(--primary-dark);
}

.back-btn {
  background-color: var(--medium-gray);
  color: var(--secondary-color);
}

/* ===== LOADING & ERROR STATES ===== */
.loading-container {
  text-align: center;
  padding: 40px 0;
  grid-column: 1 / -1;
}

.loading-spinner {
  border: 4px solid rgba(0,0,0,0.1);
  border-radius: 50%;
  border-top: 4px solid var(--primary-color);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

.error-state, .error-notification {
  color: var(--error-color);
  text-align: center;
  padding: 50px;
}

/* ===== NOTIFICATION STYLES ===== */
.error-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #d32f2f;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    max-width: 400px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.error-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.error-notification i {
    font-size: 20px;
}

.close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close-button:hover {
    opacity: 1;
}

/* ===== FALLBACK UI STYLES ===== */
.error-fallback {
    text-align: center;
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto;
    color: #d32f2f;
}

.error-fallback i {
    font-size: 60px;
    margin-bottom: 20px;
}

.error-fallback h2 {
    margin-bottom: 15px;
}

.error-fallback button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background-color 0.3s;
}

.error-fallback button:hover {
    background-color: var(--primary-dark);
}

.contact-support {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: var(--dark-gray);
}

.contact-support a {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

/* ===== ADVERTISEMENTS ===== */
.ad-container {
  margin: 20px 0;
  text-align: center;
}

.ad-player-top {
  margin-bottom: 20px;
}

.ad-player-bottom {
  margin-top: 20px;
}

.ad-sidebar {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
}

/* ===== FOOTER ===== */
footer {
  background-color: var(--secondary-color);
  color: var(--white);
  text-align: center;
  padding: 15px 0;
  margin-top: 40px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.link-column {
  min-width: 150px;
}

.link-column h3 {
  margin-top: 0;
}

.link-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-column a {
  color: var(--white);
  text-decoration: none;
  display: block;
  padding: 5px 0;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 15px;
}

.social-links a {
  color: var(--white);
  font-size: 20px;
}

/* ===== ANIMATIONS ===== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .ad-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    text-align: center;
  }
  
  .search-container {
    width: 100%;
  }
  
  .channels-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .video-viewer .displayed-content {
    height: 50vh;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .channels-grid {
    grid-template-columns: 1fr;
  }
  
  .category-nav, .category-filter {
    padding: 10px;
  }
  
  .category-btn {
    padding: 6px 12px;
    font-size: 14px;
  }
}

/* ===== PAGINATION STYLES ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding: 20px 0;
}

.pagination-button {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.pagination-button:hover:not(:disabled) {
    background-color: var(--primary-dark);
}

.pagination-button:disabled {
    background-color: var(--medium-gray);
    color: var(--dark-gray);
    cursor: not-allowed;
    opacity: 0.7;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.page-number:hover:not(.active) {
    background-color: var(--light-gray);
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
}


/* ===== SPONSOR BUTTONS STYLES ===== */
.sponsor-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px auto;
    max-width: 1200px;
    flex-wrap: wrap;
}

.sponsor-button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #4b6cb7 0%, #182848 100%);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
}

.sponsor-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: linear-gradient(135deg, #3a56a0 0%, #121f3d 100%);
}

.sponsor-button i {
    font-size: 18px;
    color: #ffcc00;
}

/* Responsive */
@media (max-width: 768px) {
    .sponsor-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .sponsor-button {
        width: 100%;
        justify-content: center;
    }
}

