/* RAVID Patch 12 - Video Player Controls & Fullscreen Stabilizer
   Scope: student video section only. Keeps upload/link video flow healthy. */

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell {
  position: relative !important;
  isolation: isolate;
  background: #020617;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell iframe,
body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell video.main-video-el {
  width: 100% !important;
  height: 100% !important;
  min-height: 440px !important;
  border: 0 !important;
  border-radius: 28px !important;
  object-fit: contain !important;
  background: #020617 !important;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell:fullscreen,
body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell:-webkit-full-screen {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  border-radius: 0 !important;
  background: #020617 !important;
  display: grid !important;
  place-items: center !important;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell:fullscreen iframe,
body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell:fullscreen video.main-video-el,
body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell:-webkit-full-screen iframe,
body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell:-webkit-full-screen video.main-video-el {
  width: 100vw !important;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-meta {
  left: 18px !important;
  right: 18px !important;
  bottom: 18px !important;
  min-height: 62px;
  padding: 12px 14px !important;
  gap: 14px !important;
  align-items: center !important;
  pointer-events: none;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-meta > * {
  pointer-events: auto;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-title strong {
  max-width: min(52vw, 620px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 950;
  letter-spacing: -.02em;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-bar {
  position: absolute;
  z-index: 5;
  top: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: auto;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-btn,
body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-fullscreen-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .34);
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 950;
  font-size: 13px;
  letter-spacing: -.01em;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(37, 99, 235, .96), rgba(14, 165, 233, .92));
  box-shadow: 0 16px 34px rgba(2, 6, 23, .24), inset 0 1px 0 rgba(255,255,255,.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-btn:hover,
body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-fullscreen-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 20px 42px rgba(2, 6, 23, .30), inset 0 1px 0 rgba(255,255,255,.28);
}

body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-btn:focus-visible,
body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-fullscreen-btn:focus-visible {
  outline: 3px solid rgba(147, 197, 253, .80);
  outline-offset: 3px;
}

body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-help-note {
  position: absolute;
  z-index: 4;
  left: 18px;
  top: 18px;
  max-width: min(420px, calc(100% - 220px));
  padding: 10px 13px;
  border-radius: 999px;
  color: rgba(255,255,255,.94);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 850;
  background: rgba(15, 23, 42, .42);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 14px 30px rgba(2, 6, 23, .18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-help-note strong {
  color: #fff;
}

@media (max-width: 980px) {
  body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell iframe,
  body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-shell video.main-video-el {
    min-height: 320px !important;
  }

  body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-help-note {
    position: static;
    margin: 10px 12px 0;
    max-width: none;
    border-radius: 18px;
  }

  body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-bar {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  body.ravid-premium-theme #section-video.ravid-video-flagship .video-frame-meta {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

@media (max-width: 640px) {
  body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-bar {
    position: static;
    padding: 12px;
    background: #020617;
    justify-content: stretch;
  }

  body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-control-btn,
  body.ravid-premium-theme #section-video.ravid-video-flagship .ravid-video-fullscreen-btn {
    flex: 1 1 140px;
  }
}
