/* 
 * BSTM Store - Animated Intro Screen 
 * صفحة العرض التقديمي المتحركة
 */

.intro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  min-height: -webkit-fill-available; /* للأجهزة المحمولة iOS */
  background-color: #000000;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 1s ease-out;
  overflow: hidden;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* منع التمرير عند ظهور العرض التقديمي */
body.has-intro {
  overflow: hidden;
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  position: fixed;
}

.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-logo-container {
  width: 160px;
  height: 160px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 50px;
  position: relative;
}

.intro-logo {
  position: absolute;
  width: 100%;
  height: auto;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.5s ease, transform 0.5s ease;
  filter: drop-shadow(0 0 8px rgba(209, 0, 0, 0.4));
}

.intro-logo.active {
  opacity: 1;
  transform: scale(1);
  animation: logo-pulse 2s infinite alternate;
}

@keyframes logo-pulse {
  0% { filter: drop-shadow(0 0 5px rgba(209, 0, 0, 0.3)); transform: scale(1); }
  100% { filter: drop-shadow(0 0 15px rgba(209, 0, 0, 0.6)); transform: scale(1.05); }
}

.intro-message-container {
  text-align: center;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.intro-message {
  color: #ffffff;
  font-family: 'Tajawal', sans-serif;
  font-size: 32px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  position: absolute;
  text-shadow: 0 0 15px rgba(209, 0, 0, 0.6);
  letter-spacing: 0.5px;
  background: linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0.8));
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  width: 100%;
  text-align: center;
  padding: 0 20px;
  box-sizing: border-box;
}

.intro-message.active {
  opacity: 1;
  transform: translateY(0);
  animation: text-glow 3s infinite alternate;
}

@keyframes text-glow {
  0% { text-shadow: 0 0 5px rgba(209, 0, 0, 0.5); }
  100% { text-shadow: 0 0 15px rgba(209, 0, 0, 0.8), 0 0 30px rgba(209, 0, 0, 0.4); }
}

.intro-progress {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.intro-progress-bar {
  height: 100%;
  background: linear-gradient(to right, #d10000, #ff4747);
  width: 0;
  transition: width 0.3s ease;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(209, 0, 0, 0.7);
  animation: progress-glow 2s infinite alternate;
}

@keyframes progress-glow {
  0% { box-shadow: 0 0 5px rgba(209, 0, 0, 0.5); }
  100% { box-shadow: 0 0 12px rgba(209, 0, 0, 0.8); }
}

/* عناصر الخلفية المتحركة */
.intro-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.2;
  pointer-events: none;
}

/* موجات الخلفية الحمراء المتحركة */
.intro-overlay .wave {
  position: absolute;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(209, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0) 70%);
  border-radius: 40%;
  transform-origin: center center;
  filter: blur(60px);
  opacity: 0;
  pointer-events: none;
  animation: float-in-out 15s infinite ease-in-out;
  will-change: transform, opacity;
}

.intro-overlay .wave:nth-child(1) {
  top: 30%;
  left: 20%;
  animation-delay: 0s;
}

.intro-overlay .wave:nth-child(2) {
  top: 60%;
  left: 60%;
  width: 120%;
  height: 120%;
  animation-delay: -4s;
}

.intro-overlay .wave:nth-child(3) {
  top: 20%;
  left: 70%;
  width: 100%;
  height: 100%;
  animation-delay: -8s;
}

/* تأثير الـ glow للنص والشعار */
.intro-message.active,
.intro-logo.active {
  filter: drop-shadow(0 0 8px rgba(209, 0, 0, 0.3));
}

/* تعريف الحركات */
@keyframes float-in-out {
  0% { transform: scale(0.8) rotate(0deg); opacity: 0.2; }
  25% { transform: scale(1.0) rotate(45deg); opacity: 0.5; }
  50% { transform: scale(1.2) rotate(90deg); opacity: 0.2; }
  75% { transform: scale(1.0) rotate(135deg); opacity: 0.5; }
  100% { transform: scale(0.8) rotate(180deg); opacity: 0.2; }
}

/* تأثير توهج Apple */
.intro-overlay::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200vh; /* أكبر من أي شاشة لضمان التغطية الكاملة */
  height: 200vh;
  background: radial-gradient(circle, rgba(209, 0, 0, 0.18), transparent 70%);
  transform: translate(-50%, -50%);
  filter: blur(80px); /* زيادة تأثير الـ blur */
  pointer-events: none;
  animation: pulse 8s infinite ease-in-out;
  will-change: transform, opacity;
}

@keyframes pulse {
  0% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.8); }
  50% { opacity: 0.4; transform: translate(-50%, -50%) scale(1.2); }
  100% { opacity: 0.2; transform: translate(-50%, -50%) scale(0.8); }
}

/* زر تخطي العرض التقديمي */
.intro-skip-button {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(209,0,0,0.3);
  color: rgba(255,255,255,0.8);
  padding: 10px 20px;
  border-radius: 30px;
  font-family: 'Tajawal', sans-serif;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 10px rgba(209,0,0,0.2);
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.intro-skip-button:hover {
  background: rgba(209,0,0,0.3);
  border-color: rgba(209,0,0,0.4);
  transform: translateY(-2px);
}

.intro-skip-button:active {
  transform: translateY(0);
  background: rgba(209,0,0,0.5);
}

@media (max-width: 768px) {
  .intro-logo-container {
    width: 100px;
    height: 100px;
    margin-bottom: 30px;
  }
  
  .intro-message {
    font-size: 20px;
    padding: 0 20px;
  }
  
  .intro-skip-button {
    bottom: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 12px;
  }
}
