/* Player page styles */
ytmusic-player-page:before {
  background: var(--blyrics-background-img);
  background-position: 50% !important;
  background-repeat: no-repeat;
  background-size: cover;
  bottom: 0;
  content: "";
  filter: saturate(var(--blyrics-background-saturate)) brightness(25%) blur(var(--blyrics-background-blur));
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transform: scale(1.2);
  z-index: -100;
}

/* Player bar styles */
ytmusic-player-bar,
#player-bar-background {
  backdrop-filter: blur(var(--blyrics-blur-amount));
}

#side-panel {
  min-width: 50%;
}

.loading-spinner.ytmusic-tab-renderer {
  margin: 0 !important;
}

#layout[player-fullscreened][cursor-hidden]:not([show-fullscreen-controls]) * {
  cursor: none !important;
}

/* YouTube Music specific overrides */
#layout[player-ui-state="PLAYER_PAGE_OPEN"] #mini-guide-background,
#layout[player-ui-state="PLAYER_PAGE_OPEN"] #nav-bar-background,
#layout[player-ui-state="PLAYER_PAGE_OPEN"] #guide-wrapper {
  background-color: transparent !important;
  border-color: transparent !important;
}

#layout[player-ui-state="PLAYER_PAGE_OPEN"] ytmusic-player-bar,
#layout[player-ui-state="PLAYER_PAGE_OPEN"] #player-bar-background {
  background: linear-gradient(0deg, transparent, transparent) !important;
}

ytmusic-app[blyrics-stylized] #layout[player-ui-state="PLAYER_PAGE_OPEN"] #mini-guide-background,
ytmusic-app[blyrics-stylized] #layout[player-ui-state="PLAYER_PAGE_OPEN"] #nav-bar-background,
ytmusic-app[blyrics-stylized] #layout[player-ui-state="PLAYER_PAGE_OPEN"] #guide-wrapper {
  background-color: transparent !important;
  border-color: transparent !important;
}

ytmusic-app[blyrics-stylized] #layout[player-ui-state="PLAYER_PAGE_OPEN"] ytmusic-player-bar,
ytmusic-app[blyrics-stylized] #layout[player-ui-state="PLAYER_PAGE_OPEN"] #player-bar-background {
  background: linear-gradient(0deg, #00000000, #00000000) !important;
}

ytmusic-app[blyrics-stylized] ytmusic-player-bar,
ytmusic-app[blyrics-stylized] #player-bar-background {
  backdrop-filter: blur(var(--blyrics-blur-amount));
}

#player-page yt-formatted-string[is-empty] {
  display: inherit !important;
}

#tab-renderer[page-type="MUSIC_PAGE_TYPE_TRACK_LYRICS"] {
  mask-image: linear-gradient(180deg, transparent, #000 50px, #000 calc(100% - 50px), transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 50px, #000 calc(100% - 50px), transparent);
  scrollbar-color: transparent transparent;
}

yt-formatted-string.text.style-scope.ytmusic-message-renderer {
  margin-top: 34px !important;
}

.subtext.ytmusic-message-renderer,
.text.ytmusic-message-renderer {
  color: hsla(0, 0%, 100%, 0.5) !important;
}

#tabsContent > tp-yt-paper-tab:nth-child(3) {
  cursor: pointer !important;
  pointer-events: auto !important;
}

yt-formatted-string.non-expandable.description.style-scope.ytmusic-description-shelf-renderer:not(.blyrics--fallback) {
  display: none !important;
}

yt-formatted-string.non-expandable.description.style-scope.ytmusic-description-shelf-renderer.blyrics--fallback {
  margin-block: 4rem !important;
}

#tab-renderer > ytmusic-message-renderer > yt-formatted-string.subtext.style-scope.ytmusic-message-renderer,
#tab-renderer > ytmusic-message-renderer > yt-formatted-string.text.style-scope.ytmusic-message-renderer {
  display: none !important;
}

ytmusic-message-renderer.ytmusic-tab-renderer {
  margin: 0 !important;
}

#tab-renderer:not([page-type="MUSIC_PAGE_TYPE_TRACK_LYRICS"]) #blyrics-loader,
#tab-renderer:not([page-type="MUSIC_PAGE_TYPE_TRACK_LYRICS"]) #blyrics-wrapper,
#tab-renderer:not([page-type="MUSIC_PAGE_TYPE_TRACK_LYRICS"]) .blyrics-footer {
  display: none !important;
}

/* Media queries */
@media (min-width: 615px) {
  /* Styles for larger screens */
  ytmusic-player-page:not([video-mode]):not([player-fullscreened]):not([blyrics-dfs]):not(
      [player-ui-state="MINIPLAYER"]
    )
    #player.ytmusic-player-page {
    left: 50%;
    max-width: 400px !important;
    transform: translateX(-50%);
  }
  ytmusic-player-page:not([is-video-truncation-fix-enabled])[player-fullscreened]:not([blyrics-dfs])
    #player.ytmusic-player-page {
    height: 40rem;
    width: 40rem;
    top: calc(50% - var(--ytmusic-nav-bar-height));
    left: 20%;
    transform: translate(-50%, -50%);
    mask-image: none !important;
    box-shadow:
      rgba(0, 0, 0, 0.2) 0px 54px 55px, rgba(0, 0, 0, 0.12) 0px -12px 30px, rgba(0, 0, 0, 0.12) 0px 4px 6px, rgba(
        0,
        0,
        0,
        0.17
      ) 0px 12px 13px, rgba(0, 0, 0, 0.09) 0px -3px 5px;
  }

  ytmusic-player-page:not([is-video-truncation-fix-enabled])[player-fullscreened]:not([blyrics-dfs])
    #blyrics-watermark {
    display: none;
  }

  ytmusic-player-page:not([is-video-truncation-fix-enabled])[player-fullscreened]:not([blyrics-dfs])
    #blyrics-song-info {
    display: block;
    position: absolute;
    top: calc(50% - var(--ytmusic-nav-bar-height));
    margin-top: calc(20rem + 2rem);
    left: 20%;
    text-align: center;
    transform: translateX(-50%);
  }

  ytmusic-player-page:not([is-video-truncation-fix-enabled])[player-fullscreened][video-mode]:not([blyrics-dfs])
    #player.ytmusic-player-page {
    width: calc(33.33%) !important;
    height: auto !important;
  }

  ytmusic-app-layout:not([is-mweb-modernization-enabled])[player-fullscreened]:not([blyrics-dfs])
    > [slot="player-page"] {
    height: 100% !important;
    width: 100% !important;
  }
  ytmusic-app-layout:not([is-mweb-modernization-enabled])[player-fullscreened]:not([blyrics-dfs])
    > [slot="player-page"]
    .tab-header-container {
    display: none !important;
  }
  ytmusic-app-layout:not([is-mweb-modernization-enabled])[player-fullscreened]:not([blyrics-dfs])
    > [slot="player-page"]
    #side-panel {
    min-width: 60%;
    transform: translateY(-7.5rem);
  }
  ytmusic-player-page:not([is-mweb-modernization-enabled])[player-fullscreened]:not([blyrics-dfs])
    .av.ytmusic-player-page {
    width: 40% !important;
  }
  ytmusic-app-layout[player-fullscreened][show-fullscreen-controls]:not([blyrics-dfs]) > [slot="player-bar"] {
    width: 100%;
  }
  ytmusic-app-layout[player-fullscreened][show-fullscreen-controls]:not([blyrics-dfs])
    > [slot="player-bar"]
    .right-controls-buttons.ytmusic-player-bar,
  ytmusic-app-layout[player-fullscreened][show-fullscreen-controls]:not([blyrics-dfs])
    > [slot="player-bar"]
    .time-info.ytmusic-player-bar {
    color: var(--blyrics-ui-text-color);
  }
  ytmusic-app-layout[player-fullscreened][show-fullscreen-controls]:not([blyrics-dfs]) > [slot="player-bar"]:before {
    background: linear-gradient(to bottom, var(--blyrics-gradient-stops));
    content: "";
    height: 100%;
    left: 0;
    opacity: 0.3;
    position: absolute;
    top: 0;
    width: 100%;
  }
	ytmusic-player-bar[player-fullscreened] #play-pause-button>.yt-icon-button>yt-icon {
		width: 32px;
		height: 32px;
	}
}

@media (max-width: 936px) {
  /* Styles for medium-sized screens */
  ytmusic-player-page:not([is-video-truncation-fix-enabled])[player-fullscreened]:not([blyrics-dfs])
    #player.ytmusic-player-page {
    top: 0;
    height: 30rem;
    width: 30rem;
    left: 50%;
    transform: translateX(-50%);
  }
  ytmusic-player-page:not([is-video-truncation-fix-enabled])[player-fullscreened]:not([blyrics-dfs])
    #blyrics-song-info {
    top: 0;
    margin-top: 32rem;
    left: 50%;
    transform: translateX(-50%);
  }
}

/*Hide Yt's lyrics*/
#contents
  > ytmusic-description-shelf-renderer
  > yt-formatted-string.footer.style-scope.ytmusic-description-shelf-renderer,
#contents
  > ytmusic-description-shelf-renderer
  > yt-formatted-string.non-expandable.description.style-scope.ytmusic-description-shelf-renderer {
  display: none;
}

@media (max-width: 615px) {
  /* Styles for smaller screens */
  #tab-renderer[page-type="MUSIC_PAGE_TYPE_TRACK_LYRICS"] {
    mask-image: none;
    -webkit-mask-image: none;
  }
  ytmusic-player-page[is-mweb-modernization-enabled][player-fullscreened]:not([blyrics-dfs])
    #player-controls.ytmusic-player-page {
    max-width: 100vw;
  }
  ytmusic-player-page[is-mweb-modernization-enabled][player-fullscreened]:not([blyrics-dfs])
    #main-panel.ytmusic-player-page {
    padding: 0 !important;
  }
}
