/* Apply box-sizing globally for consistent layout calculations */
html, body, * {
  box-sizing: border-box;
}

:root {
  --wait-times-bar-height: 30px; /* Define the height of the scrolling wait times bar */
  --right-panel-width: 40px; /* Define the width of the new right panel (desktop) */
  --right-panel-height-mobile: 40px; /* NEW: Define the height of the right panel on mobile */
  --right-panel-bottom-item-height: 35px; /* Height of the bottom item, including margin */
  --mobile-controls-width: 40px; /* NEW: Width for mobile controls */
  --policy-banner-height: 40px; /* Define the height of the policy banner */
  --chat-scale: 0.75; /* NEW: Default chat scale */
}

body {
  margin: 0;
  padding: 0;
  background-color: #121212;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  /* Prevent horizontal scrolling */
  overflow-y:auto; /* Changed from auto to hidden to prevent main window scrollbar on desktop */
}

/* NEW: Policy Modal Styles (reusing modal-content for structure) */
.policy-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.9); /* Darker overlay to emphasize modal */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.policy-modal.show {
  display: flex;
}

.policy-modal .modal-content {
  background-color: #1e1e1e;
  margin: auto;
  padding: 20px; /* Increased padding for better appearance */
  border: 1px solid #888;
  width: 90%; /* Responsive width */
  max-width: 1200px; /* Max width for desktop */
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  position: relative;
  animation: slideIn 0.3s forwards;
  text-align: center; /* Center text content */
}

.policy-modal .modal-content h2 {
  margin-top: 0;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.policy-modal .modal-content p {
  margin-bottom: 10px;
  line-height: 1.5;
}

.policy-modal .modal-content a {
  color: #ADD8E6; /* Light blue for links */
  text-decoration: underline;
  font-weight: bold;
}

/* Specific style for the "Enter Site" button */
#enter-site-btn {
  margin-top: 20px;
  width: auto; /* Allow button to size based on content */
  padding: 12px 30px; /* Larger padding for a more prominent button */
  font-size: 1.1em; /* Larger font size */
  background-color: #007bff; /* Blue, similar to save settings */
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#enter-site-btn:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
}


/* Loading Overlay Styles */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #121212; /* Match body background */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* Ensure it's on top of everything */
  transition: opacity 0.5s ease;
  opacity: 1; /* Initially visible */
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none; /* Allow clicks once hidden */
}

/* NEW: Message on loading screen */
.loading-message {
  color: #ffffff; /* White text */
  font-size: .75em; /* Increased font size for prominence */
  line-height: 1.5em;
  margin-top: 60px; /* Increased space between message and logos */
  text-align: center;
}

/* NEW: Message on loading screen */
.loading-message-top {
  color: #ffffff; /* White text */
  font-size: 1.2em; /* Increased font size for prominence */
  margin-top: 60px; /* Increased space between message and logos */
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.7); /* Subtle glow effect */
  animation: fade-in-out-emphasize-top 4s ease-in-out infinite alternate;
}

@keyframes fade-in-out-emphasize {
  0% { opacity: 1; transform: translateY(-30) scale(1.1); } /* Start with lower opacity, no scale */
  25% { opacity: 0.7; transform: translateY(-15px) scale(1.05); } /* Slight pop up and scale */
  50% { opacity: 0.3; transform: translateY(-0px) scale(1); text-shadow: 0 0 15px rgba(255,255,255,0.8); } /* Peak prominence, higher scale, stronger glow */
  75% { opacity: 0.7; transform: translateY(-15px) scale(1.05); } /* Settle back down */
  100% { opacity: 1; transform: translateY(-30) scale(1); } /* End with lower opacity, no scale */
}

@keyframes fade-in-out-emphasize-top {
  0% { opacity: 0.2; transform: translateY(0) scale(1); } /* Start with lower opacity, no scale */
  25% { opacity: 0.7; transform: translateY(-15px) scale(1.05); } /* Slight pop up and scale */
  50% { opacity: 1; transform: translateY(-30px) scale(1.1); text-shadow: 0 0 15px rgba(255,255,255,0.8); } /* Peak prominence, higher scale, stronger glow */
  75% { opacity: 0.7; transform: translateY(-15px) scale(1.05); } /* Settle back down */
  100% { opacity: 0.2; transform: translateY(0) scale(1); } /* End with lower opacity, no scale */
}


/* NEW: Container for the two spinning logos */
.loading-logos-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 200px; /* Adjust height as needed to contain logos */
  position: relative; /* For absolute positioning of logos */
  margin-bottom: 20px;
}

.loading-logo {
  position: absolute; /* Position logos within the container */
  max-width: 120px; /* Adjust size as needed */
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); /* Subtle glow effect */
}

.logo-one {
  animation: spin-and-move-logo1 4s ease-in-out infinite alternate;
  left: 35%; /* Initial position */
}

.logo-two {
  animation: spin-and-move-logo2 4s ease-in-out infinite alternate;
  right: 35%; /* Initial position */
}

.logo-three {
  animation: spin-and-move-logo3 4s ease-in-out infinite alternate;
  right: 48%; /* Initial position */
}

@keyframes spin-and-move-logo1 {
  0% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(50px) rotate(180deg); }
  100% { transform: translateX(0) rotate(360deg); }
}

@keyframes spin-and-move-logo2 {
  0% { transform: translateX(0) rotate(-180deg); } /* Reduced movement */
  100% { transform: translateX(0) rotate(-360deg); }
}
@keyframes spin-and-move-logo3 {
  0% { transform: translateX(0) rotate(0deg); }
  50% { transform: translateX(50px) rotate(180deg); }
  100% { transform: translateX(0) rotate(-360deg); }
}


.loading-spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #ffffff; /* White spinner */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


.container {
  display: grid;
  width: 100vw;
  height: 100vh; /* Force it to fill viewport on desktop */
  gap: 0;
  transition: padding-top 0.3s ease; /* Smooth transition for padding-top */
  position: relative; /* Needed for swipe indicators */
}

/* NEW: Adjust container height when the scrolling bar is active */
body.wait-times-active .container {
  height: calc(100vh - var(--wait-times-bar-height)); /* Subtract the height of the scrolling bar */
  transition: opacity 0.5s ease;
}

.stream-container {
  position: relative;
  background-color: #000;
  overflow: hidden;
  display: flex; /* Default to flex for non-chat mobile, and desktop */
  flex-direction: row; /* Explicitly default to row for desktop */
  transition: all 0.3s ease;
  width: 100%; /* Ensure it fills the grid cell's width */
  height: 100%; /* Ensure it fills the grid cell's height */
}

/* NEW: Class to hide the stream container */
.stream-container.hidden-stream {
    display: none !important;
}

/* NEW: Class for applying the border */
.stream-container.with-border {
  border: 2px solid grey; /* Default border when displayVideoBorders is true */
}

/* NEW: Border colors based on stream status */
.stream-container.playing-muted {
  border: 2px solid grey; /* Playing and muted */
}

.stream-container.stopped {
  border: 2px solid red; /* Stopped, paused, ended, buffering, cued, unstarted */
}

.stream-container.playing-unmuted {
  border: 2px solid green; /* Playing and unmuted */
}

/* Stream container when chat is on the right (default for desktop) */
.stream-container.with-chat.chat-right .player-container {
  width: calc(100% - var(--chat-window-width)); /* Adjusted for chat panel width from JS */
  height: 100%; /* Take full height */
}

/* Stream container when chat is on the left */
.stream-container.with-chat.chat-left {
    flex-direction: row-reverse; /* Reverse order to place chat on left */
}
.stream-container.with-chat.chat-left .player-container {
    width: calc(100% - var(--chat-window-width)); /* Adjusted for chat panel width from JS */
    height: 100%; /* Take full height */
}

.player-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden; /* Ensure content scaled down doesn't overflow */
}

.yt-player {
  width: 133.33%; /* 100% / 0.75 to compensate for scale */
  height: 133.33%; /* 100% / 0.75 to compensate for scale */
  position: absolute; /* Position absolutely within player-container */
  top: 0; /* (100 - 75) / 2 = 12.5% of original size. (133.33 - 100) / 2 = 16.665% of new size */
  left: 0; /* (100 - 75) / 2 = 12.5% of original size. (133.33 - 100) / 2 = 16.665% of new size */
  transform: scale(0.75); /* Scale down to 75% */
  transform-origin: 0 0; /* Scale from top-left corner */
}


.channel-label {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 12px;
  z-index: 10;
  margin: 0;
  display: flex;
  max-width: 100%;
  white-space: nowrap;
  overflow: visible;
}

.channel-name-text {
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 0 0 3px 0;
  transition: background-color 0.3s ease;
}

.channel-name-text:hover {
  background: rgba(0, 0, 0, 0.9);
}

.video-title {
  opacity: 0;
  background: rgba(0, 0, 0, 0);
  padding: 2px 8px;
  padding-left: 1px;
  border-radius: 0 0 3px 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 0px;
  max-width: none;
  display: inline-block;
  vertical-align: top;
}

/* Fullscreen overlay controls */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  z-index: 1000;
  display: none;
}

.fullscreen-player-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.fullscreen-yt-player {
  width: 100%;
  height: 100%;
}

.fullscreen-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-overlay:hover .fullscreen-controls {
  opacity: 1;
}

.fullscreen-nav-btn {
  background: rgba(0,0,0,0.7);
  border: none;
  color: white;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-nav-btn:hover {
  background: rgba(70,70,70,0.7);
}

.fullscreen-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.7);
  border: none;
  color: white;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-overlay:hover .fullscreen-close-btn {
  opacity: 1;
}

.fullscreen-channel-label {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0,0,0,0.7);
  padding: 5px 15px;
  font-size: 16px;
  border-radius: 4px;
  z-index: 1001;
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-overlay:hover .fullscreen-channel-label {
  opacity: 1;
}

/* Chat button positions */
.chat-button {
  position: absolute;
  top: 50%;
  /* Default to right, will be overridden by .chat-left */
  right: auto;
  left: 8px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
  opacity: 0;
}

.stream-container:hover .chat-button {
  opacity: 1;
}

.chat-button:hover {
  background: rgba(70, 70, 70, 0.7);
}

.chat-button::after {
  content: "💬";
  font-size: 14px;
}

/* NEW: Like Video Button Styles */
.like-video-btn {
  position: absolute;
  top: calc(50% + 30px); /* Position below chat button */
  right: auto; /* Default to right, will be overridden by .chat-left */
  left: 8px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: all 0.2s ease;
  opacity: 0;
  font-size: 14px; /* Adjust font size for emoji */
}

/* Position like button on the left when .chat-left class is present */
.stream-container.chat-left .like-video-btn {
  left: 8px;
  right: auto;
}

.stream-container:hover .like-video-btn {
  opacity: 1;
}

.like-video-btn:hover {
  background: rgba(70, 70, 70, 0.7);
}


/* NEW: DSN Icon styles */
.dsn-icon-container {
  position: absolute;
  top: calc(50% - 60px); /* Adjust position above hide/chat buttons */
  right: auto; /* Default to right, will be overridden by .chat-left */
  left: 8px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default; /* Not interactive */
  z-index: 20;
  transition: all 0.2s ease;
  opacity: 0; /* Hidden by default, will show on hover */
}

/* Position DSN icon on the left when .chat-left class is present */
.stream-container.chat-left .dsn-icon-container {
  left: 8px;
  right: auto;
}

.stream-container:hover .dsn-icon-container {
  opacity: 1;
}

.dsn-icon {
  width: 18px; /* Adjust size as needed to fit the container */
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}

/* NEW: View Count display styles */
.view-count-display {
  position: absolute;
  top: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  padding: 2px 8px;
  border-radius: 0 0 0 3px;
  font-size: 12px;
  z-index: 10;
  /* Removed opacity and hover effect from here */
  transition: background-color 0.3s ease;
  white-space: nowrap;
  display: flex; /* Always visible by default */
}

/* New class for view count display on hover */
.view-count-display-on-hover {
  opacity: 0; /* Hidden by default */
}

.stream-container:hover .view-count-display-on-hover {
  opacity: 1;
}

.view-count-display:hover {
  background: rgba(0, 0, 0, 0.9);
}


/* Default state for desktop controls */
.chat-button, .hide-btn, .dsn-icon-container, .like-video-btn, .focus-btn { /* ADDED .like-video-btn and .focus-btn */
  display: flex; /* Always visible on desktop by default */
}

/* Default state for mobile controls (hidden on desktop) */
.mobile-controls {
  display: none;
}

.chat-panel {
  width: var(--chat-window-width); /* Uses the CSS variable set by JS */
  height: 100%;
  background: #1e1e1e;
  border-left: 2px solid #333; /* Default border for right chat */
  display: none;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

/* Border for left-positioned chat */
.stream-container.chat-left .chat-panel {
  border-left: none;
  border-right: 2px solid #333;
}

.stream-container.with-chat .chat-panel {
  display: block;
}

.chat-iframe {
  width: calc(100% / var(--chat-scale));
  height: calc(100% / var(--chat-scale));
  border: none;
  transform: scale(var(--chat-scale));
  transform-origin: 0 0;
  position: absolute;
  top: 0;
  left: 0;
}

/* Added styles for the hide button */
.hide-btn {
  position: absolute;
  top: calc(50% - 30px);
  right: auto; /* Default to right, will be overridden by .chat-left */
  left: 8px; /* Ensure right positioning is removed */
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  font-size: 16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Position hide button on the left when .chat-left class is present */
.stream-container.chat-left .hide-btn {
  left: 8px;
  right: auto;
}

.stream-container:hover .hide-btn {
  opacity: 1;
}

.hide-btn:hover {
  background: rgba(70, 70, 70, 0.7);
}

/* NEW: Styles for Placeholder Content */
.placeholder-content {
  display: none; /* Hidden by default */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background-color: #1a1a1a; /* Darker background for placeholders */
  text-align: center;
  padding: 20px;
  gap: 15px; /* Space between elements */
  color: #ccc;
  font-size: 16px;
}

.placeholder-logo1 {
  width: 100px; /* Set a fixed width */
  height: 100px; /* Set a fixed height to ensure same size */
  border-radius: 50%;
  z-index: 1;
  position: relative; /* Keep relative for z-index */
}

.placeholder-logo2 {
  width: 100px; /* Set a fixed width */
  height: 100px; /* Set a fixed height to ensure same size */
  border-radius: 50%;
  z-index: 2; /* Ensure it overlaps logo1 */
  position: relative; /* Keep relative for z-index */
  margin-left: -50px; /* Overlap logo1 by 50% of its width */
}
.placeholder-logo1:hover {
 z-index: 5;
}
.placeholder-logo2:hover {
 z-index: 5;
}
.placeholder-logo3:hover {
 z-index: 5;
}
.placeholder-logo3 {
  width: 100px; /* Set a fixed width */
  height: 100px; /* Set a fixed height to ensure same size */
  border-radius: 50%;
  z-index: 2; /* Ensure it overlaps logo1 */
  position: relative; /* Keep relative for z-index */
  margin-left: -50px; /* Overlap by 50% of its own width */
}

.social-links {
  display: flex;
  gap: 20px;
}

.social-links img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: transform 0.2s ease-in-out;
}

.social-links img:hover {
  transform: scale(1.1);
}

/* Styles for appealing info buttons */
.info-button {
  display: inline-block;
  background-color: #007bff; /* A nice blue background */
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  margin-top: 5px; /* Add some space above the buttons */
  margin-bottom: 5px; /* Add some space below the buttons for better separation */
}

.info-button:hover {
  background-color: #0056b3; /* Darker blue on hover */
  transform: translateY(-2px); /* Slight lift effect */
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15); /* Enhanced shadow on hover */
}

/* NEW: Styles for Scrolling Wait Times Display */
.scrolling-wait-times {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--wait-times-bar-height); /* Use the CSS variable for height */
  background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent dark dark background */
  color: #fff;
  display: flex; /* Use flexbox for vertical alignment */
  align-items: center; /* Vertically align content in the middle */
  overflow: hidden; /* Hide content outside the container */
  white-space: nowrap; /* Keep content on a single line */
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.5); /* Subtle shadow at the top */
  z-index: 102; /* Ensure it's above the right panel (z-index 100) and expanded info bubble (z-index 101) */
  transition: opacity 0.5s ease;
}

.wait-times-content {
  display: inline-block; /* Essential for marquee effect */
  padding-left: 100%; /* Start the content off-screen to the right */
  animation: marquee 60s linear infinite; /* Adjust duration for speed */
  font-size: 14px; /* Ensure font size is set directly for consistent vertical centering */
}

.wait-times-item {
  padding: 0 15px; /* Spacing between each ride's info */
  display: inline-block; /* Keeps items in a line */
}

.wait-times-item.low-wait { color: #8bc34a; } /* Green */
.wait-times-item.medium-wait { color: #ffeb3b; } /* Yellow */
.wait-times-item.high-wait { color: #f44336; } /* Red */
.wait-times-item.closed,
.wait-times-item.down,
.wait-times-item.refurbishment { color: #9e9e9e; } /* Gray */
.wait-times-item.no-wait-info,
.wait-times-item.unknown-status { color: #ff9800; } /* Orange for N/A or no info */


@keyframes marquee {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-100%, 0); } /* Scrolls the entire content width */
}

/* Pause animation on hover */
.scrolling-wait-times:hover .wait-times-content {
  animation-play-state: paused;
}

/* Style for the hide button on the scrolling bar */
.hide-scroll-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 16px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute; /* Position relative to .scrolling-wait-times */
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100; /* Ensure it's above the text */
  transition: background-color 0.2s ease;
}

.hide-scroll-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Original settings-cog-btn styles (now for the one inside the panel) */
.settings-cog-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 16px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  top: auto;
  right: auto;
  z-index: 100;
  transition: background-color 0.2s ease;
  margin: 0 auto; /* Center it within its panel-item */
}

.settings-cog-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* NEW: Styles for the Info Modal (similar to Settings Modal) */
.info-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.info-modal.show {
  display: flex;
}

/* NEW: Styles for the Settings Modal */
.settings-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.settings-modal.show {
  display: flex;
}

.modal-content {
  background-color: #1e1e1e;
  margin: auto; /* Centers the modal horizontally and vertically within the flex container */
  padding: 15px; /* Reduced padding for more condensed display */
  border: 1px solid #888;
  width: 80%; /* Could be responsive */
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  position: relative;
  animation: slideIn 0.3s forwards;
  max-height: 80vh; /* Limit height and allow scroll */
  overflow-y: auto; /* Enable scrolling for content */
}

.modal-content h2 {
  margin-top: 0;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.modal-content .close-button {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.modal-content .close-button:hover,
.modal-content .close-button:focus {
  color: white;
  text-decoration: none;
  cursor: pointer;
}

#park-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 5px; /* Reduced gap for more condensed display */
  margin-bottom: 15px; /* Reduced margin */
}

#park-checkboxes label,
#general-settings-checkboxes label,
#wait-times-settings-checkboxes label { /* Apply to all sections */
  cursor: pointer;
  color: #ddd;
}

#park-checkboxes input[type="checkbox"],
#general-settings-checkboxes input[type="checkbox"],
#wait-times-settings-checkboxes input[type="checkbox"] { /* Apply to all sections */
  width: 18px;
  height: 18px;
  accent-color: #007bff; /* Highlight color for checkbox */
  margin-right: 8px; /* Space between checkbox and label */
}

#general-settings-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 15px; /* Add some space above this section */
  border-top: 1px solid #333; /* Visual separator */
  padding-top: 15px;
}

#wait-times-settings-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 15px;
  border-top: 1px solid #333;
  padding-top: 15px;
}

/* NEW: Accordion styles */
.accordion-item {
  border-top: 1px solid #333;
  padding-top: 15px;
  margin-top: 15px;
}

.accordion-header {
  background: none;
  border: none;
  color: #fff;
  font-size: 1em; /* Matches h3 font size */
  font-weight: bold;
  width: 100%;
  text-align: left;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
}

.accordion-header h3 {
  margin: 0; /* Remove default h3 margin inside button */
  color: inherit; /* Inherit color from button */
  border-bottom: none; /* Remove border from h3 */
  padding-bottom: 0; /* Remove padding from h3 */
}

.accordion-icon {
  font-size: 1.2em;
  transition: transform 0.3s ease-out;
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.accordion-content.active {
  max-height: 500px; /* Adjust as needed to fit content */
}


.save-settings-btn {
  background-color: #007bff;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s ease;
  width: 100%;
}

.save-settings-btn:hover {
  background-color: #0056b3;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.right-panel .panel-logo {
  width: 25px; /* Small logo size */
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
}

/* Adjust the info and settings cog buttons within the panel */
.right-panel .settings-cog-btn,
.right-panel .panel-link-button { /* Apply to all circular buttons in the panel */
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 16px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 100;
  margin: 0 auto; /* Center it within its panel-item */
  padding: 0; /* Remove default padding that might affect centering */
  line-height: 1; /* Helps with vertical centering of single characters/emojis */
}

.right-panel .settings-cog-btn:hover,
.right-panel .panel-link-button:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Tooltip styles */
.panel-item[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: -5px; /* Position to the left of the button */
  transform: translateX(-100%); /* Shift left by its own width */
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 101; /* Ensure tooltip is above other elements */
  opacity: 1;
  visibility: visible;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none; /* Allows clicks to pass through to elements behind tooltip */
}

.panel-item[data-tooltip]::after {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

/* NEW: Styles for the Link Modal */
.link-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.link-modal.show {
  display: flex;
}

.link-modal .modal-content {
  background-color: #1e1e1e;
  margin: auto;
  padding: 15px;
  border: 1px solid #888;
  width: 90%; /* Larger width for iframe content */
  max-width: 1000px; /* Max width for larger screens */
  height: 90%; /* Larger height for iframe content */
  max-height: 90vh; /* Max height for larger screens */
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s forwards;
}

.link-modal .modal-content h2 {
  margin-top: 0;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

#link-modal-iframe {
  flex-grow: 1; /* Allow iframe to take up remaining space */
  width: 100%;
  border: none;
}

/* NEW: About Modal Styles (similar to link-modal but for content) */
.about-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.about-modal.show {
  display: flex;
}

.about-modal .modal-content {
  background-color: #1e1e1e;
  margin: auto;
  padding: 15px;
  border: 1px solid #888;
  width: 80%; /* Standard width for content */
  max-width: 900px; /* Max width for readability */
  max-height: 80vh; /* Limit height and allow scroll */
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
  position: relative;
  animation: slideIn 0.3s forwards;
  overflow-y: auto; /* Enable scrolling for content */
}

.about-modal .modal-content h2 {
  margin-top: 0;
  color: #fff;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

#about-content {
  /* Styles for the fetched content inside the modal */
  color: #ddd;
  line-height: 1.6;
}

#about-content h3 {
  color: #fff;
  margin-top: 20px;
  margin-bottom: 10px;
}

#about-content p {
  margin-bottom: 10px;
}

#about-content a {
  color: #ADD8E6; /* Light blue for links */
  text-decoration: underline;
}


/* NEW: Max Videos Modal Styles */
.max-videos-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.max-videos-modal.show {
  display: flex;
}

.max-videos-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
  margin-bottom: 20px;
}

.max-videos-options .radio-option {
  display: flex;
  align-items: center;
}

.max-videos-options input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #007bff;
  margin-right: 8px;
}

.max-videos-options label {
  cursor: pointer;
  color: #ddd;
}

/* NEW: Donate Modal Styles */
.donate-modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.7); /* Black w/ opacity */
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s forwards;
}

.donate-modal.show {
  display: flex;
}

.donate-modal .modal-content {
  /* Inherits general modal-content styles, but override for wider display */
  max-width: 700px; /* Increased max-width for the donation modal */
}

.donate-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.donate-button {
  background-color: #333;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.donate-button:hover {
  background-color: #555;
  transform: translateY(-2px);
}
