@font-face {
  font-family: "Vazirmatn";
  src: url("../webfonts/Vazirmatn[wght].woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

html[lang^="fa"] body,
body[dir="rtl"] {
  font-family: "Vazirmatn", "Roboto", sans-serif;
}

.player-shell {
  position: relative;
  width: 100%;
  --player-max-height: 100dvh;
  --subtitle-font-size: 1.8rem;
  --subtitle-font-family: "Vazirmatn", "Roboto", sans-serif;
  --subtitle-text-color: #ffffff;
  --subtitle-bg-color: rgba(0, 0, 0, 0.6);
  --subtitle-letter-spacing: 0.01em;
  --subtitle-line-height: 1.45;
}

.player-shell .plyr {
  --plyr-color-main: #d22f26;
  --plyr-range-fill-background: #d22f26;
  --plyr-video-control-color: #ffffff;
  --plyr-video-control-color-hover: #ffffff;
  --plyr-video-control-background-hover: rgba(210, 47, 38, 0.8);
  --plyr-tooltip-background: #d22f26;
  --plyr-tooltip-color: #ffffff;
}

.player-surface {
  position: relative;
  width: min(100%, calc(var(--player-max-height) * 16 / 9));
  max-height: var(--player-max-height);
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 1rem;
  overflow: hidden;
  margin-inline: auto;
}

.player-shell .plyr__captions {
  bottom: 5vh;
}

.player-shell .plyr__captions .plyr__caption {
  display: inline-block;
  padding: 0.35em 0.65em;
  border-radius: 0.5rem;
  font-size: var(--subtitle-font-size);
  font-family: var(--subtitle-font-family);
  color: var(--subtitle-text-color);
  background-color: var(--subtitle-bg-color);
  letter-spacing: var(--subtitle-letter-spacing);
  line-height: var(--subtitle-line-height);
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.75);
}

.player-shell .plyr__control--overlaid {
  background-color: #d22f26;
  color: #ffffff;
}

.player-shell .plyr__control--overlaid:hover,
.player-shell .plyr__control--overlaid:focus,
.player-shell .plyr__control--overlaid.plyr__tab-focus {
  background-color: #a3221b;
}

.player-shell .plyr__control:hover,
.player-shell .plyr__control:focus,
.player-shell .plyr__control.plyr__tab-focus {
  color: #ffffff;
  background-color: rgba(210, 47, 38, 0.25);
}

.player-shell .plyr__control[aria-expanded='true'],
.player-shell .plyr__control[aria-pressed='true'] {
  color: #ffffff;
  background-color: rgba(210, 47, 38, 0.4);
}

.player-shell .plyr__control[aria-expanded='true'] svg,
.player-shell .plyr__control[aria-pressed='true'] svg {
  fill: currentColor;
}

.player-shell .plyr__progress__buffer {
  color: rgba(210, 47, 38, 0.35);
}

.player-surface video,
.player-surface iframe,
.player-surface .player-embed-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
}

.player-overlay {
  position: absolute;
  bottom: 3.25rem;
  right: 1.25rem;
  z-index: 5;
}

.player-skip {
  backdrop-filter: blur(4px);
}

.player-toolbar {
  margin-top: 1.5rem;
}

.player-quality .player-quality-select {
  min-width: 120px;
  background-color: rgba(255, 255, 255, 0.08);
  color: #f8f9fa;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-quality .player-quality-select:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: none;
}

.player-status .badge {
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.15);
  color: #f8f9fa;
}

.player-embed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-embed iframe {
  border: 0;
}

.player-caption-controls {
  position: relative;
  min-width: 0;
}

.player-caption-toggle {
  white-space: nowrap;
}

.player-caption-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(320px, 80vw);
  background-color: rgba(15, 16, 18, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 15;
}

.player-caption-panel .caption-control:last-child {
  margin-bottom: 0;
}

.player-caption-panel .form-range {
  accent-color: #f8f9fa;
}

.player-custom-ad {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.85);
}

.player-custom-ad .btn-close {
  align-self: flex-end;
}

@media (max-width: 768px) {
  .player-surface {
    border-radius: 0.75rem;
  }

  .player-caption-panel {
    left: 0;
    right: auto;
  }

  .player-overlay {
    bottom: 1.75rem;
    right: 0.75rem;
  }
}
