.video-stream {
  z-index: 0;
}

/* Stream Section Info */
.stream-section-info {
  background-color: #121212;
  box-sizing: border-box;
  margin: 0;
  padding: 2vh 10vh;
  color: #fff;
  width: 100%;
  height: max-content;
}

.stream-text {
  font-family: 'Sofia Pro', sans-serif;
  font-size: 3vh;
  line-height: 1.5;
  color: #fff;
  margin-top: 2vh;
  text-align: justify;
}

/* 2) Tablet (~<1200px): −20px */
@media (max-width: 1200px) {
  .stream-information h1 {
    font-size: 40px;
  }

  .video-list-container h2 {
    font-size: 28px;
  }

  .stream-text {
    font-size: 4px;
  }
}

/* 3) Phone (~<768px): another −20px */
@media (max-width: 768px) {
  .stream-information h1 {
    font-size: 20px;
  }

  .video-list-container h2 {
    font-size: 8px;
  }

  .stream-text {
    font-size: 0px;
  }
}

/* Stream Page Styles – Scalable, Immersive, & Future-Ready */

/* 1. Full-Viewport Background “Atmosphere” */
.video-section {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

/* 1. Make sure the bg-player container spans the full viewport */
.video-background-container,
.video-overlay.bg-player {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  width: 150%;
  height: 150%;
  transform: translate(-15%, -15%);
}

/* 2. Apply the blur + darken filter to the container */
.video-overlay.bg-player {
  filter: blur(50px) brightness(0.5);
  pointer-events: none;
}

/* 2. Primary “Control” Player */
.main-player-container {
  position: relative;
  z-index: 1;
  top: 60%;
  transform: translateY(-50%);
  margin: 0 auto;
  width: 100%;
  max-width: 60vw;
  aspect-ratio: 16/9;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  border-radius: 1rem;
  overflow: hidden;
  background: #000;
  /* Ensure black background behind loader */
}

.main-player {
  width: 100%;
  height: 100%;
}

/* Video Loader Overlay */
.video-loader-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  /* Hidden by default via JS inline style or class toggle */
  justify-content: center;
  align-items: center;
  z-index: 10;
  pointer-events: none;
  /* Let clicks pass through if needed, though usually blocking is fine */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-loader-overlay.active {
  opacity: 1;
}

.video-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ff820d;
  animation: spin 1s ease-in-out infinite;
}

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

/* 3. Video Gallery & Filter Controls */
.video-gallery-section {
  background-color: #121212;
  padding: 5vh 10vh;
}

/* ─────────────────────────────────────────────────────────────
   1. Container & Layout for Filters
   ───────────────────────────────────────────────────────────── */
/* ─────────────────────────────────────────────────────────────
   1. Container & Layout for Filters (Modern & Glassy)
   ───────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  background-color: #1a1a1a;
  /* slightly darker/smoother than #222 */
  padding: 2rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  border: 1px solid #333;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  align-items: flex-end;
  /* Align inputs and buttons nicely */
}

/* Each label + input/select combo */
.filter-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
}

/* ─────────────────────────────────────────────────────────────
   2. Label Styling (Crisp & Legible)
   ───────────────────────────────────────────────────────────── */
.filter-field label {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #aaa;
  margin-bottom: 0.5rem;
  font-family: 'Sofia Pro', sans-serif;
}

/* Shared Input / Select Styles (Modern SaaS look) */
.filter-field input[type="text"],
.filter-field input[type="date"],
.filter-field select {
  width: 100%;
  max-width: 100%;
  /* Prevent overflow on iOS */
  min-width: 0;
  /* CSS Grid/Flexbox fix */
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 0.5rem;
  color: #fff;
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: 'Sofia Pro', sans-serif;
  height: 48px;
  /* Consistent height for desktop */

  /* Reset appearance for iOS */
  -webkit-appearance: none;
  appearance: none;
}

/* Placeholder */
.filter-field input::placeholder {
  color: #777;
  opacity: 1;
  /* Firefox fix */
}

/* Hover & Focus states */
.filter-field input:hover,
.filter-field select:hover {
  background-color: #333;
  border-color: #666;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: #ff820d;
  /* Brand accent */
  background-color: #333;
  box-shadow: 0 0 0 3px rgba(255, 130, 13, 0.2);
  /* Soft glow ring */
}

/* ─────────────────────────────────────────────────────────────
   4. Button Group Styling (Refined)
   ───────────────────────────────────────────────────────────── */
.filter-buttons {
  display: flex;
  gap: 1rem;
  flex: 0 0 auto;
}

.filter-buttons button {
  padding: 0 1.5rem;
  height: 48px;
  /* Match input height */
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 0.5rem;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 100px;
  font-family: 'Sofia Pro', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Search Button (Primary) */
.filter-buttons #search-btn {
  background: linear-gradient(135deg, #ff820d, #da683b);
  box-shadow: 0 4px 15px rgba(218, 104, 59, 0.4);
}

.filter-buttons #search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(218, 104, 59, 0.6);
  filter: brightness(1.1);
}

.filter-buttons #search-btn:active {
  transform: translateY(0);
}

/* Reset Button (Secondary) */
.filter-buttons #reset-btn {
  background-color: #333;
  color: #bbb;
  border: 1px solid #444;
}

.filter-buttons #reset-btn:hover {
  background-color: #444;
  color: #fff;
  border-color: #666;
}

/* ─────────────────────────────────────────────────────────────
   5. Responsive Adjustments
   ───────────────────────────────────────────────────────────── */
/* Under 600px: stack everything vertically */
@media (max-width: 600px) {
  .filters {
    flex-direction: column;
    gap: 1vh;
  }

  .filter-buttons {
    flex-direction: column;
    gap: 1vh;
  }

  .filter-buttons button {
    width: 100%;
  }
}


/* 4. Responsive Grid for Thumbnails */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.thumbnail:hover {
  transform: scale(1.05);
}

.thumbnail img {
  width: 100%;
  display: block;
}

.thumbnail-title {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 0.5rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 0.9rem;
}

/* 5. Responsive Adjustments */

/* Tablet & Mobile shared tweaks */
@media (max-width: 1024px) {
  .main-player-container {
    max-width: 80vw;
  }
}

/* Mobile-First Enhancements */
@media (max-width: 768px) {

  /* Expand player to nearly full width for better viewing */
  .main-player-container {
    max-width: 95vw;
    top: 55%;
    /* slightly higher */
  }

  /* Reduce padding on gallery container */
  .video-gallery-section {
    padding: 2vh 3vh;
  }

  /* Stack filters vertically and make full width */
  .filters {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: stretch;
  }

  .filter-field {
    width: 100%;
    flex: 0 0 auto;
  }

  /* Enforce equal height and width for all inputs */
  .filter-field input[type="text"],
  .filter-field input[type="date"],
  .filter-field select {
    width: 100%;
    height: 54px;
    /* Fixed height for strictly equal vertical size */
    padding: 0 1.25rem;
    /* Comfortable touch padding */
    font-size: 1rem;
    line-height: normal;
    /* Let flex/padding handle centering */
  }

  .filter-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    /* Stack buttons too for consistency */
    gap: 1rem;
  }

  .filter-buttons button {
    width: 100%;
    /* Full width */
    height: 54px;
    /* Match input height */
    padding: 0 1rem;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* Adjust Grid for smaller screens */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    /* smaller min-width allows 2 columns on phones */
    gap: 1rem;
  }

  .stream-section-info {
    padding: 3vh 5vw;
  }

  .stream-text {
    font-size: 1rem;
    /* Ensure legible text size */
    text-align: left;
    /* Justify can look weird on mobile */
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .grid {
    grid-template-columns: 1fr;
    /* Single column for very narrow devices */
  }
}

/* Pagination Adjustments on Mobile */
@media (max-width: 600px) {
  .pagination-container {
    flex-direction: column;
    gap: 1rem;
  }

  .pagination-container button {
    width: 100%;
    padding: 12px;
  }
}

/* Error Overlay */
#error-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: 'Sofia Pro', sans-serif;
  font-size: 2vh;
}

#error-overlay button {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background: #444;
  color: #fff;
  font-size: 1.5vh;
  cursor: pointer;
}



/* Pagination Base Styles */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem;
}

.pagination-container button {
  background-color: #333;
  color: #fff;
  border: 1px solid #444;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: 'Sofia Pro', sans-serif;
}

.pagination-container button:hover:not(:disabled) {
  background-color: #ff820d;
  color: #000;
  border-color: #ff820d;
}

.pagination-container button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  color: #999;
  font-family: 'Sofia Pro', sans-serif;
  font-size: 0.9rem;
}

/* Archive Notice / Older Stream Message */
#archive-notice {
  grid-column: 1 / -1;
  background: #1a1a1a;
  color: #ccc;
  padding: 1.5rem;
  border-radius: 0.5rem;
  border-left: 4px solid #ff820d;
  margin-bottom: 2rem;
  font-family: 'Sofia Pro', sans-serif;
  display: none;
  /* Controlled by JS */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#archive-notice h4 {
  margin: 0 0 0.5rem;
  color: #fff;
  font-family: 'Sofia Pro', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

#archive-notice p {
  margin: 0;
  font-size: 1rem;
  font-family: 'Sofia Pro', sans-serif;
  line-height: 1.5;
}

#archive-notice a {
  color: #ff820d;
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s;
}

#archive-notice a:hover {
  color: #fff;
}