/* ==========================================================================
   Ahmed Mohamed Zaki - High-End Animated Data Portfolio Styling
   Aesthetics: Deep Space Dark, Neon Cyber Accents, Fluid Glassmorphism, Micro-Interactions
   ========================================================================== */

@layer utilities {
  .grid-pattern {
    background-size: 50px 50px;
    background-image: 
      linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
}
::-webkit-scrollbar-track {
  background: #0B0F19;
}
::-webkit-scrollbar-thumb {
  background: #1F2937;
  border-radius: 9999px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}
::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* --------------------------------------------------
   Scroll Reveal System (IntersectionObserver)
   -------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(35px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* --------------------------------------------------
   Vercel / Linear Spotlight Hover Glow
   -------------------------------------------------- */
.spotlight-card {
  position: relative;
  overflow: hidden;
  background-color: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(31, 41, 55, 0.8);
  transition: border-color 0.4s ease, transform 0.3s ease, box-shadow 0.4s ease;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(16, 185, 129, 0.35),
    rgba(6, 182, 212, 0.15) 30%,
    transparent 60%
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.spotlight-card:hover::before {
  opacity: 1;
}

.spotlight-card:hover {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 20px -5px rgba(16, 185, 129, 0.15);
}

/* --------------------------------------------------
   Glowing Shimmer Badges & Gradients
   -------------------------------------------------- */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.animate-shimmer {
  background: linear-gradient(
    90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3.5s infinite;
}

/* Smooth Floating Elements */
@keyframes floatSlow {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1deg);
  }
}

@keyframes floatReverse {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(10px) rotate(-1deg);
  }
}

.animate-float-slow {
  animation: floatSlow 5s ease-in-out infinite;
}

.animate-float-reverse {
  animation: floatReverse 6s ease-in-out infinite;
}

/* --------------------------------------------------
   Text Gradient Animation
   -------------------------------------------------- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.text-gradient-animated {
  background: linear-gradient(135deg, #10b981, #06b6d4, #3b82f6, #10b981);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
}

/* --------------------------------------------------
   Typewriter Caret Pulse
   -------------------------------------------------- */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 1.15em;
  background-color: #10b981;
  margin-left: 4px;
  vertical-align: middle;
  animation: cursorBlink 0.8s infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --------------------------------------------------
   Navbar Scrolled Glass Effect
   -------------------------------------------------- */
.scrolled-nav {
  background-color: rgba(11, 15, 25, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid rgba(31, 41, 55, 0.8) !important;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* --------------------------------------------------
   3D Tilt Container
   -------------------------------------------------- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

/* Interactive Ripple for Buttons */
.btn-glow {
  position: relative;
  transition: all 0.3s ease;
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.35);
}
