/* ===================================================================
   NOTCH Premium Effects - Styles
   =================================================================== */

/* =================================================================
   1. SCROLL PROGRESS BAR
   ================================================================= */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 99999;
  pointer-events: none;
}

.scroll-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--notch-accent, #153F34), #1a5544);
  width: 0%;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--notch-accent, #153F34);
}

/* =================================================================
   2. SMOOTH SCROLL ANIMATIONS
   ================================================================= */
[data-animate] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

[data-animate].animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* تأخيرات مختلفة للعناصر المتتالية */
[data-animate]:nth-child(1).animate-in { transition-delay: 0s; }
[data-animate]:nth-child(2).animate-in { transition-delay: 0.1s; }
[data-animate]:nth-child(3).animate-in { transition-delay: 0.2s; }
[data-animate]:nth-child(4).animate-in { transition-delay: 0.3s; }
[data-animate]:nth-child(5).animate-in { transition-delay: 0.4s; }

/* =================================================================
   3. LOADING ANIMATION
   ================================================================= */
.notch-loader {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.notch-loader.loaded {
  opacity: 0;
  pointer-events: none;
}

.notch-loader-content {
  text-align: center;
}

.notch-loader-logo {
  width: 180px;
  height: 180px;
  margin: 0 auto 30px;
  animation: logoFadeIn 2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  opacity: 0;
}

@keyframes logoFadeIn {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

.notch-loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto;
}

.notch-loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--notch-accent, #153F34), #1a5544);
  width: 0%;
  animation: loaderFill 2s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
  box-shadow: 0 0 10px var(--notch-accent, #153F34);
}

@keyframes loaderFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* =================================================================
   4. CURSOR EFFECTS (PC only) - معطّل
   ================================================================= */
/* معطّل - الماوس العادي مرجّع
@media (min-width: 1024px) {
  body {
    cursor: none;
  }
  
  a, button, .btn, .badge, input, textarea {
    cursor: none !important;
  }

  .custom-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(21, 63, 52, 0.5);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99998;
    transition: transform 0.2s ease, border-color 0.2s ease;
    transform: translate(-50%, -50%);
  }

  .custom-cursor.active {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: var(--notch-accent, #153F34);
  }

  .custom-cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: var(--notch-accent, #153F34);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
  }
}
*/

/* إخفاء على الجوال */
@media (max-width: 1023px) {
  .custom-cursor,
  .custom-cursor-dot {
    display: none !important;
  }
}

/* =================================================================
   5. PARALLAX EFFECT
   ================================================================= */
.hero,
.slide,
.about-hero {
  overflow: hidden;
}

.hero img,
.slide-img,
.about-hero {
  will-change: transform;
  transition: transform 0.1s linear;
}

/* =================================================================
   6. MAGNETIC BUTTONS
   ================================================================= */
@media (min-width: 1024px) {
  .btn,
  a.badge,
  .project-card {
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1),
                box-shadow 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) !important;
  }
}

/* =================================================================
   7. TEXT REVEAL ANIMATION
   ================================================================= */
.reveal-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: revealChar 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes revealChar {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =================================================================
   8. PAGE TRANSITIONS - مع لوقو التحميل الكامل
   ================================================================= */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  display: none; /* hidden by default */
  align-items: center;
  justify-content: center;
}

.page-transition-overlay.active {
  opacity: 1;
  pointer-events: auto;
  display: flex;
}

/* Fully hide when aria-hidden is true */
.page-transition-overlay[aria-hidden="true"] {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.page-transition-content {
  text-align: center;
}

.page-transition-logo {
  width: 140px;
  height: 140px;
  max-width: min(40vw, 220px);
  max-height: min(40vw, 220px);
  margin: 0 auto 24px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s,
              transform 1.8s cubic-bezier(0.22, 0.61, 0.36, 1) 0.1s;
  object-fit: contain;
  /* force white logo on dark transition overlay */
  filter: invert(1) brightness(1.1);
}

/* Safety: never exceed viewport
   and avoid huge render on layout glitches */
.page-transition-content img.page-transition-logo {
  display: block;
}

.page-transition-overlay.active .page-transition-logo {
  opacity: 1;
  transform: scale(1);
}

.page-transition-bar {
  width: 180px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.22, 0.61, 0.36, 1) 0.3s;
}

.page-transition-overlay.active .page-transition-bar {
  opacity: 1;
}

.page-transition-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--notch-accent, #153F34), #1a5544);
  width: 0%;
  transition: width 2.2s cubic-bezier(0.22, 0.61, 0.36, 1);
  box-shadow: 0 0 10px var(--notch-accent, #153F34);
}

.page-transition-overlay.active .page-transition-fill {
  width: 100%;
}

/* =================================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .scroll-progress-fill,
  [data-animate],
  .reveal-char,
  .custom-cursor,
  .hero img,
  .slide-img {
    animation: none !important;
    transition: none !important;
  }
}

/* تحسينات للأداء */
.hero img,
.slide-img,
[data-animate],
.custom-cursor,
.custom-cursor-dot {
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  perspective: 1000px;
  -webkit-perspective: 1000px;
}
