/* ============================================
   3D-EFFECTS.CSS
   3D Transforms, Glassmorphism, Depth, Parallax
   ============================================ */

/* ===== PERSPECTIVE & 3D CONTEXT ===== */
.perspective-container {
  perspective: 1200px;
  perspective-origin: center center;
}

.preserve-3d {
  transform-style: preserve-3d;
}

/* ===== GLASSMORPHISM ===== */
.glassmorphism {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(10, 110, 138, 0.1);
}

.glassmorphism::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  border-radius: inherit;
  pointer-events: none;
}

/* ===== 3D HERO SECTION ===== */
.hero-3d {
  perspective: 1200px;
  transform-style: preserve-3d;
  position: relative;
  overflow: hidden;
}

.hero-3d-layer {
  transform: translateZ(40px);
}

.hero-3d-layer--deep {
  transform: translateZ(-20px) scale(1.1);
}

.hero-3d-layer--deeper {
  transform: translateZ(-40px) scale(1.2);
}

/* ===== FLOATING ANIMATION ===== */
@keyframes float3D {
  0%, 100% {
    transform: translateY(0px) rotateX(0deg) rotateZ(0deg);
  }
  25% {
    transform: translateY(-15px) rotateX(5deg) rotateZ(2deg);
  }
  50% {
    transform: translateY(-30px) rotateX(0deg) rotateZ(-2deg);
  }
  75% {
    transform: translateY(-15px) rotateX(-5deg) rotateZ(2deg);
  }
}

.floating {
  animation: float3D 6s ease-in-out infinite;
}

.floating--delay-1 {
  animation-delay: 0.2s;
}

.floating--delay-2 {
  animation-delay: 0.4s;
}

.floating--delay-3 {
  animation-delay: 0.6s;
}

/* ===== ROTATING 3D CUBE ===== */
@keyframes rotate3D {
  from {
    transform: rotateX(0deg) rotateY(0deg);
  }
  to {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

.cube-3d {
  animation: rotate3D 20s linear infinite;
  transform-style: preserve-3d;
}

/* ===== NEON GLOW EFFECTS ===== */
.glow-neon {
  box-shadow: 0 0 20px rgba(18, 163, 196, 0.4),
              0 0 40px rgba(18, 163, 196, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glow-neon:hover {
  box-shadow: 0 0 30px rgba(18, 163, 196, 0.6),
              0 0 60px rgba(18, 163, 196, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.glow-accent {
  box-shadow: 0 0 20px rgba(244, 166, 35, 0.4),
              0 0 40px rgba(244, 166, 35, 0.2);
}

.glow-accent:hover {
  box-shadow: 0 0 30px rgba(244, 166, 35, 0.6),
              0 0 60px rgba(244, 166, 35, 0.3);
}

.glow-green {
  box-shadow: 0 0 20px rgba(39, 174, 96, 0.4),
              0 0 40px rgba(39, 174, 96, 0.2);
}

/* ===== DEPTH & SHADOW LAYERS ===== */
.depth-1 {
  box-shadow: 0 5px 15px rgba(10, 110, 138, 0.1);
}

.depth-2 {
  box-shadow: 0 10px 30px rgba(10, 110, 138, 0.15);
}

.depth-3 {
  box-shadow: 0 15px 45px rgba(10, 110, 138, 0.2);
}

.depth-4 {
  box-shadow: 0 20px 60px rgba(10, 110, 138, 0.25);
}

.depth-5 {
  box-shadow: 0 25px 75px rgba(10, 110, 138, 0.3);
}

/* ===== LAYERED DEPTH BACKGROUND ===== */
.section-depth {
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(10, 110, 138, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse at 80% 20%, rgba(18, 163, 196, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse at 50% 100%, rgba(244, 166, 35, 0.03) 0%, transparent 70%),
    var(--color-off-white);
  position: relative;
}

.section-depth::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(10, 110, 138, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 110, 138, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
}

/* ===== MESH GRADIENT BACKGROUND ===== */
.mesh-bg {
  background-image: 
    linear-gradient(rgba(10, 110, 138, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(10, 110, 138, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ===== PARALLAX EFFECT ===== */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-layer {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.parallax-layer--bg {
  transform: translateZ(-1px) scale(1.5);
}

.parallax-layer--mid {
  transform: translateZ(0px);
}

.parallax-layer--fg {
  transform: translateZ(1px) scale(0.5);
}

/* ===== 3D TILT EFFECT (Vanilla Tilt) ===== */
.tilt-card {
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

/* Applied via JavaScript: VanillaTilt */
.tilt-card:hover {
  box-shadow: var(--shadow-hover);
}

/* ===== FLIP CARD EFFECT ===== */
@keyframes flipY {
  0% {
    transform: perspective(1000px) rotateY(0deg);
  }
  100% {
    transform: perspective(1000px) rotateY(360deg);
  }
}

.flip-card {
  transform-style: preserve-3d;
  transition: transform 0.6s;
  position: relative;
}

.flip-card:hover {
  transform: perspective(1000px) rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ===== ROTATE ON HOVER ===== */
.rotate-hover {
  transition: transform var(--transition-base);
}

.rotate-hover:hover {
  transform: rotate(5deg) scale(1.05);
}

.rotate-hover-reverse:hover {
  transform: rotate(-5deg) scale(1.05);
}

/* ===== SCALE & LIFT EFFECTS ===== */
.lift-hover {
  transition: all var(--transition-base);
  transform: translateZ(0);
}

.lift-hover:hover {
  transform: translateY(-10px) translateZ(0);
  box-shadow: var(--shadow-hover);
}

.scale-hover {
  transition: transform var(--transition-fast);
}

.scale-hover:hover {
  transform: scale(1.05);
}

.scale-hover-sm:hover {
  transform: scale(1.02);
}

.scale-hover-lg:hover {
  transform: scale(1.1);
}

/* ===== BLUR & FOCUS EFFECTS ===== */
.blur-on-scroll {
  transition: backdrop-filter var(--transition-base);
}

.blur-on-scroll.blurred {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

/* ===== MORPH EFFECT ===== */
@keyframes morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  50% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
}

.morph {
  animation: morph 8s ease-in-out infinite;
}

/* ===== GRADIENT ANIMATION ===== */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* ===== RIPPLE EFFECT ===== */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ripple:active::after {
  animation: ripple 0.6s ease-out;
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.pulse-ring {
  position: relative;
}

.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -8px;
  border: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: pulse-ring 2s ease-in-out infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* ===== SHIMMER EFFECT ===== */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.shimmer {
  background: linear-gradient(90deg, 
    var(--color-light-gray) 25%,
    rgba(255, 255, 255, 0.5) 50%,
    var(--color-light-gray) 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* ===== BLUR IN/OUT ANIMATION ===== */
@keyframes blurIn {
  from {
    filter: blur(10px);
    opacity: 0;
  }
  to {
    filter: blur(0);
    opacity: 1;
  }
}

@keyframes blurOut {
  from {
    filter: blur(0);
    opacity: 1;
  }
  to {
    filter: blur(10px);
    opacity: 0;
  }
}

.blur-in {
  animation: blurIn 0.6s ease-out;
}

.blur-out {
  animation: blurOut 0.6s ease-out;
}

/* ===== SPOTLIGHT EFFECT ===== */
.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

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

/* ===== MATRIX RAIN EFFECT ===== */
@keyframes matrixRain {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh);
    opacity: 0;
  }
}

.matrix-text {
  animation: matrixRain 8s linear infinite;
}

/* ===== TEXT REVEAL EFFECT ===== */
@keyframes textReveal {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 0 0 0);
  }
}

.text-reveal {
  animation: textReveal 0.8s ease-out;
}

/* ===== BORDER ANIMATION ===== */
@keyframes borderFlow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.border-gradient {
  background: linear-gradient(90deg, 
    var(--color-primary),
    var(--color-accent),
    var(--color-primary));
  background-size: 200% 100%;
  animation: borderFlow 3s ease infinite;
  border-radius: var(--radius-card);
  padding: 2px;
}

.border-gradient > * {
  background: var(--color-white);
  border-radius: calc(var(--radius-card) - 2px);
}
