/* HotAagMaal PremiumPlayer — matches ReactTheme PremiumPlayer.tsx */

.ha-player-wrap {
  width: 100%;
}

.ha-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 1rem;
  background: #050505;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  outline: 1px solid rgba(255, 255, 255, 0.1);
  outline-offset: -1px;
  user-select: none;
  -webkit-user-select: none;
  color: #fff;
  font-family: inherit;
}

.ha-player.is-fs {
  position: fixed;
  inset: 0;
  z-index: 200;
  width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  outline: none;
}

.ha-player__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  transition: transform 0.3s ease;
}

.ha-player__video.is-flip-h {
  transform: scaleX(-1);
}

.ha-player__video.is-flip-v {
  transform: scaleY(-1);
}

/* Mobile double-tap seek hints */
.ha-player__seek-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.ha-player__seek-hint.is-visible {
  opacity: 1;
}

.ha-player__seek-hint--left {
  left: 0;
}

.ha-player__seek-hint--right {
  right: 0;
}

.ha-player__seek-hint span {
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

@media (min-width: 640px) {
  .ha-player__seek-hint {
    display: none;
  }
}

/* Gradient overlay */
.ha-player__gradient {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.6) 0%,
    transparent 32%,
    transparent 55%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

.ha-player.is-playing .ha-player__gradient {
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 55%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

.ha-player.is-ui-hidden .ha-player__gradient {
  opacity: 0;
}

/* Top brand + title (idle/paused) */
.ha-player__top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1rem 1rem 2rem;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s, transform 0.3s;
}

@media (min-width: 768px) {
  .ha-player__top {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

.ha-player.is-playing .ha-player__top {
  opacity: 0;
  transform: translateY(-0.5rem);
}

.ha-player__top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ha-player__top-copy {
  min-width: 0;
}

.ha-player__brand {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #ff0000;
}

.ha-player__top-title {
  margin: 0.125rem 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .ha-player__top-title {
    font-size: 1rem;
  }
}

.ha-player__badge {
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.625rem;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

/* Center overlay — each layer fills the frame so ±10 controls stay centered on desktop */
.ha-player__center {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.ha-player__loader,
.ha-player__play-big,
.ha-player__center-row {
  position: absolute;
  inset: 0;
  margin: 0;
  pointer-events: none;
}

.ha-player__loader {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}

.ha-player__loader:not([hidden])::before {
  content: "";
  position: absolute;
  width: 4rem;
  height: 4rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.ha-player__loader[hidden] {
  display: none !important;
}

.ha-player__spinner {
  position: relative;
  z-index: 1;
  display: block;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  animation: ha-player-spin 0.8s linear infinite;
}

@keyframes ha-player-spin {
  to {
    transform: rotate(360deg);
  }
}

.ha-player__play-big {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: 4rem;
  height: 4rem;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ff0000 !important;
  color: #fff !important;
  box-shadow: 0 12px 40px rgba(255, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.15s;
}

@media (min-width: 768px) {
  .ha-player__play-big {
    width: 5rem;
    height: 5rem;
  }
}

.ha-player__play-big:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.ha-player__play-big:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.ha-player__play-big[hidden],
.ha-player__center-row[hidden] {
  display: none !important;
}

.ha-player__center-row {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media (min-width: 640px) {
  .ha-player.is-playing.is-chrome-visible .ha-player__center-row:not([hidden]) {
    display: flex;
  }
}

@media (max-width: 639.98px) {
  .ha-player__center-row {
    display: none !important;
  }
}

.ha-player__center-btn {
  pointer-events: auto;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45) !important;
  color: #fff !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.15s;
}

.ha-player__center-btn:hover {
  background: rgba(0, 0, 0, 0.65) !important;
}

.ha-player__center-btn--main {
  width: 3.5rem;
  height: 3.5rem;
}

@media (min-width: 768px) {
  .ha-player__center-row {
    gap: 3rem;
  }

  .ha-player__center-btn--main {
    width: 4rem;
    height: 4rem;
  }
}

.ha-player__seek-icon {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
}

.ha-player__seek-icon span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  padding-top: 2px;
}

.ha-player__seek-icon.is-fwd svg {
  transform: scaleX(-1);
}

/* Error */
.ha-player__error {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
}

.ha-player__error[hidden] {
  display: none !important;
}

.ha-player__error p {
  margin: 0 0 0.5rem;
  font-weight: 600;
}

.ha-player__retry {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  background: #ff0000 !important;
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

/* End screen */
.ha-player__end {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: hidden;
}

.ha-player__end[hidden] {
  display: none !important;
}

.ha-player__end-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.ha-player__end-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 50% at 50% 40%, rgba(255, 0, 0, 0.14), transparent 60%);
}

.ha-player__end-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
}

@media (min-width: 768px) {
  .ha-player__end-inner {
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }
}

.ha-player__end-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  height: 1.75rem;
  margin-bottom: 0.375rem;
}

.ha-player__end-label {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ha-player__end-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.ha-player__end-btn {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  padding: 0 0.5rem;
  height: 1.5rem;
}

.ha-player__end-btn--icon {
  width: 1.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ha-player__end-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.375rem;
}

@media (min-width: 768px) {
  .ha-player__end-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
    max-width: 820px;
    flex: none;
  }
}

.ha-player__end-card {
  position: relative;
  min-height: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: #151515;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #fff;
}

@media (min-width: 768px) {
  .ha-player__end-card {
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .ha-player__end-card:hover {
    transform: scale(1.02);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
  }
}

.ha-player__end-card.is-next {
  box-shadow: 0 0 0 1px #ff0000;
}

.ha-player__end-card.is-countdown {
  box-shadow: 0 0 18px rgba(255, 0, 0, 0.28), 0 0 0 1px #ff0000;
}

.ha-player__end-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ha-player__end-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.25) 45%, transparent);
}

.ha-player__end-card__tag {
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
  background: #ff0000;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ha-player__end-card__dur {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  font-size: 8px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 0 0.25rem;
  border-radius: 0.25rem;
}

.ha-player__end-card__title {
  position: absolute;
  bottom: 0.25rem;
  left: 0.25rem;
  right: 2.25rem;
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .ha-player__end-card__title {
    font-size: 11px;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 3rem;
  }
}

/* Bottom controls */
.ha-player__controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  padding: 2.5rem 0.75rem 0.75rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s, transform 0.3s;
}

@media (min-width: 768px) {
  .ha-player__controls {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

.ha-player:not(.is-chrome-visible) .ha-player__controls,
.ha-player.is-ended .ha-player__controls {
  opacity: 0;
  transform: translateY(0.75rem);
  pointer-events: none;
}

.ha-player__seek-wrap {
  position: relative;
  width: 100%;
  flex: 0 0 auto;
  margin-bottom: 0.75rem;
}

.ha-player__seek-hit {
  position: absolute;
  left: 0;
  right: 0;
  top: -0.75rem;
  bottom: -0.75rem;
  z-index: 10;
  cursor: pointer;
  touch-action: none;
}

.ha-player__seek-track {
  position: relative;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  overflow: visible;
}

.ha-player__seek-buffer {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.ha-player__seek-played {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(to right, #ff0000, #ff4d6d);
}

.ha-player__seek-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.55);
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.15s;
  pointer-events: none;
}

.ha-player__seek-wrap:hover .ha-player__seek-thumb,
.ha-player.is-scrubbing .ha-player__seek-thumb {
  opacity: 1;
}

.ha-player__bar {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  width: 100%;
  flex: 0 0 auto;
}

@media (min-width: 768px) {
  .ha-player__bar {
    gap: 0.5rem;
  }
}

.ha-player__bar-left,
.ha-player__bar-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.ha-player__bar-right {
  margin-left: auto;
  position: relative;
}

body.ha-theme .ha-player .ha-player__btn,
body.ha-theme.single .ha-player .ha-player__btn,
body.ha-theme.single-post .ha-player .ha-player__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0.5rem;
  border: 0;
  border-radius: 999px;
  background: transparent !important;
  color: #fff !important;
  cursor: pointer;
  box-shadow: none !important;
  transition: background 0.15s;
}

body.ha-theme .ha-player .ha-player__btn:hover,
body.ha-theme.single .ha-player .ha-player__btn:hover,
body.ha-theme.single-post .ha-player .ha-player__btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

/* Play/pause: only one icon visible (RetroTube breaks [hidden] on SVG) */
.ha-player .ha-player__btn[data-ha-toggle] .ha-player__icon-play,
.ha-player .ha-player__btn[data-ha-toggle] .ha-player__icon-pause {
  display: none !important;
}

.ha-player:not(.is-playing) .ha-player__btn[data-ha-toggle] .ha-player__icon-play {
  display: block !important;
}

.ha-player.is-playing .ha-player__btn[data-ha-toggle] .ha-player__icon-pause {
  display: block !important;
}

.ha-player [hidden] {
  display: none !important;
}

body.ha-theme .ha-player .ha-player__btn.is-active,
body.ha-theme.single .ha-player .ha-player__btn.is-active,
body.ha-theme.single-post .ha-player .ha-player__btn.is-active {
  background: rgba(255, 255, 255, 0.1) !important;
}

.ha-player__vol-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ha-player__time {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 0.25rem;
}

@media (min-width: 768px) {
  .ha-player__time {
    font-size: 0.875rem;
  }
}

.ha-player__time-sep {
  color: rgba(255, 255, 255, 0.35);
}

.ha-player__vol-icon {
  display: none !important;
}

.ha-player__vol-icon.is-on {
  display: block !important;
}

.ha-volume {
  display: none;
  width: 3.5rem;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  accent-color: #fff;
}

@media (min-width: 768px) {
  .ha-volume {
    display: block;
    width: 6rem;
  }
}

.ha-volume::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.ha-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 999px;
  background: #fff;
  border: none;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.45);
}

.ha-volume::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  border: none;
}

.ha-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #fff;
  border: none;
}

/* Settings panel */
.ha-player__settings {
  position: absolute;
  right: 0.75rem;
  bottom: 3.25rem;
  z-index: 30;
  width: 16rem;
  border-radius: 0.75rem;
  background: rgba(26, 26, 26, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.ha-player__settings[hidden] {
  display: none !important;
}

.ha-player__settings-view[hidden] {
  display: none !important;
}

.ha-player__settings-item,
.ha-player__settings-back,
.ha-player__settings-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.875rem;
  border: 0;
  background: transparent !important;
  color: #fff !important;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
}

.ha-player__settings-item:hover,
.ha-player__settings-back:hover,
.ha-player__settings-opt:hover {
  background: rgba(255, 255, 255, 0.06) !important;
}

.ha-player__settings-item span:first-of-type {
  flex: 1;
}

.ha-player__settings-val {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.875rem;
}

.ha-player__settings-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.25rem 0;
}

.ha-player__settings-opt.is-active {
  color: #ff0000 !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.ha-player__settings-back {
  color: rgba(255, 255, 255, 0.7) !important;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.ha-player__icon-fs-exit {
  display: none !important;
}

.ha-player.is-fs .ha-player__icon-fs-enter {
  display: none !important;
}

.ha-player.is-fs .ha-player__icon-fs-exit {
  display: block !important;
}

/* Empty state */
.ha-player--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.05);
}

.ha-player__empty-msg {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.45);
}

/* Theme watch page fit */
.ha-watch-main .ha-player-wrap,
.ha-watch-main .ha-player {
  border-radius: 1rem;
}

.ha-watch-main .video-player {
  aspect-ratio: auto;
  background: transparent;
  box-shadow: none;
  outline: none;
}
