body {
  margin: 0;
  padding: 0;
  background-color: #121212;
  color: white;
  font-family: Arial, sans-serif;
  line-height: 1.4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 0.9em;
  overflow-x: hidden;
}

.guide-container {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0 10px;
  background-color: transparent;
  border-radius: 0;
  box-shadow: none;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

h1 {
  color: #ff6b6b;
  text-align: center;
  margin-bottom: 15px;
  font-size: 2em;
}

h2 {
  color: #ffcc5c;
  text-align: center;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.8em;
}

/* Tab Styles */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #333;
}

.tab-button {
  background-color: #2a2a2a;
  color: #ccc;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 1em;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0 2px; /* Small gap between buttons */
}

.tab-button:hover {
  background-color: #3a3a3a;
  color: #fff;
}

.tab-button.active {
  background-color: #ff6b6b; /* Active tab color */
  color: #fff;
  font-weight: bold;
  border-bottom: 2px solid #ff6b6b; /* Highlight active tab */
}

.tab-content {
  padding-top: 0px;
}

/* Stream Table Styles (existing) */
.stream-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.stream-table th, .stream-table td {
  border: 1px solid #333;
  padding: 8px 10px;
  text-align: left;
}

.stream-table th {
  background-color: #2a2a2a;
  color: #ccc;
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 1;
}

.stream-table tr:nth-child(even) {
  background-color: #252525;
}

.stream-table tr:hover {
  background-color: #3a3a3a;
}

.channel-info-cell {
    display: flex;
    align-items: center;
}

.channel-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.channel-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #6ba8ff;
    font-weight: bold;
}

.title-cell, .viewers-cell, .time-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px; /* Adjust as needed */
}

.link-cell a {
  color: #ffcc5c;
  text-decoration: none;
  font-weight: bold;
  word-break: break-all;
}

.link-cell a:hover {
  text-decoration: underline;
}

.no-streams {
  text-align: center;
  padding: 15px;
  font-size: 1em;
  color: #aaa;
  border: 1px solid #333;
  background-color: #2a2a2a;
  margin-bottom: 20px;
}

.last-updated {
  text-align: right;
  font-size: 0.75em;
  color: #aaa;
  margin-top: 15px;
}

.back-link {
    margin-top: 20px;
    font-size: 0.9em;
    text-align: center;
    display: block;
    color: #ffcc5c;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* DSN Channel and Tooltip Styles */
.dsn-channel {
  border-left: 5px solid #ff0000; /* Red border on the left */
  position: relative; /* Make the row relative for tooltip positioning */
}

.dsn-channel[data-tooltip]:hover::after {
  content: attr(data-tooltip); /* Get tooltip text from data-tooltip attribute */
  position: absolute;
  left: 100%; /* Position to the right of the element */
  top: 50%;
  transform: translateY(-50%); /* Vertically center it */
  background-color: #ff0000; /* Red background */
  color: yellow; /* Yellow text */
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10; /* Ensure tooltip is above other elements */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  margin-left: 5px; /* Small space between element and tooltip */
}

.dsn-channel[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Weekly Schedule Grid Styles */
.weekly-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Responsive columns */
  gap: 15px;
  margin-top: 20px;
}

.day-column {
  background-color: #2a2a2a;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.day-column h3 {
  color: #ffcc5c;
  text-align: center;
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.2em;
  border-bottom: 1px solid #444;
  padding-bottom: 8px;
}

.day-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.day-column li {
  background-color: #333;
  border-radius: 5px;
  padding: 8px;
  margin-bottom: 8px;
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative; /* Added for absolute positioning of image */
  /* Removed padding-right to allow image to sit on the edge */
}

.day-column li:last-child {
  margin-bottom: 0;
}

.channel-img-weekly {
  width: 20px; /* Smaller size for weekly view */
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  position: absolute; /* Absolute positioning */
  top: -10px; /* Distance from top edge */
  right: -10px; /* Distance from right edge */
}

.day-column li .stream-time-weekly {
  font-weight: bold;
  color: #6ba8ff;
}

.day-column li .stream-title-weekly {
  color: #fff;
}

.day-column li .stream-channel-weekly {
  font-size: 0.8em;
  color: #aaa;
}

.day-column li .stream-link-weekly {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 8px;
  background-color: #ff6b6b;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  font-size: 0.8em;
  text-align: center;
}

.day-column li .stream-link-weekly:hover {
  background-color: #e05a5a;
}


.channel-img-weekly {
  width: 20px; /* Smaller size for weekly view */
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  position: absolute; /* Absolute positioning */
  top: -10px; /* Distance from top edge */
  right: -10px; /* Distance from right edge */
}

.day-column li .stream-time-weekly {
  font-weight: bold;
  color: #6ba8ff;
}

.day-column li .stream-title-weekly {
  color: #fff;
}

.day-column li .stream-channel-weekly {
  font-size: 0.8em;
  color: #aaa;
}

.day-column li .stream-link-weekly {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 8px;
  background-color: #ff6b6b;
  border-radius: 4px;
  color: #fff;
  text-decoration: none;
  font-size: 0.8em;
  text-align: center;
}

.day-column li .stream-link-weekly:hover {
  background-color: #e05a5a;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
  .guide-container {
    margin: 0;
    padding: 0 5px;
    width: 100%;
  }

  h1 {
    font-size: 1.5em;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 1.3em;
    margin-top: 15px;
    margin-bottom: 10px;
  }

  .tabs {
    flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
  }

  .tab-button {
    flex-grow: 1; /* Make buttons take equal width */
    margin: 2px; /* Adjust margin for wrapping */
  }

  .stream-table, .stream-table thead, .stream-table tbody,
  .stream-table th, .stream-table td, .stream-table tr {
    display: block;
    width: 100%;
  }

  .stream-table {
    border: none;
  }

  .stream-table thead {
    display: none;
  }

  .stream-table tr {
    margin-bottom: 8px;
    border: 1px solid #333;
    border-radius: 6px;
    background-color: #252525;
    padding: 6px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .stream-table tr:nth-child(even) {
    background-color: #2a2a2a;
  }

  .stream-table td {
    border: none;
    padding: 3px 0;
    position: relative;
    text-align: left;
    white-space: normal;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    font-size: 0.85em;
  }

  /* Hide the "before" pseudo-element for all cells by default */
  .stream-table td:before {
    display: none;
  }

  .channel-info-cell {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding-left: 0;
    position: relative; /* Needed for absolute positioning of the button */
    justify-content: space-between; /* Keep space for potential views */
  }

  .channel-details {
    display: flex;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
  }

  .channel-img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }

  .channel-name {
    margin-left: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-views {
    margin-left: auto;
    padding-left: 8px;
    color: #aaa;
    font-size: 0.8em;
    flex-shrink: 0;
  }

  .mobile-play-button {
    display: inline-block;
    padding: 3px 8px;
    background-color: #3a3a3a;
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
    font-size: 0.85em;
    color: #ffcc5c;
    text-decoration: none;
    /* Absolute positioning */
    position: absolute;
    top: 0;
    right: 0;
    margin-top: 0;
    margin-right: 0;
  }

  .mobile-play-button:hover {
    text-decoration: underline;
  }

  .mobile-title-cell {
    padding-left: 0;
  }

  .stream-title, .stream-time {
    white-space: normal;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
  }

  .dsn-channel[data-tooltip]:hover::after {
    left: 50%; /* Center horizontally */
    transform: translate(-50%, calc(-100% - 5px)); /* Move above the element */
    top: 0; /* Align to the top of the row */
    margin-left: 0;
  }

  .weekly-schedule-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }
}

@media (max-width: 480px) {
  /* Further adjustments for smaller screens if necessary */
}
/* Guide Video Thumbnails and Hyperlinks */
.stream-link, a.stream-link { color: inherit !important; text-decoration: none !important; }
.stream-link:hover, a.stream-link:hover { text-decoration: none !important; color: inherit !important; }
.title-wrapper { display: flex; align-items: center; gap: 10px; }
.guide-video-thumbnail { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; flex-shrink: 0; max-width: 100%; height: auto; }
.guide-video-title-text { white-space: normal; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-height: 2.8em; }
.weekly-stream-link { display: flex; flex-direction: column; gap: 8px; }
.guide-video-thumbnail-weekly { width: 100%; max-width: 150px; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; align-self: center; }
.weekly-stream-details { display: flex; flex-direction: column; gap: 4px; }
.weekly-channel-row { display: flex; align-items: center; gap: 6px; }
.channel-img-weekly { position: static; width: 24px; height: 24px; margin: 0; }
/* Carousel View Styles */
.carousel-tab-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: calc(100vh - 150px); /* Aggressive height calculation */
  min-height: 500px;
}

.carousel-header-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
}

.carousel-label {
  color: #ccc;
  font-weight: bold;
}

.carousel-select {
  background-color: #2a2a2a;
  color: #fff;
  border: 1px solid #444;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 1em;
  cursor: pointer;
  outline: none;
}

.carousel-select:hover {
  background-color: #3a3a3a;
}

.carousel-container {
  position: relative;
  flex-grow: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background-color: #1e1e1e;
  display: flex;
  align-items: stretch;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease-in-out;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.carousel-img-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-loader {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

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

.carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease-in;
  position: relative;
  z-index: 1;
}

.carousel-img.loaded {
  opacity: 1;
}

.carousel-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
  padding: 30px 20px 20px 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
  pointer-events: none;
}

.carousel-overlay * {
  pointer-events: auto;
}

.carousel-overlay .stream-title {
  color: #fff;
  font-size: 1.8em;
  font-weight: bold;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
  margin: 0;
}

.carousel-overlay .channel-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel-overlay .channel-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #333;
}

.carousel-overlay .channel-name {
  color: #6ba8ff;
  font-size: 1.2em;
  font-weight: bold;
}

.carousel-overlay .stream-time {
  background-color: #ff6b6b;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: bold;
  align-self: flex-start;
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 2em;
  padding: 15px 10px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s;
  border-radius: 4px;
}

.carousel-nav:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-nav.prev {
  left: 10px;
}

.carousel-nav.next {
  right: 10px;
}

@media (max-width: 768px) {
  .carousel-tab-content {
     min-height: 300px;
  }
  .carousel-overlay .stream-title {
    font-size: 1.3em;
  }
  .carousel-overlay .channel-name {
    font-size: 1em;
  }
  .carousel-nav {
    font-size: 1.5em;
    padding: 10px 5px;
  }
}

/* Unified Header */
header#main-navbar {
    background-color: rgba(24, 23, 38, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(26, 115, 232, 0.2);
    position: sticky;
    top: 0;
    z-index: 10005;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
}

.header-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

/* Hamburger Menu Icon (Unified with Park Companion) */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    margin: 0;
}

.hamburger-menu span {
    display: block;
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s linear;
}

/* Modal Bubble Nav (Hanging from button) */
.hamburger-modal-overlay {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent; /* Invisible overlay to capture clicks */
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.hamburger-modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.hamburger-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    height: calc(100vh - 65px);
    background: #1e1e1e;
    padding: 2rem 1rem;
    width: 80%;
    max-width: 300px;
    text-align: left;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.7);
    transform: translateX(-100%);
    opacity: 1;
    transition: transform 0.3s ease-in-out;
    border-radius: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.hamburger-modal-overlay.open .hamburger-modal-content {
    transform: translateX(0);
}

.hamburger-modal-title {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.hamburger-modal-link {
    display: block;
    background: transparent;
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.2s;
}

.hamburger-modal-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.hamburger-modal-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0;
}
.hamburger-modal-close::after {
    content: '\00d7';
    font-size: 2.5rem;
    line-height: 1;
}

/* Responsive Navbar Title */
@media (max-width: 768px) {
    .header-content-wrapper h1 {
        font-size: 1.2rem !important;
    }
}
@media (max-width: 500px) {
    .header-content-wrapper h1 {
        font-size: 1rem !important;
    }
}
@media (max-width: 400px) {
    .header-content-wrapper h1 {
        display: none !important;
    }
}


/* Guide Options Dropdown */
#mobile-options-btn {
    display: block !important;
}
#guide-options-dropdown {
    display: none !important;
    position: absolute;
    top: 50px;
    right: 15px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    flex-direction: column;
    align-items: stretch !important;
    min-width: 220px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
}
#guide-options-dropdown.open {
    display: flex !important;
}
#guide-options-dropdown .nav-font-label {
    margin: 5px 0 2px 0 !important;
}

