:root {
  --pluma-color: #A770EF;
}

#som-1 {
  animation: volume 2s infinite;
  opacity: 0;
}

#som-2 {
  animation: volume 2s infinite 0.3s;
  opacity: 0;
}

#som-3 {
  animation: volume 2s infinite 0.6s;
  opacity: 0;
}

@keyframes volume {

  0%,
  100% {
    opacity: 0;
  }

  33%,
  66% {
    opacity: 1;
  }
}

.video-thumb {
  position: relative;
  font-family: 'Montserrat', sans-serif;
  overflow: hidden !important;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  max-width: 1140px;
  display: flex;
  justify-content: center;
  background-color: #000000;
  cursor: pointer;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  aspect-ratio: 16/9;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* Estilo da moldura */
  border-radius: 8px;
  background: #000000;
  outline: 2px solid #00000050;
  outline-offset: 0.7rem;
}

.video-thumb .pause-overlay[style*="display: flex"],
.video-thumb .end-overlay[style*="display: flex"] {
  opacity: 1;
  pointer-events: auto;
}

.video-thumb.playing .yt-holder {
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.video-thumb.started .local-video {
  display: none !important;
}

.yt-holder {
  position: absolute;
  top: -500px !important;
  bottom: -500px !important;
  left: 0;
  right: 0;
  transform: scale(1);
  width: 100%;
  height: calc(100% + 1000px) !important;
  margin: auto;
  transition: opacity 0.1s ease;
  z-index: 1;
}

.local-video {
  position: relative;
  object-fit: cover;
  z-index: 2;
  transition: opacity 0.1s ease;
  overflow: hidden;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  transform: scale(0.8) !important;
  align-items: center;
  justify-content: center;
  transition: 0.2s ease;
  z-index: 3;
  will-change: transform;
}

.overlay:hover {
  transform: scale(0.9) !important;
}

.yt-control-layer {
  position: absolute;
  inset: 0;
  background: transparent;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 4;
  cursor: pointer;
  display: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  pointer-events: auto;
}

.video-thumb.playing .yt-control-layer {
  display: block;
}

.fake-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 14px;
  background: var(--pluma-color);
  z-index: 5;
  pointer-events: none;
  opacity: 0;
  transition: width 0.1s linear, opacity 0.1s ease;
}

.video-thumb.playing .fake-progress-bar {
  opacity: 1 !important;
  transition: opacity 0.2s ease 0.1s;
  /* Delay para sincronizar com vídeo */
}

.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--pluma-color);
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 6;
  text-align: center;
  cursor: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
  user-select: none;
}

.pause-overlay p {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 2.6em;
  color: #ffffff;
  margin-bottom: 20px;
  max-width: 80%;
  text-wrap: balance
}

.pause-overlay button {
  min-width: 140px;
  font-size: 16px;
}

.button-group {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 20px;
  width: 540px;
}

.button-group button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 999px;
  background: none !important;
  color: #ffffff;
  font-weight: 300;
  font-size: 1em;
  border: none;
  cursor: pointer;
  transition: background 0.1s ease;
}

.button-group button:hover {
  background: none !important;
  color: #ffffff !important;
}

.button.restart-button:hover {
  background: none !important;
}

.button.resume-button:hover {
  background: none !important;
}

.resume-btn {
  color: #ffffff;
  padding: 0 !important;
}

.restart-btn {
  color: #ffffff;
  padding: 0 !important;
}

.replay-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  color: #fff;
}

.play-icon,
.rewind-icon,
.replay-icon {
  width: 48px !important;
  height: 48px !important;
  fill: #fff !important;
}

.end-overlay {
  position: absolute;
  inset: 0;
  background: var(--pluma-color);
  display: flex;
  align-items: center;
  color: #fff;
  justify-content: center;
  z-index: 7;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  flex-direction: column;
  font-size: 1em;
  gap: 10px;
}

.fullscreen-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  z-index: 8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fullscreen-btn:hover {
  opacity: 1 !important;
}

.video-thumb:hover .fullscreen-btn {
  opacity: 0.5;
}

.fullscreen-btn svg {
  width: 32px;
  height: 32px;
}

/* Nova regra para controlar a visibilidade dos ícones */
.fullscreen-icon {
  display: block;
}

.fullscreen-exit-icon {
  display: none;
}

/* Estado quando em tela cheia */
:fullscreen .fullscreen-icon,
:-webkit-full-screen .fullscreen-icon,
:-moz-full-screen .fullscreen-icon,
:-ms-fullscreen .fullscreen-icon {
  display: none;
}

:fullscreen .fullscreen-exit-icon,
:-webkit-full-screen .fullscreen-exit-icon,
:-moz-full-screen .fullscreen-exit-icon,
:-ms-fullscreen .fullscreen-exit-icon {
  display: block !important;
}

:-webkit-full-screen .video-thumb {
  width: 100vw !important;
  height: 100vh !important;
}

/* Otimização para Safari Mobile */
@supports (-webkit-touch-callout: none) {
  .video-thumb {
    -webkit-overflow-scrolling: touch;
  }
}

.yt-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 1);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9;
  pointer-events: none;
}

.loader-spinner {
  width: 80px;
  height: 80px;
  animation: rotate 1.5s linear infinite;
}

.loader-spinner circle {
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }

  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }

  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

.botao-delay {
  display: none !important;
}

.botao-delay.show {
  display: block !important;
  margin-left: auto;
  margin: 0;
  animation: fadeIn .3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

@media(min-width: 768px) and (max-width: 1024px) {
  .overlay {
    transform: scale(0.8) !important;
  }

  .overlay:hover {
    transform: scale(1) !important;
  }

  .pause-overlay {
    background: var(--pluma-color) !important;
  }

  .pause-overlay p {
    font-size: 2.3em;
    margin-bottom: 10px;
  }
}

@media(max-width: 767px) {
  .overlay {
    transform: scale(0.7) !important;
  }

  .overlay:hover {
    transform: scale(1) !important;
  }

  .fake-progress-bar {
    height: 10px;
  }

  .pause-overlay {
    background: var(--pluma-color) !important;
  }

  .pause-overlay p {
    font-size: 5vw;
    margin-bottom: 0px !important;
  }

  .play-icon,
  .rewind-icon {
    width: 32px !important;
    height: 32px !important;
  }

  .button-group {
    flex-direction: column;
    align-items: center;
    margin-top: 0px;
    gap: 0px;
  }

  .button-group button {
    width: 100%;
    max-width: 300px;
    justify-content: center;
    padding: 0 !important;
  }

  .replay-icon {
    width: 32px !important;
    height: 32px !important;
  }
}