/*
 * Jellyfin Slideshow by M0RPH3US v4.0.1
 * Modified by CodeDevMLH
 * 
 * New features:
 * - optional Trailer background video support (youtube or local trailer/backdrop videos)
 * - option to make video backdrops full width
 * - SponsorBlock support to skip intro/outro segments
 * - option to always show arrows
 * - option to disable/enable keyboard controls
 * - option to show/hide trailer button if trailer as backdrop is disabled (opens in a modal)
 * - option to wait for trailer to end before loading next slide
 * - option to set a maximum for the pagination dots (will turn into a counter style if exceeded)
 * - option to disable loading screen
 * - option to put collection (boxsets) IDs into the slideshow to display their items
 * - option to enable client-side settings (allow users to override settings locally on their device)
 * - option to enable seasonal content (only show items that are relevant to the current season/holiday)
 * - option to prefer local trailers or backdrop videos (from the media item) over online sources
 * - options to sort the content by various criteria (PremiereDate, ProductionYear, Random, Original order, etc.)
 * - options to set parental rating and release date limits to filter out unwanted content
 * - options to customize the overlay (text, image, style, position, etc.) with e.g. seasonal messages or custom branding
 * - many other settings in the advanced settings tab
 */

/*
 * Archivo Narrow, served from the plugin instead of fonts.googleapis.com.
 *
 * This used to be an @import of the Google Fonts stylesheet. An @import is discovered
 * only once this file has been downloaded and parsed, so the font sat three round trips
 * deep behind index.html and blocked first paint the whole way. Worse, a Jellyfin box on
 * a LAN with no route to the internet held the page until DNS gave up.
 *
 * The files are embedded resources under Web/assets/fonts and are served by
 * JellyBarController with a one-year immutable Cache-Control, so a viewer pays for the
 * one subset their language needs exactly once. The unicode-range split is kept as
 * Google ships it: a Latin reader never downloads the Vietnamese or extended cuts.
 *
 * Archivo Narrow is licensed under the SIL Open Font License 1.1; see assets/fonts/OFL.txt.
 */

/* vietnamese */
@font-face {
  font-family: "Archivo Narrow";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/archivo_narrow_vietnamese.woff2) format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/* latin-ext */
@font-face {
  font-family: "Archivo Narrow";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/archivo_narrow_latin_ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
  font-family: "Archivo Narrow";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(assets/fonts/archivo_narrow_latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* @import url(https://fonts.googleapis.com/icon?family=Material+Icons); */

.jb-backdrop.jb-animate {
  animation: kenBurnsZoomIn 10s linear forwards;
  will-change: transform;
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.jb-slideshow-paused .jb-backdrop.jb-animate,
.jb-slideshow-paused .jb-logo.jb-animate {
  animation-play-state: paused !important;
}

.jb-logo.jb-animate {
  animation: logoFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes logoFadeIn {
  from {
    opacity: 0.6;
  }

  to {
    opacity: 1;
  }
}


@keyframes kenBurnsZoomIn {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.08);
  }
}

.jb-bar-loading {
  z-index: 99999999 !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
  overflow: hidden;
  /*will-change: opacity;*/
}

.jb-bar-loading.hide {
  opacity: 0;
}

.jb-loader-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 250px;
  height: auto;
}

.jb-bar-loading h1 {
  width: 250px;
  margin: 0 auto;
  height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.jb-bar-loading h1 div {
  width: 250px;
  max-height: 250px;
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.jb-progress-container {
  width: 200px;
  height: 6px;
  display: flex;
  align-items: center;
  position: relative;
}

.jb-progress-bar {
  height: 5px;
  background: white;
  border-radius: 2px;
  transition: width 0.2s ease-in-out;
}

.jb-progress-gap {
  width: 6px;
  height: 5px;
  background: transparent;
  flex-shrink: 0;
}

.jb-unfilled-bar {
  height: 5px;
  background: #686868;
  border-radius: 2px;
  flex-grow: 1;
  transition: width 0.2s ease-in-out;
}

.layout-mobile .splashLogo {
  height: 12%;
}

/* The placeholder is a small image stretched to full width, so it is softened
   deliberately and sharpens as the full-size backdrop swaps in. */
.jb-backdrop.jb-low-quality {
  opacity: 0.85;
  filter: blur(6px);
  transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
}

/* Settles at the configured backdrop blur, which is none unless the user set one.
   --jb-backdrop-blur is only published when there is a blur to apply. */
.jb-backdrop.jb-high-quality {
  opacity: 1;
  filter: blur(var(--jb-backdrop-blur, 0px));
  transition: opacity 0.3s ease-in-out, filter 0.3s ease-in-out;
}

/* With no blur configured, and no zoom already holding a layer open, there is
   nothing left for the filter to do once the de-blur has played out - and blur(0)
   is not free: any filter other than none pins its own compositing layer for the
   life of the slide. Added by releaseBackdropFilter, taken off if a blur is set.
   Must stay after .jb-high-quality - equal specificity, so order decides.
   filter is dropped from the transition here on purpose: blur(0px) and none are
   not interpolatable, so transitioning between them flips discretely at the
   halfway mark, which lands as a second visible step a few hundred ms after the
   image has already settled. */
.jb-backdrop.jb-filter-released {
  filter: none;
  transition: opacity 0.3s ease-in-out;
}

/* Full-screen blur is expensive on TV browsers; they get the plain upscale, and
   never the configured blur either. The placeholder's opacity is reset with it,
   otherwise a TV shows an unblurred placeholder still dimmed to 85%. */
body.jb-media-bar-tv-mode .jb-backdrop,
html.jb-media-bar-tv-mode .jb-backdrop {
  filter: none;
  opacity: 1;
}

.jb-logo.jb-low-quality {
  filter: brightness(1) blur(0.5px);
  transition: filter 0.3s ease-in-out;
}

.jb-logo.jb-high-quality {
  filter: brightness(1.1) blur(0);
  transition: filter 0.3s ease-in-out;
}

.homeSectionsContainer {
  position: relative;
  top: 65vh;
  z-index: 6;
}

#jb-slides-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 90vh;
  overflow: hidden;
  margin: 0 auto;
  pointer-events: auto;
  outline: none;
  z-index: 1;
}

#jb-slides-container[style*="display: none"],
#jb-slides-container[style*="visibility: hidden"] {
  pointer-events: none !important;
}

.jb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  cursor: pointer;
  color: #fff;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  text-align: center;
  -webkit-tap-highlight-color: #fff0;
  transition: background-color 0.3s ease, transform 0.2s ease, color 0.2s ease, filter 0.2s ease;
  user-select: none;
  margin: 0;
  padding: 0;
}

/* TV Mode: Blue left/right arrows only when slideshow container itself is directly focused (slide navigation mode) */
:is(.layout-tv, .jb-media-bar-tv-mode) #jb-slides-container:focus:not(:has(button:focus)) .jb-arrow,
:is(.layout-tv, .jb-media-bar-tv-mode) #jb-slides-container.jb-is-container-focused .jb-arrow {
  color: var(--jf-palette-primary-main, #00a4dc) !important;
  fill: var(--jf-palette-primary-main, #00a4dc) !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(-50%) scale(1.25) !important;
  filter: drop-shadow(0 0 10px rgba(0, 164, 220, 0.9)) !important;
}

:is(.layout-tv, .jb-media-bar-tv-mode) #jb-slides-container:focus:not(:has(button:focus)) .jb-arrow i,
:is(.layout-tv, .jb-media-bar-tv-mode) #jb-slides-container.jb-is-container-focused .jb-arrow i {
  color: var(--jf-palette-primary-main, #00a4dc) !important;
}

.jb-arrow i {
  display: block;
  font-size: 24px;
  line-height: 40px;
  width: 100%;
  height: 100%;
  text-align: center;
  margin: 0;
  padding: 0;
}

.jb-arrow:hover {
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  transform: translateY(-50%) scale(1.1);
}

.jb-left-arrow {
  left: 20px;
}

.jb-right-arrow {
  right: 20px;
}

.jb-pause-button {
  position: absolute;
  top: 5rem;
  right: 0.8rem;
  cursor: pointer;
  color: white;
  z-index: 10;
  opacity: 0.3;
  transition: opacity 0.3s ease;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.jb-pause-button i {
  font-size: 1.5rem;
}

.jb-pause-button:hover {
  opacity: 0.9;
}

.jb-mute-button {
  position: absolute;
  top: 5rem;
  right: 3.5rem;
  cursor: pointer;
  color: white;
  z-index: 10;
  opacity: 0.3;
  transition: opacity 0.3s ease;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.jb-mute-button i {
  font-size: 1.5rem;
}

.jb-mute-button:hover {
  opacity: 0.9;
}

/* Jellyfin v12 Desktop Overrides */
body.jb-jellyfin-v12 .jb-pause-button {
  top: 4rem;
  right: calc(1.2rem + 2.8vw);
  line-height: 1;
}

body.jb-jellyfin-v12 .jb-mute-button {
  top: 4rem;
  right: calc(4rem + 2.8vw);
  line-height: 1;
}

body.jb-jellyfin-v12 .jb-pause-button i,
body.jb-jellyfin-v12 .jb-mute-button i {
  font-size: 1.5rem;
  line-height: 1;
  vertical-align: middle;
}

@media (max-width: 768px) {

  .jb-pause-button i,
  body.jb-jellyfin-v12 .jb-pause-button i,
  .jb-mute-button i,
  body.jb-jellyfin-v12 .jb-mute-button i {
    font-size: 2.5rem;
  }
}


.jb-dots-container {
  position: absolute;
  top: calc(50% + 18vh);
  right: 3%;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  width: auto;
  height: auto;
  transition: opacity 0.3s ease-in-out;
  padding-bottom: 16px !important;
}

.jb-dot {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin: 0 5px;
  background-color: #cecece99;
  border-radius: 50%;
  transform-origin: center;
  transition:
    transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    background-color 0.5s ease-in-out;
}

.jb-dot.jb-active {
  background-color: #fff;
  transform: scale(1.7);
}

.jb-slide {
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.5s ease-in-out;
  z-index: 0;
  cursor: default;
}

.jb-media-bar-mobile-16-9 .jb-slide,
.jb-media-bar-mobile-4-3 .jb-slide {
  cursor: pointer;
}

.jb-slide.jb-active {
  opacity: 1;
  z-index: 1;
}

.jb-backdrop-container {
  position: absolute;
  top: 0%;
  right: 0%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 5px;
  mask-image: linear-gradient(to top,
      rgba(255, 255, 255, 0) 2%,
      rgba(0, 0, 0, 0.5) 6%,
      #000000 8%);
  -webkit-mask-image: linear-gradient(to top,
      rgba(255, 255, 255, 0) 2%,
      rgba(0, 0, 0, 0.5) 6%,
      #000000 8%);
}

.jb-backdrop-container.jb-full-width-video,
.jb-backdrop-container:has(.jb-video-backdrop-full) {
  overflow: hidden;
  mask-image: linear-gradient(to top,
      #fff0 0%,
      #fff0 10%,
      #000 25%);
  -webkit-mask-image: linear-gradient(to top,
      #fff0 0%,
      #fff0 10%,
      #000 25%);
}

.jb-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 5px;
  z-index: 2;
  transition: opacity 1.2s ease-in-out;
}

.jb-backdrop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 5px;
  z-index: 3;
  mask-image: linear-gradient(to top,
      rgba(255, 255, 255, 0) 2%,
      rgba(0, 0, 0, 0.5) 4%,
      #000000 6%);
  -webkit-mask-image: linear-gradient(to top,
      rgba(255, 255, 255, 0) 2%,
      rgba(0, 0, 0, 0.5) 4%,
      #000000 6%);
  transition: opacity 1.2s ease-in-out;
}


.jb-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(130deg,
      rgba(29, 29, 29, 0.65) 10%,
      rgba(29, 29, 29, 0.35) 30%,
      rgba(29, 29, 29, 0) 100%);
  z-index: 4;
  mask-image: linear-gradient(to top,
      rgba(255, 255, 255, 0) 2%,
      rgba(0, 0, 0, 0.5) 4%,
      #000000 6%);
  -webkit-mask-image: linear-gradient(to top,
      rgba(255, 255, 255, 0) 2%,
      rgba(0, 0, 0, 0.5) 4%,
      #000000 6%);
}

.jb-gradient-overlay.jb-full-width-video {
  z-index: 4;
  mask-image: linear-gradient(to top,
      #fff0 0%,
      #fff0 10%,
      #000 25%);
  -webkit-mask-image: linear-gradient(to top,
      #fff0 0%,
      #fff0 10%,
      #000 25%);
}

.jb-logo-container {
  width: 40%;
  height: 35%;
  position: relative;
  display: flex;
  align-items: center;
  z-index: 5;
  top: 15vh;
  left: 4vw;
}

.jb-logo {
  max-height: 70%;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  filter: brightness(1.5);
  font-size: 4rem;
}

.jb-logo-title-fallback {
  color: #fff;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  padding-bottom: 0.2em;
  margin-bottom: -0.2em;
}

.jb-plot-container {
  position: absolute;
  top: calc(50% + 8vh);
  color: #fff;
  height: 15%;
  width: 90%;
  left: 4vw;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: justify;
  box-sizing: border-box;
}

.jb-plot {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jb-plot-container.jb-constrained-plot {
  width: 40%;
}

.jb-plot-container.jb-constrained-plot .jb-plot {
  line-clamp: 3;
  -webkit-line-clamp: 3;
}

.jb-genre {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: calc(50% + 4vh);
  left: 4vw;
  text-align: center;
  color: #fff;
  font-family: "Archivo Narrow", sans-serif;
  z-index: 5;
  flex-wrap: wrap;
}

.jb-button-container {
  position: absolute;
  top: calc(50% + 17vh);
  left: 4vw;
  display: flex;
  z-index: 5;
  justify-content: space-between;
  gap: 15px;
}

.jb-play-button,
.jb-trailer-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: solid 0px rgba(255, 255, 255, 0);
  font-family: "Archivo Narrow", sans-serif;
  font-size: 18px;
  white-space: nowrap;
  background-color: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 700;
  gap: 6px;
  -webkit-tap-highlight-color: #fff0;
  border-radius: 8px;
}

.jb-detail-button {
  font-size: 18px;
  background-color: rgb(255, 255, 255);
  color: rgb(0, 0, 0);
  border-radius: 50%;
  height: 50px;
  width: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: #fff0;
}

.jb-favorite-button {
  font-size: 18px;
  background-color: rgb(255, 255, 255);
  color: red;
  border-radius: 50%;
  height: 50px;
  width: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: #fff0;
}

.jb-favorite-button.jb-favorited {
  color: red;
}

.jb-favorite-button::before {
  content: "favorite_outline";
  font-family: "Material Icons";
}

.jb-favorite-button.jb-favorited::before {
  content: "favorite";
  font-family: "Material Icons";
}

.jb-play-button::before {
  content: "play_arrow";
  font-family: "Material Icons";
}

.jb-detail-button::before {
  content: "info_outline";
  font-family: "Material Icons";
}

.jb-play-button::before,
.jb-detail-button::before,
.jb-favorite-button::before,
.jb-favorite-button.jb-favorited::before {
  font-weight: 600;
  display: inline-block;
  font-size: 22px;
  color: inherit;
  vertical-align: middle;
}

.jb-play-button:hover,
.jb-detail-button:hover,
.jb-favorite-button:hover,
.jb-trailer-button:hover {
  opacity: 0.8;
}

/* Button Focus Styles, TV mode only */
:is(.layout-tv, .jb-media-bar-tv-mode, .jb-is-tv-focused) :is(#jb-slides-container button, .jb-pause-button, .jb-mute-button):is(:focus, :focus-visible, .jb-is-focused) {
  outline: 3px solid var(--jf-palette-primary-main, #00a4dc) !important;
  outline-offset: 3px !important;
  transform: scale(1.15) !important;
  box-shadow: 0 0 15px rgba(0, 164, 220, 0.8), 0 0 5px rgba(255, 255, 255, 0.9) !important;
  opacity: 1 !important;
  z-index: 10 !important;
  font-weight: 800 !important;
}

/* Disable focus ring on Desktop / Mobile mouse click */
#jb-slides-container :is(button, .jb-pause-button, .jb-mute-button):focus {
  outline: none;
  box-shadow: none;
}

/* Navbar Settings Icon Focus in TV mode only */
.layout-tv .jb-media-bar-settings-button:focus,
.layout-tv .jb-media-bar-settings-button:focus-visible,
.layout-tv .jb-media-bar-settings-button.jb-is-focused,
.jb-media-bar-tv-mode.jb-media-bar-settings-button:focus,
.jb-media-bar-tv-mode.jb-media-bar-settings-button:focus-visible,
.jb-media-bar-tv-mode.jb-media-bar-settings-button.jb-is-focused {
  background: none !important;
  background-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  transform: scale(1.35) !important;
  transition: transform 0.2s ease-in-out !important;
}

.layout-tv .jb-media-bar-settings-button:focus img,
.layout-tv .jb-media-bar-settings-button:focus-visible img,
.layout-tv .jb-media-bar-settings-button.jb-is-focused img,
.jb-media-bar-tv-mode.jb-media-bar-settings-button:focus img,
.jb-media-bar-tv-mode.jb-media-bar-settings-button:focus-visible img,
.jb-media-bar-tv-mode.jb-media-bar-settings-button.jb-is-focused img {
  filter: invert(48%) sepia(85%) saturate(1832%) hue-rotate(167deg) brightness(98%) contrast(101%) !important;
  transform: scale(1.1) !important;
  transition: transform 0.2s ease-in-out !important;
}

/* Client Settings Popup Focus Styles - TV mode only */
.layout-tv .jb-media-bar-client-tab:focus,
.layout-tv .jb-media-bar-client-tab:focus-visible,
.layout-tv .jb-media-bar-switch:focus,
.layout-tv .jb-media-bar-switch:focus-visible,
.layout-tv .jb-media-bar-switch:focus-within,
.layout-tv .jb-media-bar-select:focus,
.layout-tv .jb-media-bar-select:focus-visible,
.layout-tv .jb-media-bar-btn:focus,
.layout-tv .jb-media-bar-btn:focus-visible,
.layout-tv .jb-media-bar-settings-close-button:focus,
.layout-tv .jb-media-bar-settings-close-button:focus-visible,
.jb-media-bar-tv-mode .jb-media-bar-client-tab:focus,
.jb-media-bar-tv-mode .jb-media-bar-client-tab:focus-visible,
.jb-media-bar-tv-mode .jb-media-bar-switch:focus,
.jb-media-bar-tv-mode .jb-media-bar-switch:focus-visible,
.jb-media-bar-tv-mode .jb-media-bar-switch:focus-within,
.jb-media-bar-tv-mode .jb-media-bar-select:focus,
.jb-media-bar-tv-mode .jb-media-bar-select:focus-visible,
.jb-media-bar-tv-mode .jb-media-bar-btn:focus,
.jb-media-bar-tv-mode .jb-media-bar-btn:focus-visible,
.jb-media-bar-tv-mode .jb-media-bar-settings-close-button:focus,
.jb-media-bar-tv-mode .jb-media-bar-settings-close-button:focus-visible {
  outline: 3px solid var(--jf-palette-primary-main, #00a4dc) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 12px rgba(0, 164, 220, 0.8) !important;
  border-radius: 6px !important;
}

#jb-slides-container:focus,
#jb-slides-container:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  transform: none !important;
}

.jb-info-container {
  position: absolute;
  top: calc(50% + 0vh);
  display: flex;
  align-items: center;
  justify-content: center;
  left: 4vw;
  color: #fff;
  z-index: 5;
  align-content: center;
  flex-wrap: wrap;
  font-weight: 500;
}

.jb-misc-info {
  font-family: "Archivo Narrow", sans-serif;
  display: flex;
  align-items: center;
  z-index: 5;
  position: relative;
  gap: 10px;
}

.jb-runTime {
  font-family: "Archivo Narrow", sans-serif;
  display: flex;
  align-items: center;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  font-weight: 500;
}

/* Star Icon Styling */
.jb-community-rating-star {
  color: #f2b01e;
  font-size: 1.4em;
  height: auto !important;
  margin-right: 0.125em;
  width: auto !important;
}

.jb-star-rating-container {
  display: flex;
  align-items: center;
}

/* Rotten Tomatoes Critic Rating Styles */

.jb-critic-rating {
  -webkit-align-items: center;
  align-items: center;
  display: flex;
  min-height: 1.2em;
  gap: 0.25em;
}

/**/

.jb-age-rating {
  display: flex;
  align-items: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  border: none;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0.5em;
}

.jb-date {
  font-family: "Archivo Narrow", sans-serif;
  font-weight: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
}

.jb-separator-icon {
  font-size: 10px;
  color: aquamarine;
}

.jb-featured-content {
  display: none;
}

/*Portrait-Modes Phone*/
@media only screen and (max-width: 767px) and (orientation: portrait) {

  /* Position pause/mute buttons below navbar on mobile in all modes */
  .jb-pause-button {
    top: 115px !important;
    right: 15px !important;
    opacity: 0.6 !important;
  }

  .jb-mute-button {
    top: 115px !important;
    right: 55px !important;
    opacity: 0.6 !important;
  }

  /* Jellyfin v12 Mobile Overrides */
  body.jb-jellyfin-v12 .jb-pause-button {
    top: 68px !important;
    right: 17px !important;
  }

  body.jb-jellyfin-v12 .jb-mute-button {
    top: 68px !important;
    right: 58px !important;
  }

  /* Default mobile view on v12 */
  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .homeSectionsContainer {
    top: 73vh !important;
  }

  body.jb-jellyfin-v12.jb-media-bar-has-counter:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .homeSectionsContainer {
    top: 74vh !important;
  }

  /* Compact 16:9 & 4:3 mobile views on v12 */
  body.jb-jellyfin-v12.jb-media-bar-mobile-16-9 #jb-slides-container,
  body.jb-jellyfin-v12.jb-media-bar-mobile-4-3 #jb-slides-container {
    top: 50px !important;
  }

  body.jb-jellyfin-v12.jb-media-bar-mobile-16-9 .jb-progress-bar-navbar,
  body.jb-jellyfin-v12.jb-media-bar-mobile-4-3 .jb-progress-bar-navbar {
    top: 50px !important;
  }

  body.jb-jellyfin-v12.jb-media-bar-mobile-16-9 .homeSectionsContainer {
    top: calc(56vw + 30px) !important;
  }

  body.jb-media-bar-mobile-16-9.jb-media-bar-has-counter .homeSectionsContainer {
    top: calc(56vw + 43px);
  }

  body.jb-jellyfin-v12.jb-media-bar-mobile-4-3 .homeSectionsContainer {
    top: calc(75vw + 27px) !important;
  }

  body.jb-media-bar-mobile-4-3.jb-media-bar-has-counter .homeSectionsContainer {
    top: calc(75vw + 39px);
  }

  .jb-pause-button i,
  .jb-mute-button i {
    font-size: 2.2rem !important;
  }

  .jb-progress-bar-navbar {
    top: 108px !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-progress-bar-navbar,
  body.jb-media-bar-mobile-4-3 .jb-progress-bar-navbar {
    top: 4px !important;
  }

  body.jb-media-bar-mobile-16-9 #jb-slides-container {
    position: absolute !important;
    top: 104px !important;
    left: 0;
    height: calc(56.25vw + 35px) !important;
  }

  body.jb-media-bar-mobile-16-9.jb-media-bar-has-counter #jb-slides-container {
    height: calc(56.25vw + 42px) !important;
  }

  body.jb-media-bar-mobile-4-3 #jb-slides-container {
    position: absolute !important;
    top: 104px !important;
    left: 0;
    height: calc(75vw + 35px) !important;
  }

  body.jb-media-bar-mobile-4-3.jb-media-bar-has-counter #jb-slides-container {
    height: calc(75vw + 42px) !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-pause-button,
  body.jb-media-bar-mobile-4-3 .jb-pause-button {
    top: 15px !important;
    right: 15px !important;
    opacity: 0.6 !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-mute-button,
  body.jb-media-bar-mobile-4-3 .jb-mute-button {
    top: 15px !important;
    right: 55px !important;
    opacity: 0.6 !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-pause-button i,
  body.jb-media-bar-mobile-16-9 .jb-mute-button i,
  body.jb-media-bar-mobile-4-3 .jb-pause-button i,
  body.jb-media-bar-mobile-4-3 .jb-mute-button i {
    font-size: 2.2rem !important;
  }

  .jb-plot-container {
    display: none;
  }

  .jb-backdrop-container {
    position: absolute;
    right: 0%;
    width: 100%;
    height: 100%;
    overflow: hidden;
    mask-image: linear-gradient(to top,
        rgba(255, 255, 255, 0) 2%,
        rgba(0, 0, 0, 0.5) 7%,
        #000000 12%);
    -webkit-mask-image: linear-gradient(to top,
        rgba(255, 255, 255, 0) 2%,
        rgba(0, 0, 0, 0.5) 7%,
        #000000 12%);
  }

  .jb-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    z-index: 3;
  }

  .jb-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.25);
    z-index: 4;
    pointer-events: none;
    mask-image: linear-gradient(to top,
        rgba(255, 255, 255, 0) 2%,
        rgba(0, 0, 0, 0.5) 7%,
        #000000 12%);
    -webkit-mask-image: linear-gradient(to top,
        rgba(255, 255, 255, 0) 2%,
        rgba(0, 0, 0, 0.5) 7%,
        #000000 12%);
  }

  .jb-dots-container {
    top: calc(50% + 20vh);
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background-color: #ffffff00;
    width: max-content;
    max-width: 90vw;
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 10px 0 16px 0 !important;
  }

  .jb-dot {
    flex-shrink: 0;
  }

  .jb-dot.jb-active {
    transform: scale(1.6);
  }

  .jb-genre {
    top: calc(50% + 15vh);
    left: 50%;
    width: 100%;
    transform: translateX(-50%);
  }

  .jb-info-container {
    top: calc(50% + 10vh);
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
  }

  .jb-button-container {
    top: calc(50% + 25vh);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 98vw;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 15px;
  }

  .jb-button-container button {
    margin: 0 !important;
    min-width: 0 !important;
  }

  .jb-button-container .jb-detail-button,
  .jb-button-container .jb-favorite-button {
    flex-shrink: 0;
  }

  .jb-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    max-height: 60%;
    max-width: 100%;
    width: auto;
    z-index: 5;
    filter: brightness(1.5);
    transform: translate(-50%, -50%);
    transition: filter 0.3s ease;
  }

  .jb-logo-container {
    width: 75%;
    height: 25%;
    position: relative;
    display: flex;
    align-items: start;
    z-index: 5;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  @media (max-width: 400px) {
    .jb-button-container {
      gap: 10px;
    }

    .jb-play-button,
    .jb-trailer-button {
      padding: 8px 14px;
    }

    .jb-misc-info {
      flex-wrap: wrap;
      justify-content: center;
      gap: 0px 10px;
    }

    .jb-runTime {
      width: 100%;
      justify-content: center;
      margin-top: 0.5vh;
    }

    .jb-misc-info .jb-separator-icon:last-of-type {
      display: none;
    }

    .jb-genre {
      top: calc(50% + 16vh);
    }

    .jb-logo-title-fallback {
      font-size: 1rem !important;
      white-space: normal;
      word-wrap: break-word;
      word-break: break-word;
    }
  }

  /* Minimalist Compact Mode Overrides (16:9) */
  body.jb-media-bar-mobile-16-9 .homeSectionsContainer {
    top: calc(56vw + 16px);
  }

  body.jb-media-bar-mobile-16-9.jb-media-bar-has-counter .homeSectionsContainer {
    top: calc(58vw + 12px);
  }

  body.jb-media-bar-mobile-16-9 .jb-backdrop-container,
  body.jb-media-bar-mobile-16-9 .jb-gradient-overlay {
    height: 100%;
    mask-image: linear-gradient(to bottom, #000 60%, rgba(0, 0, 0, 0.4) 80%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, rgba(0, 0, 0, 0.4) 80%, transparent 100%) !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-backdrop {
    object-position: center center;
  }

  body.jb-media-bar-mobile-16-9 .jb-genre,
  body.jb-media-bar-mobile-16-9 .jb-button-container {
    display: none !important;
  }

  /* Style metadata info container in compact 16:9 format (bottom-right) */
  body.jb-media-bar-mobile-16-9 .jb-info-container {
    display: flex !important;
    position: absolute;
    top: calc(56.25vw - 15px);
    right: 15px;
    left: auto;
    width: auto !important;
    justify-content: flex-end !important;
    z-index: 10;
    pointer-events: none;
    transform: translateY(-100%);
    font-size: 0.95rem;
    font-weight: 500;
  }

  /* Hide community/critic ratings and default separators in compact 16:9 format */
  body.jb-media-bar-mobile-16-9 .jb-info-container .jb-star-rating-container,
  body.jb-media-bar-mobile-16-9 .jb-info-container .jb-critic-rating,
  body.jb-media-bar-mobile-16-9 .jb-info-container .jb-separator-icon {
    display: none !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-info-container .jb-misc-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  }

  body.jb-media-bar-mobile-16-9 .jb-info-container .jb-misc-info>div:not(:last-child)::after {
    display: none !important;
  }

  body.jb-media-bar-mobile-16-9 .jb-dots-container {
    display: flex !important;
    position: absolute;
    top: calc(56vw + 4px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    z-index: 10;
    margin: 0;
    padding: 5px 0 16px 0 !important;
  }

  body.jb-media-bar-mobile-16-9.jb-media-bar-has-counter .jb-dots-container {
    top: calc(54vw + 4px);
    transform: translateX(-50%) scale(0.8);
  }

  body.jb-media-bar-mobile-16-9 .jb-logo-container {
    top: calc(56.25vw - 10px);
    left: 15px;
    transform: translateY(-100%);
    height: 50px;
    width: auto;
    max-width: 55%;
    justify-content: flex-start;
    align-items: flex-end;
  }

  body.jb-media-bar-mobile-16-9 .jb-logo {
    max-height: 100%;
    max-width: 100%;
    top: auto;
    left: auto;
    transform: none;
    position: relative;
  }

  body.jb-media-bar-mobile-16-9 .jb-logo-title-fallback {
    text-align: left;
    margin: 0;
    padding: 0;
    font-size: 1.8rem !important;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.jb-media-bar-mobile-16-9 .jb-arrow {
    top: calc(56.25vw / 2);
    transform: translateY(-50%);
  }

  /* Minimalist Compact Mode Overrides (4:3) */
  body.jb-media-bar-mobile-4-3 .homeSectionsContainer {
    top: calc(75vw + 10px);
  }

  body.jb-media-bar-mobile-4-3.jb-media-bar-has-counter .homeSectionsContainer {
    top: calc(75vw + 16px);
  }

  body.jb-media-bar-mobile-4-3 .jb-backdrop-container,
  body.jb-media-bar-mobile-4-3 .jb-gradient-overlay {
    height: 100%;
    mask-image: linear-gradient(to bottom, #000 60%, rgba(0, 0, 0, 0.4) 80%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, rgba(0, 0, 0, 0.4) 80%, transparent 100%) !important;
  }

  body.jb-media-bar-mobile-4-3 .jb-backdrop {
    object-position: center center;
  }

  body.jb-media-bar-mobile-4-3 .jb-genre,
  body.jb-media-bar-mobile-4-3 .jb-button-container {
    display: none !important;
  }

  /* Style metadata info container in compact 4:3 format (bottom-right) */
  body.jb-media-bar-mobile-4-3 .jb-info-container {
    display: flex !important;
    position: absolute;
    top: calc(75vw - 15px);
    right: 15px;
    left: auto;
    width: auto !important;
    justify-content: flex-end !important;
    z-index: 10;
    pointer-events: none;
    transform: translateY(-100%);
    font-size: 0.95rem;
    font-weight: 500;
  }

  /* Hide community/critic ratings and default separators in compact 4:3 format */
  body.jb-media-bar-mobile-4-3 .jb-info-container .jb-star-rating-container,
  body.jb-media-bar-mobile-4-3 .jb-info-container .jb-critic-rating,
  body.jb-media-bar-mobile-4-3 .jb-info-container .jb-separator-icon {
    display: none !important;
  }

  body.jb-media-bar-mobile-4-3 .jb-info-container .jb-misc-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  }

  body.jb-media-bar-mobile-4-3 .jb-info-container .jb-misc-info>div:not(:last-child)::after {
    display: none !important;
  }

  body.jb-media-bar-mobile-4-3 .jb-dots-container {
    display: flex !important;
    position: absolute;
    top: calc(72vw + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    z-index: 10;
    margin: 0;
    padding: 5px 0 16px 0 !important;
  }

  body.jb-media-bar-mobile-4-3.jb-media-bar-has-counter .jb-dots-container {
    top: calc(70vw + 10px);
    transform: translateX(-50%) scale(0.8);
  }

  body.jb-media-bar-mobile-4-3 .jb-logo-container {
    top: calc(75vw - 10px);
    left: 15px;
    transform: translateY(-100%);
    height: 60px;
    width: auto;
    max-width: 55%;
    justify-content: flex-start;
    align-items: flex-end;
  }

  body.jb-media-bar-mobile-4-3 .jb-logo {
    max-height: 100%;
    max-width: 100%;
    top: auto;
    left: auto;
    transform: none;
    position: relative;
  }

  body.jb-media-bar-mobile-4-3 .jb-logo-title-fallback {
    text-align: left;
    margin: 0;
    padding: 0;
    font-size: 1.8rem !important;
    font-weight: 700;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  body.jb-media-bar-mobile-4-3 .jb-arrow {
    top: calc(75vw / 2);
    transform: translateY(-50%);
  }

  /* Original Mode Adjustments when counter is shown (avoid overlap) */
  body.jb-media-bar-has-counter:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-dots-container {
    top: calc(50% + 18.5vh);
  }

  body.jb-media-bar-has-counter:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-button-container {
    top: calc(50% + 25.5vh);
  }

  /* Original Layout: Fill 100% height of container on all smartphone models without letterboxing */
  body:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-full {
    height: 100% !important;
    min-height: 100% !important;
    width: 177.78vh !important;
    min-width: 177.78% !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  body:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) video.jb-video-backdrop,
  body:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-default,
  body:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop:not(.jb-video-backdrop-full) {
    position: absolute !important;
    top: 38% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 56.25vw !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    object-fit: contain !important;
  }

  body:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-default iframe,
  body:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-default video {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    object-fit: contain !important;
  }

  /* Jellyfin v12 Original Layout: Factor in the 48px navbar height (transparent when not scrolled) */
  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-full {
    height: calc(100% + 48px) !important;
    min-height: calc(100% + 48px) !important;
    width: calc(177.78vh + 86px) !important;
    min-width: calc(177.78% + 86px) !important;
    position: absolute !important;
    top: calc(50% + 24px) !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) video.jb-video-backdrop,
  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-default,
  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop:not(.jb-video-backdrop-full) {
    position: absolute !important;
    top: calc(28% + 5px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -50%) !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 56.25vw !important;
    min-height: 0 !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    object-fit: contain !important;
  }

  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-default iframe,
  body.jb-jellyfin-v12:not(.jb-media-bar-mobile-16-9):not(.jb-media-bar-mobile-4-3) .jb-video-backdrop-default video {
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    object-fit: contain !important;
  }

  /* Reset and unify video backdrop constraints in compact modes (applies to YouTube and HTML5 local videos) */
  body.jb-media-bar-mobile-16-9 .jb-video-backdrop,
  body.jb-media-bar-mobile-4-3 .jb-video-backdrop {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -62%) scale(1.15) !important;
    object-fit: cover !important;
  }

}

/*Landscape Mode Phones*/
@media only screen and (max-height: 767px) and (orientation: landscape) {
  #jb-slides-container {
    height: 100%;
  }

  .homeSectionsContainer {
    top: 57vh;
  }

  .jb-button-container {
    left: 3vw;
    transform: scale(0.85);
  }

  .jb-dots-container {
    scale: 0.6;
  }

  .jb-info-container {
    top: calc(50% + -10vh);
  }

  .jb-plot-container {
    top: calc(50% + 6vh);
  }

  .jb-genre {
    top: calc(50% + -1vh);
  }

  .jb-logo-container {
    height: 30%;
    top: 10%;
  }

  .jb-logo-container,
  .jb-info-container,
  .jb-genre,
  .jb-plot-container {
    left: 5vw;
  }
}

@media only screen and (min-width: 2560px) {
  .jb-button-container {
    top: calc(50% + 15vh);
  }

  .jb-dots-container {
    top: calc(50% + 15vh);
  }
}

/* Video Modal Styles */
#jb-video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.jb-modal-close-button {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10000;
}

.jb-video-modal-content {
  width: 80%;
  height: 80%;
  position: relative;
  max-width: 1280px;
  max-height: 720px;
}

#jb-modal-yt-player,
.jb-video-modal-player {
  width: 100%;
  height: 100%;
}

.jb-video-modal-player {
  object-fit: contain;
}

@media (orientation: portrait) {
  .jb-video-modal-content {
    width: 95%;
    height: auto;
    aspect-ratio: 16/9;
  }
}

@media (orientation: landscape) {
  .jb-video-modal-content {
    height: 95%;
    width: auto;
    aspect-ratio: 16/9;
    max-width: 95%;
  }
}


/* Video Backdrop Styles */
.jb-video-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  pointer-events: none;
  object-fit: cover;
  overflow: hidden;
}

/* Non-Full Width Video Layout */
.jb-video-backdrop-default {
  position: absolute;
  width: 100%;
  height: 56.25vw;
  aspect-ratio: 16 / 9;
}

/* Non-Full Width Video Layout: Compact trailer window in top right for Desktop & Landscape */
@media (min-width: 768px) {
  .jb-video-backdrop-default {
    position: absolute;
    top: 11vh;
    right: 3.5vw;
    left: auto;
    width: min(44vw, 680px, calc(44vh * 16 / 9));
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.15);
    z-index: 4;
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  .jb-video-backdrop-default iframe,
  .jb-video-backdrop-default video {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    border-radius: 12px;
    object-fit: cover;
    display: block;
  }

  @media (max-width: 1200px) {
    .jb-video-backdrop-default {
      width: min(48vw, 520px, calc(44vh * 16 / 9));
      top: 14vh;
      right: 3vw;
    }
  }

  @media (max-width: 900px) {
    .jb-video-backdrop-default {
      width: min(50vw, 420px, calc(44vh * 16 / 9));
      top: 15vh;
    }
  }
}

.jb-video-backdrop-full {
  width: 100vw;
  height: 56.25vw;
  min-height: 100vh;
  min-width: 177.77vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Slide Counter Styling */
.jb-slide-counter {
  font-family: "Archivo Narrow", sans-serif;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.4);
  padding: 5px 16px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}


.jb-dots-container .jb-slide-counter {
  margin: 0;
  margin-top: -6px;
}

.layout-tv .jb-backdrop-container {
  top: -5%;
}

@media screen and (min-width: 960px) and (-webkit-device-pixel-ratio: 1) {
  .layout-tv .jb-backdrop.jb-animate {
    animation: none !important;
  }

  .layout-tv .jb-logo.jb-animate {
    animation: none !important;
  }

  .layout-tv .jb-slide-counter,
  .layout-tv .jb-dots-container {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Custom Overlay Styling */
.jb-custom-overlay-container {
  position: absolute;
  top: calc(8vh + var(--overlay-y, 0vh));
  left: calc(4vw + var(--overlay-x, 0vw));
  transform: scale(var(--overlay-scale, 1));
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  pointer-events: none;
  animation: overlayFadeInGlobal 1.5s ease-in-out forwards;
  /* animation: fadeInOverlay 1.5s ease-in-out forwards; */
}

@keyframes overlayFadeInGlobal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.jb-custom-overlay-text {
  font-family: "Archivo Narrow", sans-serif;
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8), -1px -1px 4px rgba(0, 0, 0, 0.5);
  margin: 0;
  letter-spacing: 1px;
}

.jb-custom-overlay-image {
  max-width: 300px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.5));
}


@media only screen and (max-width: 767px) and (orientation: portrait) {
  .jb-custom-overlay-container {
    top: calc(15vh + var(--overlay-y, 0vh));
    left: calc(50% + var(--overlay-x, 0vw));
    transform: translateX(-50%) scale(var(--overlay-scale, 1));
    width: 90%;
    justify-content: center;
    text-align: center;
  }

  .jb-custom-overlay-text {
    font-size: 1.5rem;
    /* 1.5 - 1.8 */
  }

  .jb-custom-overlay-image {
    max-width: 150px;
    max-height: 60px;
  }
}

/* Custom Overlay Text Styles */
.jb-custom-overlay-style-None {
  color: #fff;
  text-shadow: none;
}

.jb-custom-overlay-style-Shadowed {
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), -1px -1px 4px rgba(0, 0, 0, 0.8);
}

.jb-custom-overlay-style-Frosted {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  padding: 10px 30px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.jb-custom-overlay-style-Cinematic {
  background: linear-gradient(to right, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c, #fcf6ba, #bf953f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0px 2px 8px rgba(255, 215, 0, 0.4)) drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.8));
  animation: shineCinematic 6s linear infinite;
  background-size: 200% auto;
}

@keyframes shineCinematic {
  0% {
    background-position: 0% center;
  }

  100% {
    background-position: 200% center;
  }
}

.jb-custom-overlay-style-Pulse {
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9), -1px -1px 4px rgba(0, 0, 0, 0.8);
  animation: pulseOverlayText 3s ease-in-out infinite alternate;
}

@keyframes pulseOverlayText {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.05);
  }
}

.jb-custom-overlay-style-Neon {
  color: #fff;
  text-shadow:
    0 0 5px #fff,
    0 0 10px #fff,
    0 0 20px #ff00de,
    0 0 40px #ff00de,
    0 0 80px #ff00de,
    0 0 90px #ff00de,
    0 0 100px #ff00de,
    0 0 150px #ff00de;
  animation: flickerNeon 1.5s infinite alternate;
}

@keyframes flickerNeon {

  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    text-shadow:
      0 0 5px #fff,
      0 0 10px #fff,
      0 0 20px #ff00de,
      0 0 40px #ff00de,
      0 0 80px #ff00de,
      0 0 90px #ff00de,
      0 0 100px #ff00de,
      0 0 150px #ff00de;
  }

  20%,
  24%,
  55% {
    text-shadow: none;
  }
}

.jb-custom-overlay-style-Typewriter {
  font-family: 'Courier New', Courier, monospace;
  background-color: #222;
  color: #00ff00;
  padding: 10px 20px;
  border: 2px solid #00ff00;
  border-radius: 4px;
  box-shadow: 4px 4px 0px #00ff00;
  text-transform: uppercase;
}

.jb-custom-overlay-style-Bubble {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  padding: 12px 30px;
  border-radius: 100px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.2);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  animation: floatBubble 4s ease-in-out infinite;
}

@keyframes floatBubble {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

.jb-custom-overlay-style-SlideIn {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  position: relative;
  animation: slideInCinematic 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.jb-custom-overlay-style-SlideIn::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -50vw;
  right: -50px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.6) 40%, transparent 100%);
  z-index: -1;
}

@keyframes slideInCinematic {
  from {
    transform: translateX(-100vw);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.jb-custom-overlay-style-SteadyNeon {
  color: #fff;
  text-shadow:
    0 0 5px #fff,
    0 0 10px #fff,
    0 0 20px #ff00de,
    0 0 40px #ff00de,
    0 0 80px #ff00de;
}

.jb-custom-overlay-style-Glitch {
  color: #fff;
  position: relative;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  animation: glitchText 3s infinite;
}

@keyframes glitchText {
  0% {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    transform: translate(0);
  }

  20% {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    transform: translate(0);
  }

  21% {
    text-shadow: -2px 0 0 #ff00c1, 2px 0 0 #00fff9;
    transform: translate(-2px, 1px);
  }

  23% {
    text-shadow: 2px 0 0 #ff00c1, -2px 0 0 #00fff9;
    transform: translate(2px, -1px);
  }

  25% {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    transform: translate(0);
  }

  100% {
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    transform: translate(0);
  }
}

.jb-custom-overlay-style-RetroPop {
  color: #f7f7f7;
  text-shadow:
    2px 2px 0px #ff0055,
    4px 4px 0px #00a4dc,
    6px 6px 0px #ffcc00,
    8px 8px 10px rgba(0, 0, 0, 0.6);
  font-weight: 900;
  letter-spacing: 2px;
}

.jb-custom-overlay-style-Shimmer {
  color: rgba(255, 255, 255, 0.7);
  background: linear-gradient(to right, #222 20%, #fff 40%, #fff 60%, #222 80%);
  background-size: 200% auto;
  color: #000;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerText 3s linear infinite;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

@keyframes shimmerText {
  to {
    background-position: 200% center;
  }
}

.jb-custom-overlay-style-Wave {
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  display: inline-block;
  animation: liquidWave 3s ease-in-out infinite;
}

@keyframes liquidWave {

  0%,
  100% {
    transform: translateY(0) skewY(0);
  }

  25% {
    transform: translateY(-3px) skewY(1deg);
  }

  50% {
    transform: translateY(0) skewY(0);
  }

  75% {
    transform: translateY(3px) skewY(-1deg);
  }
}

.jb-custom-overlay-style-VHS {
  color: #fff;
  text-shadow: 3px 0 0 #f00, -3px 0 0 #0ff;
  animation: vhsTracking 2s steps(2, start) infinite;
}

@keyframes vhsTracking {

  0%,
  100% {
    text-shadow: 3px 0 0 #f00, -3px 0 0 #0ff;
  }

  50% {
    text-shadow: 2px 1px 0 #f00, -2px -1px 0 #0ff;
  }
}

.jb-custom-overlay-style-Matrix {
  color: #0f0;
  font-family: monospace;
  text-shadow: 0 0 5px #0f0, 0 0 10px #0f0;
  letter-spacing: 2px;
  animation: matrixGlow 2s infinite alternate;
}

@keyframes matrixGlow {
  to {
    text-shadow: 0 0 10px #0f0, 0 0 20px #0f0;
  }
}

.jb-custom-overlay-style-Ghost {
  color: rgba(255, 255, 255, 0.8);
  filter: blur(0px);
  animation: ghostApparition 6s infinite alternate;
}

@keyframes ghostApparition {
  0% {
    filter: blur(0px);
    opacity: 1;
    transform: scale(1);
  }

  50% {
    filter: blur(3px);
    opacity: 0.6;
    transform: scale(1.02);
  }

  100% {
    filter: blur(8px);
    opacity: 0;
    transform: scale(1.05);
  }
}

.jb-custom-overlay-style-PulseGlow {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  animation: pulseGlowAura 3s ease-in-out infinite alternate;
}

@keyframes pulseGlowAura {
  0% {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5), 0 0 10px #00a4dc;
    transform: scale(1);
  }

  100% {
    text-shadow: 0 0 15px rgba(255, 255, 255, 1), 0 0 30px #00a4dc, 0 0 40px #00a4dc;
    transform: scale(1.05);
  }
}

/* Custom Overlay Image Styles */
.jb-custom-overlay-img-RoundedShadow {
  border-radius: 12px;
  filter: drop-shadow(0px 10px 15px rgba(0, 0, 0, 0.6));
}

.jb-custom-overlay-img-GlowingBorder {
  border-radius: 8px;
  box-shadow: 0 0 10px #00a4dc, 0 0 20px #00a4dc, 0 0 30px #00a4dc, inset 0 0 10px #00a4dc;
  animation: pulseGlowImg 2s infinite alternate;
}

@keyframes pulseGlowImg {
  from {
    box-shadow: 0 0 10px #00a4dc, 0 0 20px #00a4dc, 0 0 30px #00a4dc;
  }

  to {
    box-shadow: 0 0 15px #00a4dc, 0 0 30px #00a4dc, 0 0 45px #00a4dc;
  }
}

.jb-custom-overlay-img-Polaroid {
  background: white;
  padding: 10px 10px 25px 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 12px 24px rgba(0, 0, 0, 0.3);
  transform: rotate(-3deg);
  border-radius: 2px;
}

.jb-custom-overlay-img-Vintage {
  filter: sepia(0.6) contrast(1.2) brightness(0.9) saturate(1.2) drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.6));
}

.jb-custom-overlay-img-Grayscale {
  filter: grayscale(100%) contrast(1.1) drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.6));
}

.jb-custom-overlay-img-Hologram {
  filter: drop-shadow(0 0 10px #0ff) sepia(0.8) hue-rotate(180deg) saturate(3);
  opacity: 0.8;
  animation: hologramFlicker 3s infinite;
}

@keyframes hologramFlicker {
  0% {
    opacity: 0.8;
    transform: skewX(0);
  }

  5% {
    opacity: 0.5;
    transform: skewX(2deg);
  }

  10% {
    opacity: 0.9;
    transform: skewX(-2deg);
  }

  15% {
    opacity: 0.8;
    transform: skewX(0);
  }

  100% {
    opacity: 0.8;
  }
}

.jb-custom-overlay-img-CRT {
  filter: contrast(1.5) brightness(1.2) drop-shadow(3px 0 0 rgba(255, 0, 0, 0.5)) drop-shadow(-3px 0 0 rgba(0, 0, 255, 0.5));
}

.jb-custom-overlay-img-Floating {
  filter: drop-shadow(0 15px 20px rgba(0, 0, 0, 0.6));
  animation: floatImg 4s ease-in-out infinite;
}

@keyframes floatImg {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

.jb-custom-overlay-img-VHSTracking {
  filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5));
  animation: imgVhsTracking 2s infinite;
}

@keyframes imgVhsTracking {
  0% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5)) hue-rotate(0deg);
  }

  5% {
    transform: translateX(-5px);
    clip-path: inset(10% 0 80% 0);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5)) hue-rotate(90deg);
  }

  10% {
    transform: translateX(5px);
    clip-path: inset(40% 0 40% 0);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5)) hue-rotate(-90deg);
  }

  15% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5)) hue-rotate(0deg);
  }

  100% {
    transform: translateX(0);
    clip-path: inset(0 0 0 0);
  }
}

.jb-custom-overlay-img-ColorCycle {
  filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5));
  animation: imgColorCycle 10s linear infinite;
}

@keyframes imgColorCycle {
  from {
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5)) hue-rotate(0deg);
  }

  to {
    filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5)) hue-rotate(360deg);
  }
}

.jb-custom-overlay-img-Mirror {
  filter: drop-shadow(2px 4px 8px rgba(0, 0, 0, 0.5));
  -webkit-box-reflect: below 2px linear-gradient(transparent, rgba(255, 255, 255, 0.3));
}

/* --- Client Settings Popup & Modal Overlay --- */
.jb-media-bar-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px) saturate(1.8);
  -webkit-backdrop-filter: blur(12px) saturate(1.8);
  z-index: 9999;
  animation: mediaBarFadeIn 0.25s ease-out forwards;
}

.jb-media-bar-settings-popup {
  position: fixed;
  z-index: 10000;
  background: rgba(22, 22, 22, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1.6em 1.8em;
  border-radius: 1.2em;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  width: 480px;
  height: 700px;
  max-width: calc(100vw - 2.5rem);
  max-height: calc(100vh - 38px);
  color: #fff;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

/* Client Tabs Styling */
.jb-media-bar-client-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4em;
  margin-bottom: 1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.6em;
}

.jb-media-bar-client-tab {
  background: transparent;
  border: none;
  color: #888888;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4em 0.8em;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  justify-content: center;
  min-width: 0;
  white-space: normal;
}

.jb-media-bar-client-tab span {
  display: inline-block;
  text-align: center;
  line-height: 1.25;
}

.jb-media-bar-client-tab:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
}

.jb-media-bar-client-tab.jb-active {
  color: #ffffff;
  background-color: #00a4dc;
}

/* Mobile responsive layout for client settings tabs */
@media (max-width: 520px) {
  .jb-media-bar-client-tabs {
    grid-template-columns: 1fr !important;
  }

  .jb-media-bar-client-tab {
    width: 100% !important;
    min-height: 42px !important;
    box-sizing: border-box !important;
  }
}

.jb-media-bar-client-tab-content {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  width: 100%;
}

/* Modal styling (centered, when opened from sidebar) */
.jb-media-bar-settings-popup.jb-media-bar-modal {
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  animation: mediaBarPopInCenter 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Dropdown styling (when opened from navbar header) */
.jb-media-bar-settings-popup.jb-media-bar-dropdown {
  animation: mediaBarPopInDropdown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Header style with logo */
.jb-media-bar-settings-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 0;
  margin-bottom: 1.2em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.8em;
  padding-right: 32px;
}

.jb-media-bar-settings-logo {
  height: 24px;
  pointer-events: none;
}

.jb-media-bar-settings-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
}

/* Header Settings Button Styling */
.jb-media-bar-settings-button {
  border: none !important;
  background: transparent !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: auto 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  color: inherit !important;
  border-radius: 50% !important;
  vertical-align: middle !important;
  outline: none !important;
  box-sizing: border-box !important;
  width: 40px !important;
  height: 40px !important;
  overflow: visible !important;
  transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out !important;
}

/* Jellyfin 10.11.x Blue Hover */
.jb-media-bar-settings-button:hover {
  background-color: rgba(0, 164, 220, 0.2) !important;
  color: #00a4dc !important;
  border-radius: 50% !important;
}

@media (hover: hover) and (pointer: fine) {
  .jb-media-bar-settings-button:hover:not(:disabled) {
    background-color: rgba(0, 164, 220, 0.2) !important;
    color: #00a4dc !important;
  }
}

/* Jellyfin v12 Full Header Height Grey Hover */
body.jb-jellyfin-v12 .jb-media-bar-settings-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  box-sizing: border-box !important;
  background-color: transparent !important;
  outline: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  cursor: pointer !important;
  user-select: none !important;
  vertical-align: middle !important;
  appearance: none !important;
  text-decoration: none !important;
  text-align: center !important;
  flex: 0 0 auto !important;
  border-radius: 50% !important;
  overflow: visible !important;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: inherit !important;
  padding: 12px !important;
  font-size: 1.75rem !important;
  width: auto !important;
  height: auto !important;
}

/* MUI Profile Menu Item Styling */
.jb-media-bar-usermenu-item {
  display: flex !important;
  align-items: center !important;
  padding: 6px 16px !important;
  min-height: 36px !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  width: 100% !important;
  margin: 0 !important;
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms !important;
}

.jb-media-bar-usermenu-item:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(var(--jf-palette-action-activeChannel, 255 255 255) / var(--jf-palette-action-hoverOpacity, 0.08)) !important;
}

.jb-media-bar-usermenu-item .MuiListItemIcon-root {
  min-width: 36px !important;
  width: 36px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-shrink: 0 !important;
  margin-right: 0 !important;
}

.jb-media-bar-usermenu-item img {
  width: 20px !important;
  height: 20px !important;
  object-fit: contain !important;
  vertical-align: middle !important;
  pointer-events: none !important;
  margin: 0 !important;
}

.jb-media-bar-usermenu-item .MuiListItemText-root {
  flex: 1 1 auto !important;
  margin: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

body.jb-jellyfin-v12 .jb-media-bar-settings-button:hover {
  color: inherit !important;
  background-color: rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(var(--jf-palette-action-activeChannel, 255 255 255) / var(--jf-palette-action-hoverOpacity, 0.08)) !important;
  border-radius: 50% !important;
}

.jb-media-bar-settings-button img {
  width: 24px !important;
  height: 24px !important;
  border-radius: 0 !important;
  vertical-align: middle !important;
  pointer-events: none !important;
  object-fit: contain !important;
  overflow: visible !important;
  transition: transform 0.2s ease !important;
}

.jb-media-bar-settings-backdrop {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  flex: 1;
  overflow-y: auto;
}

/* Body Container */
.jb-media-bar-settings-body {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.8em;
  padding-right: 4px;
}

/* Section Title Headers */
.jb-media-bar-settings-section-title {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
  color: #00a4dc;
  margin-top: 0.8em;
  margin-bottom: 0.2em;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Toggle switch design */
.jb-media-bar-toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0.4em 0;
}

.jb-media-bar-toggle-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.jb-media-bar-toggle-label {
  font-weight: 500;
  font-size: 0.92rem;
  color: #f0f0f0;
}

.jb-media-bar-toggle-desc {
  color: #9c9c9c;
  font-size: 0.8rem;
  margin-top: 0.15em;
  line-height: 1.35;
}

/* The Switch Outer Element */
.jb-media-bar-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.jb-media-bar-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.jb-media-bar-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 24px;
}

.jb-media-bar-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: #e5e5e5;
  transition: .25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.jb-media-bar-switch input:checked+.jb-media-bar-slider {
  background-color: #00a4dc;
}

.jb-media-bar-switch input:checked+.jb-media-bar-slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

/* Select Container and Elements */
.jb-media-bar-select-container {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  padding: 0.3em 0;
}

.jb-media-bar-select-info {
  display: flex;
  flex-direction: column;
}

.jb-media-bar-select-label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.jb-media-bar-select-desc {
  color: #9c9c9c;
  font-size: 0.8rem;
  line-height: 1.3;
}

select.jb-media-bar-select {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  padding: 0.6em 0.8em !important;
  border-radius: 6px !important;
  outline: none !important;
  transition: all 0.2s ease;
  font-size: 0.88rem;
  width: 100%;
  -webkit-appearance: menulist;
  appearance: menulist;
  margin-top: 0.2em;
}

select.jb-media-bar-select:focus {
  border-color: #00a4dc !important;
  box-shadow: 0 0 0 3px rgba(0, 164, 220, 0.2);
  background-color: rgba(255, 255, 255, 0.08) !important;
}

select.jb-media-bar-select option {
  background-color: #202020 !important;
  color: #ffffff !important;
}

/* Button layout */
.jb-media-bar-settings-buttons {
  margin-top: 1.4em;
  display: flex;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
}

.jb-media-bar-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.6em 1.2em;
  font-size: 0.88rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
  outline: none;
  flex: 1 1 0;
  min-width: 0;
  width: 50%;
  text-align: center;
}

.jb-media-bar-btn-cancel {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.jb-media-bar-btn-cancel:hover {
  background-color: rgba(255, 255, 255, 0.12);
}

.jb-media-bar-btn-submit {
  background: linear-gradient(135deg, #00a4dc, #0084b0);
  box-shadow: 0 4px 12px rgba(0, 164, 220, 0.25);
}

.jb-media-bar-btn-submit:hover {
  filter: brightness(1.15);
}

/* Footer layout */
.jb-media-bar-settings-footer {
  margin-top: 1.5em;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.8em;
  font-size: 0.78rem;
  color: #888;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Custom Scrollbar for Settings Popup & Body */
.jb-media-bar-settings-popup::-webkit-scrollbar,
.jb-media-bar-settings-body::-webkit-scrollbar {
  width: 6px;
}

.jb-media-bar-settings-popup::-webkit-scrollbar-track,
.jb-media-bar-settings-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.jb-media-bar-settings-popup::-webkit-scrollbar-thumb,
.jb-media-bar-settings-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.jb-media-bar-settings-popup::-webkit-scrollbar-thumb:hover,
.jb-media-bar-settings-body::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Close button for client settings popup */
.jb-media-bar-settings-close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s, color 0.2s;
  outline: none;
}

.jb-media-bar-settings-close-button:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.jb-media-bar-settings-close-button:active {
  background-color: rgba(255, 255, 255, 0.2);
}

/* GitHub link styling in settings popup */
.jb-media-bar-settings-popup a.jb-media-bar-github-link {
  color: #00a4dc !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s, color 0.2s;
}

.jb-media-bar-settings-popup a.jb-media-bar-github-link:hover {
  opacity: 0.8;
  color: #0084b0 !important;
}

/* Keyframe Animations */
@keyframes mediaBarFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes mediaBarPopInCenter {
  from {
    opacity: 0;
    transform: translate(-50%, -47%) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes mediaBarPopInDropdown {
  from {
    opacity: 0;
    transform: scale(0.96);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Progress Bar styling */
.jb-media-bar-progress-bar {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.jb-progress-bar-navbar {
  top: var(--header-height, 4.5rem);
  left: 4px;
  width: calc(100% - 8px);
  height: 4px;
  background-color: rgba(0, 164, 220, 0.2);
  border-radius: 2px;
}

.jb-progress-bar-dots {
  bottom: 0px;
  left: 5px;
  width: calc(100% - 10px);
  height: 5px;
  background-color: #686868;
  border-radius: 2.5px;
}

/* Active filling bar inside the track */
.jb-media-bar-progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background-color: #00a4dc;
  /* Default blue for navbar/bottom */
  transform: scaleX(0);
  transform-origin: left;
  animation-duration: inherit;
  animation-play-state: inherit;
}

/* Smooth transition when manually updating video progress via JS */
.jb-media-bar-progress-bar:not(.jb-animating) .jb-media-bar-progress-fill {
  transition: transform 0.15s linear !important;
}

.jb-progress-bar-navbar .jb-media-bar-progress-fill {
  border-radius: 2px;
}

.jb-progress-bar-dots .jb-media-bar-progress-fill {
  background-color: #ffffff;
  /* White active bar for dots position */
  border-radius: 2.5px;
}

.jb-media-bar-progress-bar.jb-animating .jb-media-bar-progress-fill {
  animation-name: mediaBarProgress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.jb-media-bar-progress-bar.jb-reverse-progress.jb-animating .jb-media-bar-progress-fill {
  animation-name: mediaBarProgressReverse;
}

.jb-media-bar-progress-bar.jb-reverse-progress .jb-media-bar-progress-fill {
  transform-origin: right;
}

.jb-media-bar-progress-bar.jb-paused .jb-media-bar-progress-fill {
  animation-play-state: paused !important;
}

@keyframes mediaBarProgress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes mediaBarProgressReverse {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

/* GPU-Accelerated Transition Animation styling */
.jb-transition-effect-fade .jb-slide {
  opacity: 0;
  transition: opacity var(--transition-duration, 500ms) ease-in-out;
}

.jb-transition-effect-fade .jb-slide.jb-active {
  opacity: 1;
}

.jb-transition-effect-slideleft .jb-slide {
  transform: translate3d(100%, 0, 0);
  opacity: 0;
  transition: transform var(--transition-duration, 500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity var(--transition-duration, 500ms) ease-in-out;
}

.jb-transition-effect-slideleft .jb-slide.jb-active {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.jb-transition-effect-slideright .jb-slide {
  transform: translate3d(-100%, 0, 0);
  opacity: 0;
  transition: transform var(--transition-duration, 500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity var(--transition-duration, 500ms) ease-in-out;
}

.jb-transition-effect-slideright .jb-slide.jb-active {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.jb-transition-effect-slideup .jb-slide {
  transform: translate3d(0, 100%, 0);
  opacity: 0;
  transition: transform var(--transition-duration, 500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity var(--transition-duration, 500ms) ease-in-out;
}

.jb-transition-effect-slideup .jb-slide.jb-active {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.jb-transition-effect-slidedown .jb-slide {
  transform: translate3d(0, -100%, 0);
  opacity: 0;
  transition: transform var(--transition-duration, 500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity var(--transition-duration, 500ms) ease-in-out;
}

.jb-transition-effect-slidedown .jb-slide.jb-active {
  transform: translate3d(0, 0, 0);
  opacity: 1;
}

.jb-transition-effect-zoomin .jb-slide {
  transform: scale3d(0.72, 0.72, 1);
  opacity: 0;
  transition: transform var(--transition-duration, 500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity var(--transition-duration, 500ms) ease-in-out;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.jb-transition-effect-zoomin .jb-slide.jb-active {
  transform: scale3d(1, 1, 1);
  opacity: 1;
}

.jb-transition-effect-zoomout .jb-slide {
  transform: scale3d(1.28, 1.28, 1);
  opacity: 0;
  transition: transform var(--transition-duration, 500ms) cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity var(--transition-duration, 500ms) ease-in-out;
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.jb-transition-effect-zoomout .jb-slide.jb-active {
  transform: scale3d(1, 1, 1);
  opacity: 1;
}

/* Libraries Tab Scrollbar & List Styling */
#jb-mb-client-tab-libraries {
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

#jb-mb-client-tab-libraries::-webkit-scrollbar {
  width: 6px;
}

#jb-mb-client-tab-libraries::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
}

#jb-mb-client-tab-libraries::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

#jb-mb-client-tab-libraries::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Hide Media Bar settings icon strictly during active Video Playback / OSD */
body.is-videoplayer .jb-media-bar-settings-button,
html.is-videoplayer .jb-media-bar-settings-button,
.headerVideo .jb-media-bar-settings-button,
.videoPlayerContainer:not(.hide) .jb-media-bar-settings-button,
.videoPlayerContainer-onTop .jb-media-bar-settings-button,
#videoOsdPage:not(.hide) .jb-media-bar-settings-button,
body:has(#videoOsdPage:not(.hide)) .jb-media-bar-settings-button,
body:has(.videoPlayerContainer:not(.hide)) .jb-media-bar-settings-button,
body:has(.videoPlayerContainer-onTop) .jb-media-bar-settings-button {
  display: none !important;
}

/* The page backdrop sync layer needs no rule of its own: PageBackdrop.update sets
   the layer's opacity inline to drive the crossfade, which beats anything declared
   here. The rule that used to sit here never matched the class the JS writes. */
/* --- Dashboard sidebar icon --- */
/* Jellyfin draws every plugin page in the dashboard sidebar with one stock icon: a
   hardcoded folder on 10.11, the MenuIcon ligature on 12. Neither can show an image,
   so the mark is painted behind the icon box and the stock glyph is hidden in place,
   keeping its size. CSS rather than swapping the node: the drawer is React, and a
   replaced child breaks its next re-render. The link is matched on the page name
   Jellyfin puts in the href (Dashboard.getPluginUrl encodes "Jelly Bar"). */
a[href*="configurationpage?name=Jelly%20Bar"] .MuiListItemIcon-root {
  background: url(assets/logo_mark.svg) left center / 24px 24px no-repeat;
}

a[href*="configurationpage?name=Jelly%20Bar"] .MuiListItemIcon-root > * {
  visibility: hidden;
}
