/* 3D Effects and Animation Styles */

/* --- 3D Text --- */
.text-3d {
  text-shadow:
    0 1px 0 #ccc,
    0 2px 0 #c9c9c9,
    0 3px 0 #bbb,
    0 4px 0 #b9b9b9,
    0 5px 0 #aaa,
    0 6px 1px rgba(0, 0, 0, 0.1),
    0 0 5px rgba(0, 0, 0, 0.1),
    0 1px 3px rgba(0, 0, 0, 0.3),
    0 3px 5px rgba(0, 0, 0, 0.2),
    0 5px 10px rgba(0, 0, 0, 0.25),
    0 10px 10px rgba(0, 0, 0, 0.2),
    0 20px 20px rgba(0, 0, 0, 0.15);
}

.dark .text-3d {
  text-shadow:
    0 1px 0 #555,
    0 2px 0 #444,
    0 3px 0 #333,
    0 4px 0 #222,
    0 5px 0 #111,
    0 6px 1px rgba(0, 0, 0, 0.3),
    0 0 5px rgba(0, 0, 0, 0.3),
    0 1px 3px rgba(0, 0, 0, 0.4),
    0 3px 5px rgba(0, 0, 0, 0.3),
    0 5px 10px rgba(0, 0, 0, 0.35),
    0 10px 10px rgba(0, 0, 0, 0.3),
    0 20px 20px rgba(0, 0, 0, 0.25);
}

/* --- 3D Cards --- */
.card-3d {
  transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform-style: preserve-3d;
  perspective: 1000px;
}

.card-3d:hover {
  transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.2);
}

/* --- 3D Buttons --- */
.btn-3d {
  position: relative;
  transition: all 0.3s ease;
  transform-style: preserve-3d;
  transform: translateZ(0);
}

.btn-3d:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(5px) translateZ(-1px);
  filter: blur(10px);
  opacity: 0;
  transition: all 0.3s ease;
  border-radius: inherit;
}

.btn-3d:hover {
  transform: translateY(-2px) translateZ(0) scale(1.02);
}

.btn-3d:hover:before {
  opacity: 1;
  transform: translateY(8px) translateZ(-1px);
}

.btn-3d:active {
  transform: translateY(0) translateZ(0) scale(0.98);
}

/* --- 3D Floating Elements --- */
.float-3d {
  animation: float-3d 6s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes float-3d {
  0% {
    transform: translateY(0px) translateZ(0);
  }
  50% {
    transform: translateY(-20px) translateZ(20px) rotateX(10deg) rotateY(10deg);
  }
  100% {
    transform: translateY(0px) translateZ(0);
  }
}

/* --- 3D Image Container --- */
.image-3d-container {
  perspective: 1000px;
  overflow: hidden;
  transition: all 0.5s ease;
}

.hover-3d {
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}

.hover-3d:hover {
  transform: rotateX(5deg) rotateY(5deg) scale(1.05);
}

.image-3d {
  transition: transform 0.5s ease;
}

.image-3d-container:hover .image-3d {
  transform: translateZ(20px);
}

/* --- Flip Cards --- */
.flip-card-container {
  perspective: 1000px;
  height: 320px;
}

.flip-card {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* --- Animations --- */
@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fade-in 1s ease forwards;
}

.animate-fade-in-delay {
  animation: fade-in 1s ease 0.5s forwards;
  opacity: 0;
}

@keyframes slide-up {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-up {
  animation: slide-up 1s ease forwards;
}

.animate-slide-up-stagger-1 {
  animation: slide-up 1s ease 0.1s forwards;
  opacity: 0;
  transform: translateY(50px);
}

.animate-slide-up-stagger-2 {
  animation: slide-up 1s ease 0.3s forwards;
  opacity: 0;
  transform: translateY(50px);
}

.animate-slide-up-stagger-3 {
  animation: slide-up 1s ease 0.5s forwards;
  opacity: 0;
  transform: translateY(50px);
}

@keyframes slide-right {
  0% {
    opacity: 0;
    transform: translateX(-50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-right {
  animation: slide-right 1s ease forwards;
}

@keyframes slide-left {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-left {
  animation: slide-left 1s ease forwards;
}
