/**
 * PREMIUM 3D EFFECTS & ADVANCED ANIMATIONS
 * Ultra-modern 3D transformations and effects
 * $100k Website Quality
 */

/* ============================================
   ADVANCED 3D CARD SYSTEM
   ============================================ */

.card-3d {
  position: relative;
  transform-style: preserve-3d;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
}

.card-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.1) 0%,
    rgba(0, 208, 132, 0.05) 100%
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: -1;
}

.card-3d:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(5deg) translateY(-10px) scale(1.02);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(212, 175, 55, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-3d:hover::before {
  opacity: 1;
}

/* Layered 3D Effect */
.card-3d-layered {
  position: relative;
  transform-style: preserve-3d;
}

.card-3d-layered::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 208, 132, 0.1));
  border-radius: inherit;
  transform: translateZ(-50px);
  opacity: 0.5;
  z-index: -1;
}

/* ============================================
   3D FLIP CARDS
   ============================================ */

.flip-card {
  perspective: 1500px;
  width: 100%;
  height: 100%;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
}

.flip-card-back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 208, 132, 0.1));
}

/* ============================================
   3D DEPTH LAYERS
   ============================================ */

.depth-layer-1 {
  transform: translateZ(20px);
}

.depth-layer-2 {
  transform: translateZ(40px);
}

.depth-layer-3 {
  transform: translateZ(60px);
}

.depth-container {
  transform-style: preserve-3d;
  perspective: 1000px;
}

/* ============================================
   HOLOGRAPHIC EFFECT
   ============================================ */

.holographic {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(212, 175, 55, 0.1) 0%,
    rgba(0, 208, 132, 0.1) 25%,
    rgba(74, 144, 226, 0.1) 50%,
    rgba(236, 72, 153, 0.1) 75%,
    rgba(212, 175, 55, 0.1) 100%
  );
  background-size: 400% 400%;
  animation: holographicShift 8s ease infinite;
}

.holographic::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(212, 175, 55, 0.5),
    transparent
  );
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: -1;
}

.holographic:hover::before {
  opacity: 1;
  animation: holographicSpin 2s linear infinite;
}

@keyframes holographicShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes holographicSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   FLOATING 3D ELEMENTS
   ============================================ */

.float-3d {
  animation: float3d 6s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes float3d {
  0%, 100% {
    transform: translateY(0) rotateX(0deg) rotateY(0deg);
  }
  25% {
    transform: translateY(-20px) rotateX(5deg) rotateY(5deg);
  }
  50% {
    transform: translateY(0) rotateX(-5deg) rotateY(-5deg);
  }
  75% {
    transform: translateY(-10px) rotateX(3deg) rotateY(3deg);
  }
}

/* ============================================
   NEON GLOW 3D
   ============================================ */

.neon-glow-3d {
  position: relative;
  text-shadow: 
    0 0 10px rgba(212, 175, 55, 0.8),
    0 0 20px rgba(212, 175, 55, 0.6),
    0 0 30px rgba(212, 175, 55, 0.4),
    0 0 40px rgba(212, 175, 55, 0.2);
  animation: neonPulse 2s ease-in-out infinite;
}

@keyframes neonPulse {
  0%, 100% {
    text-shadow: 
      0 0 10px rgba(212, 175, 55, 0.8),
      0 0 20px rgba(212, 175, 55, 0.6),
      0 0 30px rgba(212, 175, 55, 0.4);
  }
  50% {
    text-shadow: 
      0 0 20px rgba(212, 175, 55, 1),
      0 0 30px rgba(212, 175, 55, 0.8),
      0 0 40px rgba(212, 175, 55, 0.6),
      0 0 50px rgba(212, 175, 55, 0.4);
  }
}

/* ============================================
   ISOMETRIC 3D BUTTONS
   ============================================ */

.btn-3d {
  position: relative;
  transform-style: preserve-3d;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-3d::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
  border-radius: inherit;
  transform: translateZ(20px);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-3d:hover {
  transform: translateY(-5px) translateZ(10px);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(212, 175, 55, 0.5);
}

.btn-3d:hover::before {
  opacity: 1;
}

.btn-3d:active {
  transform: translateY(-2px) translateZ(5px);
}

/* ============================================
   MORPHING SHAPES
   ============================================ */

.morph-shape {
  animation: morphShape 8s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes morphShape {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(0deg);
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%;
    transform: rotate(180deg);
  }
  75% {
    border-radius: 60% 40% 60% 40% / 70% 30% 50% 60%;
  }
}

/* ============================================
   PARALLAX 3D CARDS
   ============================================ */

.parallax-card {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out;
}

.parallax-card .parallax-layer {
  transition: transform 0.1s ease-out;
}

.parallax-card:hover .parallax-layer-1 {
  transform: translateZ(30px);
}

.parallax-card:hover .parallax-layer-2 {
  transform: translateZ(60px);
}

.parallax-card:hover .parallax-layer-3 {
  transform: translateZ(90px);
}

/* ============================================
   GLASS REFLECTION 3D
   ============================================ */

.glass-reflection-3d {
  position: relative;
  overflow: hidden;
}

.glass-reflection-3d::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transform: skewX(-20deg);
  animation: glassReflection 3s infinite;
}

@keyframes glassReflection {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

/* ============================================
   STACKED CARDS 3D
   ============================================ */

.card-stack {
  position: relative;
  transform-style: preserve-3d;
}

.card-stack-item {
  position: absolute;
  width: 100%;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-stack:hover .card-stack-item:nth-child(1) {
  transform: translateY(-20px) translateZ(60px) rotateX(5deg);
}

.card-stack:hover .card-stack-item:nth-child(2) {
  transform: translateY(-10px) translateZ(30px) rotateX(3deg);
}

.card-stack:hover .card-stack-item:nth-child(3) {
  transform: translateY(0) translateZ(0) rotateX(0deg);
}

/* ============================================
   RIBBON 3D
   ============================================ */

.ribbon-3d {
  position: absolute;
  top: 20px;
  right: -5px;
  background: linear-gradient(135deg, var(--primary-gold), var(--gold-light));
  color: var(--primary-dark);
  padding: 8px 20px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transform: rotate(45deg) translateX(30px) translateY(-10px);
  z-index: 10;
}

.ribbon-3d::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: -5px;
  border-left: 5px solid var(--gold-dark);
  border-bottom: 5px solid transparent;
}

/* ============================================
   PERSPECTIVE GRID
   ============================================ */

.perspective-grid {
  perspective: 1000px;
  transform-style: preserve-3d;
}

.grid-item-3d {
  transform-style: preserve-3d;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.grid-item-3d:hover {
  transform: translateZ(50px) scale(1.05);
  z-index: 10;
}

/* ============================================
   LIQUID BUTTON EFFECT
   ============================================ */

.btn-liquid {
  position: relative;
  overflow: hidden;
}

.btn-liquid::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-liquid:hover::before {
  width: 300px;
  height: 300px;
  animation: liquidRipple 1s ease-out;
}

@keyframes liquidRipple {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* ============================================
   ROTATING BORDER 3D
   ============================================ */

.rotating-border-3d {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
}

.rotating-border-3d::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--primary-gold),
    var(--accent-green),
    var(--accent-blue),
    var(--primary-gold)
  );
  border-radius: inherit;
  z-index: -1;
  animation: rotateBorder 4s linear infinite;
  background-size: 300% 300%;
}

@keyframes rotateBorder {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

/* ============================================
   DIAMOND SHINE EFFECT
   ============================================ */

.diamond-shine {
  position: relative;
  overflow: hidden;
}

.diamond-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 70%
  );
  transform: rotate(45deg);
  animation: diamondShine 3s infinite;
}

@keyframes diamondShine {
  0% {
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
  }
  100% {
    transform: translateX(100%) translateY(100%) rotate(45deg);
  }
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  .card-3d:hover {
    transform: perspective(1000px) translateY(-5px) scale(1.01);
  }
  
  .float-3d {
    animation: none;
  }
  
  .glass-reflection-3d::after {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .float-3d,
  .morph-shape,
  .holographic,
  .neon-glow-3d,
  .glass-reflection-3d::after,
  .diamond-shine::after,
  .rotating-border-3d::before {
    animation: none !important;
  }
}
