/* Layer: UpNext Layer */
/* Countdown timer with circular progress ring positioned on YouTube's "up next" thumbnail */

[data-layer="upnext"] {
  position: fixed;
  /* Position container to match YouTube's end-screen thumbnail card */
  /* Thumbnail appears upper-left of video during end screen */
  left: 10%;
  top: 27%;
  width: 33%;
  height: 35%;
  z-index: var(--z-upnext);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
  pointer-events: none;
}

[data-layer="upnext"].visible {
  opacity: 1;
  visibility: visible;
}

.upnext-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upnext-countdown {
  position: relative;
  width: 12vh;
  height: 12vh;
}

.upnext-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.upnext-ring-bg {
  fill: rgba(0, 0, 0, 0.55);
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 3;
}

.upnext-ring-progress {
  fill: none;
  stroke: white;
  stroke-width: 3;
  stroke-linecap: round;
  /* Circumference = 2 * PI * r = 2 * 3.14159 * 20 = 125.66 */
  stroke-dasharray: 125.66;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.3s ease-out;
}

.upnext-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4vh;
  font-weight: 400;
  color: white;
  text-shadow: 0 0.1vh 0.3vh rgba(0, 0, 0, 0.8);
}
