/* ============================================
   منصة الأستاذ محمد الحلواني - الإنترو السينمائي الإمبراطوري السريع
   Official Imperial Cinematic Intro Engine (Ultra-Smooth 60FPS)
   ============================================ */

.cinematic-intro-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 2147483647;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  opacity: 1;
  pointer-events: all;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: default;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  transition: transform 0.82s cubic-bezier(0.77, 0, 0.175, 1), opacity 0.82s cubic-bezier(0.77, 0, 0.175, 1);
  will-change: transform, opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: paint layout;
}

/* الشريط الذهبي الإمبراطوري المشع عند الانتقال للواجهة الرئيسية */
.cinematic-intro-overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    #c5a059 15%, 
    #ffd700 35%, 
    #ffffff 50%, 
    #ffd700 65%, 
    #c5a059 85%, 
    transparent 100%
  );
  box-shadow: 
    0 0 15px rgba(255, 215, 0, 0.95),
    0 0 30px rgba(197, 160, 89, 0.8),
    0 -2px 8px rgba(255, 255, 255, 0.9);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* ترانزيشن احترافي يسحب الستار لأعلى مع إشعاع الليزر الذهبي */
.cinematic-intro-overlay.slide-up-exit {
  transform: translate3d(0, -100%, 0);
  -webkit-transform: translate3d(0, -100%, 0);
  opacity: 0.98;
  pointer-events: none;
}

.cinematic-intro-overlay.slide-up-exit::after {
  opacity: 1;
}

/* عنصر الفيديو السينمائي بكامل الشاشة ومسرع عتادياً مع إضاءة متوازنة لتقليل السواد */
.intro-video-element {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  background: #02120c;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  filter: brightness(1.14) contrast(1.02) saturate(1.08);
  -webkit-filter: brightness(1.14) contrast(1.02) saturate(1.08);
}

/* إخفاء الظل الأسود الداكن المحيطي لتقليل السواد وإظهار كافة تفاصيل القلعة والأرضية */
.intro-video-vignette {
  display: none !important;
}

/* إضاءة محيطية دافئة ملكية ترفع الظلال وتمنع سواد المشهد */
.intro-video-ambient-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(197, 160, 89, 0.12) 0%, rgba(3, 26, 18, 0.35) 65%, transparent 100%);
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* قفل سكرول الصفحة أثناء الإنترو */
body.intro-active {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .cinematic-intro-overlay {
    transition: opacity 0.4s ease;
  }
  .cinematic-intro-overlay.slide-up-exit {
    transform: none;
    opacity: 0;
  }
}

/* زر تخطي المقدمة الإمبراطوري */
.intro-skip-btn {
  position: absolute;
  top: clamp(16px, 3vh, 32px);
  right: clamp(16px, 3vw, 36px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(3, 24, 16, 0.88);
  border: 1.5px solid rgba(212, 175, 55, 0.75);
  border-radius: 30px;
  color: #ffd700;
  padding: 8px 20px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 16px rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  user-select: none;
}

.intro-skip-btn:hover {
  background: rgba(6, 42, 29, 0.96);
  border-color: #ffffff;
  color: #ffffff;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85), 0 0 22px rgba(255, 215, 0, 0.6);
}

.intro-skip-btn:active {
  transform: translateY(0) scale(0.98);
}
