/* AmkyawDev - 3D Effects CSS */

/* 3D Card Styles */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.card-3d:hover {
    transform: rotateY(10deg) rotateX(10deg);
}

.card-3d-front,
.card-3d-back {
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

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

/* 3D Tilt Effect */
.tilt-effect {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

/* Floating Animation */
@keyframes float3d {
    0%, 100% {
        transform: translateY(0) rotateX(0) rotateY(0);
    }
    25% {
        transform: translateY(-10px) rotateX(5deg) rotateY(5deg);
    }
    50% {
        transform: translateY(-5px) rotateX(-5deg) rotateY(-5deg);
    }
    75% {
        transform: translateY(-15px) rotateX(3deg) rotateY(-3deg);
    }
}

.float-3d {
    animation: float3d 6s ease-in-out infinite;
}

/* 3D Grid Background */
.grid-3d {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(79, 70, 229, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    transform-origin: center top;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 0 50px;
    }
}

/* Perspective Container */
.perspective-container {
    perspective: 1000px;
    overflow: hidden;
}

/* 3D Transform Classes */
.transform-3d {
    transform-style: preserve-3d;
}

.translate-z-10 {
    transform: translateZ(10px);
}

.translate-z-20 {
    transform: translateZ(20px);
}

.translate-z-50 {
    transform: translateZ(50px);
}

/* Glow Effects */
.glow-primary {
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.5),
                0 0 40px rgba(79, 70, 229, 0.3),
                0 0 60px rgba(79, 70, 229, 0.1);
}

.glow-secondary {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5),
                0 0 40px rgba(16, 185, 129, 0.3),
                0 0 60px rgba(16, 185, 129, 0.1);
}

.glow-accent {
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.5),
                0 0 40px rgba(245, 158, 11, 0.3),
                0 0 60px rgba(245, 158, 11, 0.1);
}

/* Parallax Layers */
.parallax-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.1s ease-out;
}

.parallax-layer-1 {
    z-index: 1;
}

.parallax-layer-2 {
    z-index: 2;
}

.parallax-layer-3 {
    z-index: 3;
}

/* 3D Button */
.btn-3d {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.btn-3d::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    transform: rotateX(-90deg);
    transform-origin: top;
    border-radius: inherit;
}

.btn-3d:hover {
    transform: rotateX(15deg) translateY(-5px);
}

/* Card Stack 3D */
.card-stack {
    position: relative;
}

.card-stack .card {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: all 0.5s ease;
}

.card-stack .card:nth-child(1) {
    transform: translateZ(0) rotate(0deg);
    z-index: 3;
}

.card-stack .card:nth-child(2) {
    transform: translateZ(-10px) rotate(2deg);
    z-index: 2;
}

.card-stack .card:nth-child(3) {
    transform: translateZ(-20px) rotate(4deg);
    z-index: 1;
}

.card-stack:hover .card:nth-child(1) {
    transform: translateZ(20px) rotate(-5deg);
}

.card-stack:hover .card:nth-child(2) {
    transform: translateZ(10px) rotate(0deg);
}

.card-stack:hover .card:nth-child(3) {
    transform: translateZ(0) rotate(-2deg);
}

/* Cube 3D */
.cube-3d {
    width: 100px;
    height: 100px;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 10s linear infinite;
}

.cube-face {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary-color);
    background: rgba(79, 70, 229, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cube-face.front {
    transform: translateZ(50px);
}

.cube-face.back {
    transform: translateZ(-50px) rotateY(180deg);
}

.cube-face.right {
    transform: translateX(50px) rotateY(90deg);
}

.cube-face.left {
    transform: translateX(-50px) rotateY(-90deg);
}

.cube-face.top {
    transform: translateY(-50px) rotateX(90deg);
}

.cube-face.bottom {
    transform: translateY(50px) rotateX(-90deg);
}

@keyframes cubeRotate {
    from {
        transform: rotateX(0deg) rotateY(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

/* Sphere Effect */
.sphere-3d {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, 
        rgba(79, 70, 229, 0.8), 
        rgba(79, 70, 229, 0.4),
        rgba(79, 70, 229, 0.1));
    box-shadow: 
        inset -20px -20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(79, 70, 229, 0.5);
    animation: spherePulse 3s ease-in-out infinite;
}

@keyframes spherePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            inset -20px -20px 40px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(79, 70, 229, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            inset -25px -25px 50px rgba(0, 0, 0, 0.3),
            0 0 50px rgba(79, 70, 229, 0.7);
    }
}

/* Rotate 3D */
.rotate-3d {
    animation: rotate3d 10s linear infinite;
}

@keyframes rotate3d {
    from {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    to {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

/* 3D Flip Card */
.flip-card {
    width: 300px;
    height: 200px;
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
}

.flip-card-front {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.flip-card-back {
    background: var(--gradient-primary);
    transform: rotateY(180deg);
}

/* Wave 3D */
.wave-3d {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, 
        rgba(79, 70, 229, 0.3) 0%, 
        transparent 70%);
    animation: waveExpand 4s ease-out infinite;
}

@keyframes waveExpand {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Particle Effect Placeholder */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.5;
    animation: particleFloat 10s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Hover 3D Lift */
.hover-lift-3d {
    transition: all 0.4s ease;
    transform-style: preserve-3d;
}

.hover-lift-3d:hover {
    transform: translateY(-20px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* Shutter Effect */
.shutter-3d {
    position: relative;
    overflow: hidden;
}

.shutter-3d::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.shutter-3d:hover::after {
    transform: scaleX(1);
}

.shutter-3d:hover .shutter-content {
    color: var(--white);
}

.shutter-content {
    position: relative;
    z-index: 1;
    transition: color 0.5s ease;
}

/* Responsive 3D */
@media (max-width: 768px) {
    .cube-3d {
        width: 60px;
        height: 60px;
    }
    
    .cube-face {
        width: 60px;
        height: 60px;
    }
    
    .cube-face.front {
        transform: translateZ(30px);
    }
    
    .cube-face.back {
        transform: translateZ(-30px) rotateY(180deg);
    }
    
    .cube-face.right {
        transform: translateX(30px) rotateY(90deg);
    }
    
    .cube-face.left {
        transform: translateX(-30px) rotateY(-90deg);
    }
    
    .cube-face.top {
        transform: translateY(-30px) rotateX(90deg);
    }
    
    .cube-face.bottom {
        transform: translateY(30px) rotateX(-90deg);
    }
    
    .sphere-3d {
        width: 150px;
        height: 150px;
    }
}