.player-container {
  direction: ltr;
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  background: #000;
  overflow: hidden;
  border-radius: 6px;
  transition: all 0.4s ease;
}
.player-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.player-container.theater {
  max-width: 95%;
  width: 95%;
  margin: 20px auto;
  background-color: #000;
  box-shadow: 0 0 40px rgba(0,0,0,0.85);
}
.player-container video {
  width: 100%;
  height: auto;
  display: block;
  z-index: 1;
}
.player-container .controls {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 44px;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  box-sizing: border-box;
  z-index: 10;
}
.player-container .controls-left, .player-container .controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.player-container #playPause {
  width: 28px;
  text-align: center;
  display: inline-block;
}
.player-container #playPause:hover {
  transform: scale(1.1);
}
.player-container .controls button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  position: relative;
  font-size: 18px;
  margin: 0 4px;
}
.player-container .controls button:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: #04040400;
  color: #fff;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.player-container .volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
}
.player-container .volume-icon {
  font-size: 18px;
  cursor: pointer;
  color: #eee;
  transition: color 0.3s ease;
}
.player-container .volume-icon:hover {
  color: #fff;
}
.player-container #volumeBtn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  font-size: 18px;
  cursor: pointer;
  color: #eee;
  flex-shrink: 0;
  transition: color 0.3s ease;
}
.player-container #volumeBtn:hover {
  color: #fff;
}
.player-container #volumeBtn svg {
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.player-container #volumeBtn svg:hover {
  transform: scale(1.1);
}
.player-container #volumeBtn svg polygon {
  fill: #e8e5e5;
}
.player-container #volumeBtn svg path,
.player-container #volumeBtn svg line {
  stroke: #fcb248;
  stroke-width: 3;
  stroke-linecap: round;
}
.player-container .volume-slider {
  width: 90px;
  height: 6px;
  margin-left: 8px;
  appearance: none;
  background: #222;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  transition: opacity 0.3s;
  opacity: 1;
  width: 45px;
  opacity: 1;
  pointer-events: auto;
  transition: none;
}
.player-container .volume-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #fcb248 0%, #fcb248 var(--volume-fill, 50%), #222 var(--volume-fill, 50%), #222 100%);
}
.player-container .volume-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, #fcb248 0%, #fcb248 var(--volume-fill, 50%), #222 var(--volume-fill, 50%), #222 100%);
}
.player-container .volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  margin-top: -3px;
  cursor: pointer;
}
.player-container .volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
}
.player-container #videoCanvas {
  position:absolute;
  top:0; left:0;
  width:100%; height:100%;
  z-index:2;
  pointer-events:none;
}
.player-container .volume-slider:active::-webkit-slider-thumb {
  background: #fcb248;
}
.player-container .volume-slider:active::-moz-range-thumb {
  background: #fcb248;
}
.player-container .progress-container {
  position: absolute;
  bottom: 44px;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  z-index: 20;
}
.player-container .progress-bar {
  height: 100%;
  background: #fcb248;
  width: 0%;
  z-index: 2;
}
.player-container .preview-thumb {
  position: absolute;
  bottom: 54px;
  width: 140px;
  height: 78px;
  background-size: cover;
  background-position: center;
  display: none;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 5px;
}
/* Fix Theater Button Size (Mobile Landscape + All small screens) */
.player-container #theaterBtn {
  width: 32px !important;
  height: 32px !important;
  font-size: 13px !important;
  line-height: 32px !important;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  color: #fff;
  padding: 0 !important;
  flex-shrink: 0 !important;
}
@media (max-width: 768px) {
    .player-container #theaterBtn { display: none !important; }
}
.player-container .theater-btn {
  font-size: 17px;
}
.player-container #theaterBtn:hover {
  transform: scale(1.1);
}
.player-container #ccBtn {
  color: #fff;
  opacity: 0.6;
  transition: opacity 0.3s ease, color 0.3s ease;
}
.player-container #ccBtn.active {
  opacity: 1;
  color: #fcb248;
}
.player-container #ccBtn:hover {
  transform: scale(1.1);
}
.player-container .quality-menu {
  position: relative;
  display: inline-block;
}
.player-container #settingsBtn {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.3s ease;
}
.player-container #settingsBtn:hover {
  transform: scale(1.1);
}
.player-container #qualityMenu {
  position: absolute;
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  border-radius: 6px;
  padding: 5px 0;
  display: none;
  flex-direction: column;
  text-align: center;
  min-width: 80px;
}
.player-container .quality-option {
  padding: 5px 0;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}
.player-container .quality-option:hover {
  background: rgba(255,255,255,0.1);
}
.player-container .quality-option.active {
  background: #fcb248;
}
.player-container #fullscreenBtn:hover {
  transform: scale(1.1);
}
.player-container .gesture-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 28px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  padding: 14px 22px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}
.player-container .gesture-overlay.show {
  opacity: 1;
}
.player-container .gesture-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 120px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 9999;
}
.player-container .gesture-bar.left {
  left: 20px;
}
.player-container .gesture-bar.right {
  right: 20px;
}
.player-container .gesture-bar .bar-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: #fcb248;
  height: 0%;
  transition: height 0.05s ease;
}
.player-container .gesture-bar.show {
  opacity: 1;
}
.player-container #gestureIndicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.0);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 4;
}
.player-container #gestureIcon {
  font-size: 40px;
  color: #fff;
  margin-bottom: 8px;
}
.player-container .gesture-svg {
  width: 48px;
  height: 48px;
}
.player-container .gesture-svg polygon {
  fill: #555;
}
.player-container .gesture-svg path,
.player-container .gesture-svg line {
  stroke: #fcb248;
  stroke-width: 3;
  stroke-linecap: round;
}
@media (max-width: 450px) {
  .player-container #timeDisplay {
    display: none !important;
  }
}
.player-container.hide-controls .controls {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.player-container.hide-controls .progress-container {
  bottom: 0;
}
.player-container .subtitle-display {
  position: absolute;
  bottom: 70px;
  width: 100%;
  text-align: center;
  pointer-events: none;
  transition: bottom 0.3s ease;
  z-index: 3;
}
.player-container .subtitle-display span {
  display: inline-block;
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.6;
  padding: 6px 14px;
  border-radius: 8px;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  transition: background 0.25s ease, opacity 0.25s ease;
  min-width: 0;
  min-height: 0;
}
.player-container.hide-controls .subtitle-display {
  bottom: 20px;
}
.player-container button:focus,
.player-container .control-icon:focus,
.player-container *:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
#playPause.pp-btn,
#playPause.pp-btn::before,
#playPause.pp-btn::after {
    all: unset;
}

#playPause.pp-btn {
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
}


/* PLAY */
#playPause.pp-btn.play::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid white;
}

/* PAUSE */
#playPause.pp-btn.pause {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

#playPause.pp-btn.pause::before,
#playPause.pp-btn.pause::after {
    content: '';
    width: 3px;
    height: 12px;
    background: white;
    border-radius: 1px;
}

/* RESTART */
#playPause.pp-btn.restart::before {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    mask: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><path d="M12 5V1L7 6l5 5V7c3.309 0 6 2.691 6 6s-2.691 6-6 6-6-2.691-6-6H4c0 4.411 3.589 8 8 8s8-3.589 8-8-3.589-8-8-8z"/></svg>') center / contain no-repeat;
    background: white;
}
.dt-indicator {
    position: absolute;
    top: 40%;
    font-size: 24px;
    color: white;
    background: rgba(0,0,0,0.35);
    padding: 8px 14px;
    border-radius: 6px;
    backdrop-filter: blur(2px);
    animation: dtFade .45s ease;
    user-select: none;
    pointer-events: none;
}

.dt-left { left: 20px; }
.dt-right { right: 20px; }

@keyframes dtFade {
    0% { opacity: 0; transform: scale(0.7); }
    20% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.1); }
}
#fullscreenBtn.active {
    color: #fcb248 !important;
}
/* پلیر full-width شود */
#playerBox.theater {
    width: 100% !important;
    height: auto;
}
/* وقتی تئاتر مود فعاله */
.col-lg-8.theater-mode {
    width: 100% !important;
    max-width: 100%;
    flex: 0 0 100%;
    order: 1;               /* اول نمایش داده شود */
}
