/* Hormuud University Interactive Glassmorphic Video Player */
.hu-vp {
  --vp-accent: #10b981;
  --vp-accent-2: #6ee7b7;
  --vp-bg: #051810;
  --vp-track: rgba(255, 255, 255, 0.22);
  --vp-buf: rgba(255, 255, 255, 0.42);
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 1.05rem;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #0b2d1e 0%, #051810 100%);
  border: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow:
    0 22px 52px -16px rgba(1, 55, 31, 0.34),
    0 6px 18px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  user-select: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  transition: border-color 0.25s ease, box-shadow 0.28s ease;
}

.hu-vp:hover,
.hu-vp.is-hovering {
  border-color: rgba(52, 211, 153, 0.56);
  box-shadow:
    0 26px 60px -14px rgba(1, 97, 54, 0.42),
    0 0 0 1px rgba(110, 231, 183, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.hu-vp:focus-visible {
  outline: 2px solid var(--vp-accent-2);
  outline-offset: 3px;
}

/* Soft interactive emerald spotlight following pointer */
.hu-vp::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    260px circle at var(--vp-mx, 50%) var(--vp-my, 50%),
    rgba(52, 211, 153, 0.12),
    transparent 70%
  );
  transition: opacity 0.28s ease;
}

.hu-vp.is-hovering:not(.is-chrome-hover):not(.is-top-hover)::after {
  opacity: 1;
}

.hu-vp video {
  display: block;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: min(74vh, 36rem);
  margin: 0 !important;
  border-radius: 0 !important;
  background: transparent;
  object-fit: contain;
  cursor: pointer;
}

.ed__paper .ProseMirror .hu-vp video {
  max-height: 28rem;
}

/* YouTube Embed Cinema Stage (16:9 matching uploaded video glass aesthetic) */
.hu-vp--yt {
  width: 100% !important;
  aspect-ratio: 16 / 9;
}

.hu-vp__ytstage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #0b2d1e 0%, #051810 100%);
}

.hu-vp .hu-vp__ytposter {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transition: opacity 0.3s ease;
}

.hu-vp.is-yt-ready .hu-vp__ytposter {
  opacity: 0;
  pointer-events: none;
}

.hu-vp .hu-vp__ytframe,
.hu-vp .hu-vp__ytstage iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  pointer-events: none;
}

.hu-vp__surface {
  position: absolute;
  inset: 0;
  z-index: 3;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.hu-vp.is-loading .hu-vp__surface {
  background: rgba(5, 24, 16, 0.26);
}

.hu-vp:fullscreen,
.hu-vp:-webkit-full-screen {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040f0a;
}

.hu-vp:fullscreen video,
.hu-vp:-webkit-full-screen video {
  max-height: 100vh !important;
  width: 100% !important;
  height: 100% !important;
}

.hu-vp--yt:fullscreen,
.hu-vp--yt:-webkit-full-screen {
  aspect-ratio: auto !important;
  height: 100% !important;
}

.hu-vp--yt:fullscreen .hu-vp__ytstage,
.hu-vp--yt:-webkit-full-screen .hu-vp__ytstage {
  height: 100% !important;
  max-height: 100vh;
}

/* Top Floating Glass Status Pill Bar (hover/move only) */
.hu-vp__top {
  position: absolute;
  top: 0.75rem;
  left: 0.85rem;
  right: 0.85rem;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.hu-vp.is-hovering.is-active .hu-vp__top,
.hu-vp.is-loading .hu-vp__top,
.hu-vp.is-scrubbing .hu-vp__top,
.hu-vp.is-menu-open .hu-vp__top {
  opacity: 1;
  transform: translateY(0);
}

.hu-vp__badge {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.72rem;
  border-radius: 9999px;
  background: rgba(5, 24, 16, 0.66);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(110, 231, 183, 0.24);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.hu-vp__eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
}

.hu-vp__eq i {
  display: block;
  width: 2.5px;
  height: 4px;
  border-radius: 99px;
  background: var(--vp-accent-2);
  transition: height 0.2s ease;
}

.hu-vp__eq i:nth-child(2) { height: 8px; }
.hu-vp__eq i:nth-child(3) { height: 5px; }

.hu-vp.is-playing .hu-vp__eq i {
  animation: huVpEq 0.75s ease-in-out infinite alternate;
}
.hu-vp.is-playing .hu-vp__eq i:nth-child(2) { animation-delay: 0.18s; }
.hu-vp.is-playing .hu-vp__eq i:nth-child(3) { animation-delay: 0.34s; }

@keyframes huVpEq {
  0% { height: 3px; opacity: 0.65; }
  100% { height: 11px; opacity: 1; }
}

@keyframes huVpSpin {
  to { transform: rotate(360deg); }
}

@keyframes huVpPulse {
  0%, 100% {
    box-shadow:
      0 16px 38px rgba(0, 0, 0, 0.44),
      0 0 0 6px rgba(16, 185, 129, 0.2);
  }
  50% {
    box-shadow:
      0 18px 44px rgba(1, 97, 54, 0.55),
      0 0 0 11px rgba(110, 231, 183, 0.28);
  }
}

@keyframes huVpRailShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.hu-vp.is-loading .hu-vp__eq i {
  background: var(--vp-accent-2);
  animation: huVpEq 0.52s ease-in-out infinite alternate;
}

.hu-vp.is-loading .hu-vp__hero {
  opacity: 1 !important;
  border-color: rgba(110, 231, 183, 0.72);
  background: linear-gradient(145deg, rgba(1, 97, 54, 0.9), rgba(5, 28, 18, 0.9));
  animation: huVpPulse 1.35s ease-in-out infinite;
}

.hu-vp.is-loading .hu-vp__hero svg,
.hu-vp.is-loading .hu-vp__btn--play svg {
  margin-left: 0;
  animation: huVpSpin 0.8s linear infinite;
}

.hu-vp.is-loading .hu-vp__rail::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(16, 185, 129, 0.08) 0%,
    rgba(110, 231, 183, 0.92) 50%,
    rgba(16, 185, 129, 0.08) 100%
  );
  background-size: 200% 100%;
  animation: huVpRailShimmer 1.2s ease-in-out infinite;
}

.hu-vp__tophint {
  pointer-events: auto;
  padding: 0.28rem 0.62rem;
  border-radius: 9999px;
  background: rgba(5, 24, 16, 0.56);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.78);
}

/* Center & Cursor-Following Play/Pause Hero Button */
.hu-vp__hero {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(1);
  z-index: 4;
  display: grid;
  place-items: center;
  width: 4.35rem;
  height: 4.35rem;
  border: 1px solid rgba(110, 231, 183, 0.45);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(1, 97, 54, 0.82), rgba(5, 28, 18, 0.82));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #ffffff;
  cursor: pointer;
  box-shadow:
    0 16px 38px rgba(0, 0, 0, 0.42),
    0 0 0 6px rgba(16, 185, 129, 0.14);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease, background 0.18s ease, left 0.24s ease, top 0.24s ease, box-shadow 0.2s ease;
  will-change: transform, opacity;
}

.hu-vp__hero:hover {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.94), rgba(1, 97, 54, 0.94));
  box-shadow:
    0 18px 42px rgba(1, 97, 54, 0.5),
    0 0 0 9px rgba(16, 185, 129, 0.2);
  transform: translate(-50%, -50%) scale(1.07);
}

.hu-vp__hero svg {
  margin-left: 3px;
}

.hu-vp.is-playing .hu-vp__hero svg {
  margin-left: 0;
}

.hu-vp.is-playing .hu-vp__hero {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.86);
}

.hu-vp.is-cursor-follow .hu-vp__hero {
  left: 0;
  top: 0;
  pointer-events: none;
  transform: translate3d(var(--vp-cx, 50%), var(--vp-cy, 50%), 0) translate(-50%, -50%) scale(var(--vp-cs, 1));
  transition: opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.hu-vp.is-cursor-follow.is-playing .hu-vp__hero {
  opacity: 0.92;
  background: rgba(5, 24, 16, 0.72);
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38), 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.hu-vp.is-cursor-follow.is-chrome-hover .hu-vp__hero,
.hu-vp.is-cursor-follow.is-top-hover .hu-vp__hero,
.hu-vp.is-cursor-follow.is-menu-open .hu-vp__hero,
.hu-vp.is-scrubbing .hu-vp__hero {
  opacity: 0 !important;
  pointer-events: none;
}

.hu-vp.is-cursor-follow.is-pressing .hu-vp__hero {
  --vp-cs: 0.9;
}

/* Center Action Flash (Space/Click/Skip HUD) */
.hu-vp__hud {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.52rem 0.95rem;
  border-radius: 9999px;
  background: rgba(5, 24, 16, 0.84);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(110, 231, 183, 0.28);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.hu-vp__hud.is-show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Bottom Floating Glass Control Dock: ONLY visible when mouse hovers/moves inside video */
.hu-vp__chrome {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 6;
  padding: 0.55rem 0.85rem 0.58rem;
  border-radius: 0.9rem;
  background: rgba(5, 24, 16, 0.74);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(110, 231, 183, 0.2);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.hu-vp.is-hovering.is-active .hu-vp__chrome,
.hu-vp.is-loading .hu-vp__chrome,
.hu-vp.is-scrubbing .hu-vp__chrome,
.hu-vp.is-menu-open .hu-vp__chrome,
.hu-vp:focus-within .hu-vp__chrome {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Progress Seekbar */
.hu-vp__seek {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  margin-bottom: 0.25rem;
}

.hu-vp__rail {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 9999px;
  background: var(--vp-track);
  overflow: visible;
  transition: height 0.14s ease;
}

.hu-vp__seek:hover .hu-vp__rail,
.hu-vp.is-scrubbing .hu-vp__rail {
  height: 6px;
}

.hu-vp__buf,
.hu-vp__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: 9999px;
  pointer-events: none;
}

.hu-vp__buf {
  background: var(--vp-buf);
}

.hu-vp__fill {
  background: linear-gradient(90deg, var(--vp-accent), var(--vp-accent-2));
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.45);
}

.hu-vp__thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 2px var(--vp-accent), 0 2px 6px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.14s ease;
  pointer-events: none;
}

.hu-vp__seek:hover .hu-vp__thumb,
.hu-vp.is-scrubbing .hu-vp__thumb {
  transform: translate(-50%, -50%) scale(1);
}

.hu-vp__tip {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  padding: 0.18rem 0.48rem;
  border-radius: 0.38rem;
  background: rgba(5, 24, 16, 0.94);
  border: 1px solid rgba(110, 231, 183, 0.3);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.hu-vp__seek:hover .hu-vp__tip,
.hu-vp.is-scrubbing .hu-vp__tip {
  opacity: 1;
}

/* Controls Row */
.hu-vp__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.hu-vp__left,
.hu-vp__right {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  min-width: 0;
}

.hu-vp__btn {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.hu-vp__btn:hover {
  background: rgba(16, 185, 129, 0.24);
  color: #ffffff;
}

.hu-vp__btn:active {
  transform: scale(0.92);
}

.hu-vp__btn--skip {
  width: auto;
  padding: 0 0.42rem;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.hu-vp__vol {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.hu-vp__volslider {
  width: 0;
  opacity: 0;
  accent-color: var(--vp-accent-2);
  cursor: pointer;
  height: 4px;
  transition: width 0.18s ease, opacity 0.18s ease, margin 0.18s ease;
  margin-right: 0;
}

.hu-vp__vol:hover .hu-vp__volslider,
.hu-vp__vol:focus-within .hu-vp__volslider {
  width: 4.25rem;
  opacity: 1;
  margin-right: 0.35rem;
}

.hu-vp__time {
  border: 0;
  background: transparent;
  padding: 0.2rem 0.42rem;
  border-radius: 0.45rem;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.77rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}

.hu-vp__time:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Playback Speed Menu */
.hu-vp__speedwrap {
  position: relative;
}

.hu-vp__speedbtn {
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.hu-vp__menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  min-width: 5.5rem;
  padding: 0.25rem;
  border-radius: 0.65rem;
  background: rgba(5, 24, 16, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(110, 231, 183, 0.26);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 0.1rem;
  z-index: 10;
}

.hu-vp__menu[hidden] {
  display: none;
}

.hu-vp__opt {
  border: 0;
  border-radius: 0.42rem;
  padding: 0.32rem 0.55rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hu-vp__opt:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.hu-vp__opt.is-selected {
  background: rgba(16, 185, 129, 0.28);
  color: #6ee7b7;
  font-weight: 600;
}

/* Mobile & Reduced Motion refinements */
@media (max-width: 600px) {
  .hu-vp__hero {
    width: 3.35rem;
    height: 3.35rem;
  }
  .hu-vp__top {
    display: none;
  }
  .hu-vp__chrome {
    left: 0.4rem;
    right: 0.4rem;
    bottom: 0.4rem;
    padding: 0.42rem 0.55rem;
  }
  .hu-vp__btn--skip span {
    display: none;
  }
  .hu-vp__volslider {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hu-vp__hero,
  .hu-vp__chrome,
  .hu-vp__top,
  .hu-vp__eq i,
  .hu-vp.is-loading .hu-vp__hero,
  .hu-vp.is-loading .hu-vp__hero svg,
  .hu-vp.is-loading .hu-vp__btn--play svg,
  .hu-vp.is-loading .hu-vp__rail::after {
    transition: none;
    animation: none;
  }
}
