/* ==========================================================================
   SafarGet Homepage — Instant Autoplay Cinema Video Showcase (v2)
   Placed directly beneath #top (.hero) and before #network
   Exact 980px 16:9 cinema proportions matching /wiki/, fully isolated from
   Tailwind / React bundle rules so the video can never stretch full-screen.
   ========================================================================== */

#sg-video-showcase {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  padding: clamp(28px, 4vw, 54px) 24px clamp(58px, 6.5vw, 88px);
  scroll-margin-top: 92px;
  border-top: 1px solid rgba(23, 59, 64, 0.08);
  background: radial-gradient(ellipse 68% 55% at 50% 48%, rgba(19, 169, 140, 0.09), transparent 72%);
  font-family: "IBM Plex Sans Arabic", "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

#sg-video-showcase *,
#sg-video-showcase *::before,
#sg-video-showcase *::after {
  box-sizing: border-box;
}

#sg-video-showcase .sg-video-inner {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
}

#sg-video-showcase .sg-video-head {
  width: 100%;
  max-width: 700px;
  margin: 0 auto clamp(22px, 2.8vw, 32px);
  text-align: center;
}

#sg-video-showcase .sg-video-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 1px solid rgba(19, 169, 140, 0.28);
  background: rgba(255, 255, 255, 0.86);
  color: #0e8670;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 6px 18px rgba(15, 118, 100, 0.08);
}

#sg-video-showcase .sg-video-eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #18b897;
  box-shadow: 0 0 0 4px rgba(24, 184, 151, 0.22);
  flex: none;
  animation: sg-vid-pulse 2s ease-in-out infinite;
}

@keyframes sg-vid-pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(24, 184, 151, 0.04);
    opacity: 0.78;
  }
}

#sg-video-showcase .sg-video-head h2 {
  margin: 0;
  color: #172c32;
  font-size: clamp(28px, 3.8vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1.2px;
}

#sg-video-showcase .sg-video-head h2 .sg-video-title-accent {
  color: #0fa88a;
}

#sg-video-showcase .sg-video-head p {
  margin: 10px auto 0;
  max-width: 620px;
  color: #556c67;
  font-size: 14.5px;
  line-height: 1.78;
}

/* Exact 980px 16:9 Cinema Stage (matches /wiki/ proportions) */
#sg-video-showcase .sg-video-stage {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
}

#sg-video-showcase .sg-video-glow {
  position: absolute;
  inset: -12px -14px -18px;
  z-index: 0;
  border-radius: 32px;
  background:
    radial-gradient(62% 58% at 22% 20%, rgba(19, 185, 152, 0.28), transparent 70%),
    radial-gradient(58% 58% at 78% 82%, rgba(56, 189, 248, 0.22), transparent 72%),
    radial-gradient(50% 50% at 50% 50%, rgba(139, 92, 246, 0.12), transparent 75%);
  filter: blur(30px);
  opacity: 0.72;
  pointer-events: none;
  animation: sg-vid-halo 9s ease-in-out infinite alternate;
}

@keyframes sg-vid-halo {
  0% {
    opacity: 0.58;
    transform: scale(0.99);
  }
  100% {
    opacity: 0.84;
    transform: scale(1.012);
  }
}

#sg-video-showcase .sg-video-frame {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 980px;
  aspect-ratio: 16 / 9;
  height: auto;
  margin-inline: auto;
  border-radius: 22px;
  overflow: hidden;
  background: #0d1116;
  border: 1px solid rgba(60, 230, 190, 0.34);
  box-shadow:
    0 28px 74px rgba(12, 42, 40, 0.26),
    0 10px 26px rgba(12, 42, 40, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  outline: none;
  transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

@supports not (aspect-ratio: 16 / 9) {
  #sg-video-showcase .sg-video-frame {
    height: 0;
    padding-top: 56.25%;
  }
}

#sg-video-showcase .sg-video-frame:hover,
#sg-video-showcase .sg-video-frame:focus-visible {
  border-color: rgba(60, 230, 190, 0.6);
  box-shadow:
    0 34px 86px rgba(12, 42, 40, 0.32),
    0 14px 32px rgba(19, 169, 140, 0.2),
    0 0 0 1px rgba(94, 242, 204, 0.22) inset;
}

#sg-video-showcase .sg-video-frame:fullscreen,
#sg-video-showcase .sg-video-frame:-webkit-full-screen {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
  background: #000000;
  box-shadow: none;
}

/* Absolute fill locks video cleanly inside 16:9 frame across Safari/Chrome/Firefox */
#sg-video-showcase .sg-video-el {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0;
  padding: 0;
  object-fit: cover;
  background: #0d1116;
  cursor: pointer;
}

#sg-video-showcase .sg-video-frame:fullscreen .sg-video-el,
#sg-video-showcase .sg-video-frame:-webkit-full-screen .sg-video-el {
  object-fit: contain;
}

/* Buffering Spinner */
#sg-video-showcase .sg-video-loader {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  background: rgba(5, 12, 16, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#sg-video-showcase .sg-video-frame.is-buffering .sg-video-loader {
  opacity: 1;
}

#sg-video-showcase .sg-video-spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #3ce6be;
  animation: sg-vid-spin 0.8s linear infinite;
}

@keyframes sg-vid-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Top Floating HUD */
#sg-video-showcase .sg-video-hud-top {
  position: absolute;
  top: 14px;
  inset-inline: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

#sg-video-showcase .sg-video-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(130, 214, 194, 0.28);
  background: rgba(5, 13, 18, 0.76);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #eef9f5;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

#sg-video-showcase .sg-video-frame:hover .sg-video-live-pill,
#sg-video-showcase .sg-video-frame:focus-within .sg-video-live-pill,
#sg-video-showcase .sg-video-frame.is-paused .sg-video-live-pill,
#sg-video-showcase .sg-video-frame.is-controls-visible .sg-video-live-pill {
  opacity: 1;
  transform: none;
}

#sg-video-showcase .sg-video-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3ce6be;
  box-shadow: 0 0 0 4px rgba(60, 230, 190, 0.25);
  flex: none;
  animation: sg-vid-pulse 2s ease-in-out infinite;
}

#sg-video-showcase .sg-video-unmute-cta {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  min-height: 0;
  border-radius: 999px;
  border: 1px solid rgba(94, 242, 204, 0.54);
  background: linear-gradient(135deg, rgba(16, 165, 136, 0.94), rgba(11, 118, 132, 0.94));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.44), 0 0 24px rgba(60, 230, 190, 0.34);
  animation: sg-vid-unmute-pulse 2.6s ease-in-out infinite;
  transition: opacity 0.25s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

#sg-video-showcase .sg-video-unmute-cta svg {
  display: block;
  width: 16px;
  height: 16px;
  color: #ffffff;
  flex: none;
}

#sg-video-showcase .sg-video-unmute-cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 32px rgba(60, 230, 190, 0.52);
}

@keyframes sg-vid-unmute-pulse {
  0%, 100% {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.44), 0 0 0 0 rgba(60, 230, 190, 0.46);
  }
  55% {
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.44), 0 0 0 10px rgba(60, 230, 190, 0);
  }
}

#sg-video-showcase .sg-video-frame:not(.is-muted) .sg-video-unmute-cta {
  opacity: 0;
  transform: translateY(-6px) scale(0.94);
  pointer-events: none;
  animation: none;
}

/* Center Play / Pause Feedback Overlay */
#sg-video-showcase .sg-video-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(94, 242, 204, 0.5);
  background: rgba(6, 19, 25, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 36px rgba(60, 230, 190, 0.32);
  transform: translate(-50%, -50%) scale(0.84);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

#sg-video-showcase .sg-video-center-btn svg {
  display: block;
  color: #ffffff;
}

#sg-video-showcase .sg-video-frame.is-paused .sg-video-center-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

#sg-video-showcase .sg-video-frame.is-paused .sg-video-center-btn:hover {
  background: linear-gradient(135deg, #13a98c, #0b856e);
  transform: translate(-50%, -50%) scale(1.07);
}

#sg-video-showcase .sg-video-frame.is-flash .sg-video-center-btn {
  opacity: 0.92;
  transform: translate(-50%, -50%) scale(1);
}

#sg-video-showcase .sg-video-center-btn .sg-ico-play {
  margin-left: 3px;
}

/* State-Driven Icon Toggles */
#sg-video-showcase .sg-video-frame:not(.is-paused) .sg-ico-play,
#sg-video-showcase .sg-video-frame.is-paused .sg-ico-pause,
#sg-video-showcase .sg-video-frame:not(.is-muted) .sg-ico-muted,
#sg-video-showcase .sg-video-frame.is-muted .sg-ico-sound,
#sg-video-showcase .sg-video-frame:not(.is-fullscreen) .sg-ico-fs-exit,
#sg-video-showcase .sg-video-frame.is-fullscreen .sg-ico-fs-open {
  display: none !important;
}

/* Bottom Frosted-Glass Media Controls */
#sg-video-showcase .sg-video-controls {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 7;
  padding: 28px 16px 13px;
  background: linear-gradient(180deg, transparent 0%, rgba(4, 11, 16, 0.78) 38%, rgba(4, 11, 16, 0.96) 100%);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

#sg-video-showcase .sg-video-frame:hover .sg-video-controls,
#sg-video-showcase .sg-video-frame:focus-within .sg-video-controls,
#sg-video-showcase .sg-video-frame.is-paused .sg-video-controls,
#sg-video-showcase .sg-video-frame.is-controls-visible .sg-video-controls {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#sg-video-showcase .sg-video-seek {
  position: relative;
  height: 18px;
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

#sg-video-showcase .sg-video-track {
  position: relative;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
  transition: height 0.16s ease;
}

#sg-video-showcase .sg-video-seek:hover .sg-video-track {
  height: 7px;
}

#sg-video-showcase .sg-video-buffered {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  transition: width 0.2s linear;
}

#sg-video-showcase .sg-video-played {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 0%;
  background: linear-gradient(90deg, #3ce6be, #38bdf8);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(60, 230, 190, 0.65);
}

#sg-video-showcase .sg-video-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}

#sg-video-showcase .sg-video-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#sg-video-showcase .sg-video-bar-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#sg-video-showcase .sg-vc-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0 8px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #eef9f5;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.16s ease;
}

#sg-video-showcase .sg-vc-btn svg {
  display: block;
  width: 16px;
  height: 16px;
  color: currentColor;
}

#sg-video-showcase .sg-vc-btn:hover {
  background: rgba(60, 230, 190, 0.24);
  border-color: rgba(94, 242, 204, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

#sg-video-showcase .sg-vc-btn[hidden] {
  display: none !important;
}

#sg-video-showcase .sg-vc-speed {
  min-width: 44px;
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.2px;
}

#sg-video-showcase .sg-video-time {
  margin-inline-start: 6px;
  color: rgba(238, 249, 245, 0.9);
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Highlights Strip under Cinema Frame */
#sg-video-showcase .sg-video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  margin-top: 18px;
}

#sg-video-showcase .sg-video-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #c3dbd3;
  background: rgba(255, 255, 255, 0.86);
  color: #1f3d3b;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 5px 15px rgba(22, 55, 55, 0.06);
}

#sg-video-showcase .sg-video-meta-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #13a98c;
  box-shadow: 0 0 8px rgba(19, 169, 140, 0.55);
  flex: none;
}

#sg-video-showcase .sg-video-meta-dot--cyan {
  background: #0284c7;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.45);
}

#sg-video-showcase .sg-video-meta-dot--violet {
  background: #7c3aed;
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.45);
}

#sg-video-showcase .sg-video-wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid rgba(19, 169, 140, 0.38);
  background: linear-gradient(135deg, rgba(19, 169, 140, 0.14), rgba(14, 165, 233, 0.1));
  color: #0b7a65;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#sg-video-showcase .sg-video-wiki-link:hover {
  transform: translateY(-2px);
  border-color: #13a98c;
  background: #13a98c;
  color: #ffffff;
}

/* Responsive Breakpoints */
@media (max-width: 640px) {
  #sg-video-showcase {
    padding: 24px 14px 52px;
    scroll-margin-top: 84px;
  }

  #sg-video-showcase .sg-video-frame {
    border-radius: 15px;
  }

  #sg-video-showcase .sg-video-hud-top {
    top: 10px;
    inset-inline: 10px;
  }

  #sg-video-showcase .sg-video-live-pill {
    padding: 5px 10px;
    font-size: 10.5px;
  }

  #sg-video-showcase .sg-video-unmute-cta {
    padding: 6px 12px;
    font-size: 11.5px;
  }

  #sg-video-showcase .sg-video-center-btn {
    width: 58px;
    height: 58px;
  }

  #sg-video-showcase .sg-video-controls {
    padding: 20px 10px 10px;
  }

  #sg-video-showcase .sg-vc-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
  }

  #sg-video-showcase .sg-video-time {
    font-size: 11px;
  }

  #sg-video-showcase .sg-video-meta {
    gap: 8px;
  }

  #sg-video-showcase .sg-video-meta-item,
  #sg-video-showcase .sg-video-wiki-link {
    font-size: 11.5px;
    padding: 6px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #sg-video-showcase .sg-video-eyebrow-dot,
  #sg-video-showcase .sg-video-live-dot,
  #sg-video-showcase .sg-video-glow,
  #sg-video-showcase .sg-video-unmute-cta {
    animation: none !important;
  }
}
