/* ========================================
   ÁLBUM MODERNO - 3D COMPONENTS
   CSS 3D Transformations & Effects
   ======================================== */

/* ========== 3D CUBE LOADING ========== */
.loading-3d-cube {
    perspective: 1000px;
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-8);
}

.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    animation: cubeRotate 4s ease-in-out infinite;
}

.cube-face {
    position: absolute;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-3xl);
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.cube-face.front  { transform: rotateY(0deg) translateZ(50px); color: #6366f1; }
.cube-face.back   { transform: rotateY(180deg) translateZ(50px); color: #ec4899; }
.cube-face.right  { transform: rotateY(90deg) translateZ(50px); color: #a855f7; }
.cube-face.left   { transform: rotateY(-90deg) translateZ(50px); color: #0ea5e9; }
.cube-face.top    { transform: rotateX(90deg) translateZ(50px); color: #f59e0b; }
.cube-face.bottom { transform: rotateX(-90deg) translateZ(50px); color: #10b981; }

@keyframes cubeRotate {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    25% { transform: rotateX(90deg) rotateY(90deg); }
    50% { transform: rotateX(180deg) rotateY(180deg); }
    75% { transform: rotateX(270deg) rotateY(270deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* ========== 3D CARD EFFECTS ========== */
.card-3d {
    position: relative;
    perspective: 1500px;
    transform-style: preserve-3d;
}

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

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

.card-3d-front,
.card-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

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

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

.tilt-3d-content {
    transform: translateZ(50px);
    transition: transform 0.3s ease;
}

.tilt-3d:hover .tilt-3d-content {
    transform: translateZ(80px);
}

/* Tilt Container */
.tilt-container {
    position: relative;
    transform-style: preserve-3d;
    perspective: 2000px;
}

.tilt-card {
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg);
    transition: transform 0.1s ease-out, box-shadow 0.3s ease;
}

.tilt-card:hover {
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.tilt-card .tilt-inner {
    transform: translateZ(30px);
}

.tilt-card .tilt-icon {
    transform: translateZ(60px);
}

/* ========== 3D FLOATING ELEMENTS ========== */
.float-3d {
    position: relative;
    transform-style: preserve-3d;
    animation: float3D 6s ease-in-out infinite;
}

@keyframes float3D {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
    25% {
        transform: translateY(-10px) rotateX(3deg) rotateY(-3deg);
    }
    50% {
        transform: translateY(-20px) rotateX(-3deg) rotateY(3deg);
    }
    75% {
        transform: translateY(-10px) rotateX(2deg) rotateY(-2deg);
    }
}

/* Floating Badge */
.floating-badge-3d {
    position: absolute;
    transform-style: preserve-3d;
    animation: floatBadge 4s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% {
        transform: translateZ(20px) translateY(0);
    }
    50% {
        transform: translateZ(40px) translateY(-10px);
    }
}

/* ========== 3D BUTTON EFFECTS ========== */
.btn-3d {
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1000px) translateZ(0);
    transition: transform 0.3s ease;
}

.btn-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: inherit;
    transform: translateZ(-10px);
    filter: brightness(0.7);
}

.btn-3d:hover {
    transform: perspective(1000px) translateZ(10px);
}

.btn-3d:active {
    transform: perspective(1000px) translateZ(-5px);
}

/* Push Button 3D */
.btn-push-3d {
    position: relative;
    background: var(--primary-gradient);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-8);
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 6px 0 var(--primary-dark);
    transition: all 0.1s ease;
}

.btn-push-3d:hover {
    box-shadow: 0 4px 0 var(--primary-dark);
    transform: translateY(2px);
}

.btn-push-3d:active {
    box-shadow: 0 0 0 var(--primary-dark);
    transform: translateY(6px);
}

/* ========== 3D IMAGE STACK ========== */
.image-stack-3d {
    position: relative;
    width: 300px;
    height: 400px;
    perspective: 1000px;
    transform-style: preserve-3d;
}

.stack-item {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-2xl);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

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

.stack-item:nth-child(2) {
    z-index: 2;
    transform: translateZ(-20px) translateX(20px) rotate(3deg);
}

.stack-item:nth-child(3) {
    z-index: 1;
    transform: translateZ(-40px) translateX(40px) rotate(-8deg);
}

.image-stack-3d:hover .stack-item:nth-child(1) {
    transform: translateZ(50px) rotate(-10deg) translateX(-30px);
}

.image-stack-3d:hover .stack-item:nth-child(2) {
    transform: translateZ(25px) translateX(0px) rotate(5deg);
}

.image-stack-3d:hover .stack-item:nth-child(3) {
    transform: translateZ(0) translateX(30px) rotate(-5deg);
}

/* ========== 3D GALLERY ITEM ========== */
.gallery-item-3d {
    position: relative;
    transform-style: preserve-3d;
    perspective: 2000px;
}

.gallery-item-3d .gallery-image {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.gallery-item-3d:hover .gallery-image {
    transform: rotateX(-5deg) rotateY(5deg) translateZ(20px);
}

.gallery-item-3d .gallery-overlay {
    transform: translateZ(30px);
}

/* ========== 3D TEXT EFFECTS ========== */
.text-3d {
    position: relative;
    transform-style: preserve-3d;
    text-shadow: 
        1px 1px 0 rgba(0, 0, 0, 0.1),
        2px 2px 0 rgba(0, 0, 0, 0.1),
        3px 3px 0 rgba(0, 0, 0, 0.1),
        4px 4px 0 rgba(0, 0, 0, 0.1),
        5px 5px 10px rgba(0, 0, 0, 0.3);
}

.text-extrude {
    color: var(--white);
    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);
}

/* ========== 3D LAYER EFFECT ========== */
.layer-3d {
    position: relative;
    transform-style: preserve-3d;
}

.layer-3d .layer {
    position: absolute;
    inset: 0;
    transition: transform 0.5s ease;
}

.layer-3d .layer-1 { transform: translateZ(0); }
.layer-3d .layer-2 { transform: translateZ(20px); }
.layer-3d .layer-3 { transform: translateZ(40px); }

.layer-3d:hover .layer-1 { transform: translateZ(0) scale(1.02); }
.layer-3d:hover .layer-2 { transform: translateZ(40px) scale(1.05); }
.layer-3d:hover .layer-3 { transform: translateZ(80px) scale(1.08); }

/* ========== 3D PARALLAX ========== */
.parallax-3d {
    position: relative;
    overflow: hidden;
    perspective: 1000px;
}

.parallax-3d-bg {
    position: absolute;
    inset: -50px;
    transform: translateZ(-100px) scale(1.5);
}

.parallax-3d-content {
    position: relative;
    transform: translateZ(0);
}

/* ========== 3D RIBBON ========== */
.ribbon-3d {
    position: absolute;
    top: 20px;
    right: -35px;
    width: 150px;
    padding: var(--space-2);
    background: var(--primary-gradient);
    color: var(--white);
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    transform: rotate(45deg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.ribbon-3d::before,
.ribbon-3d::after {
    content: '';
    position: absolute;
    bottom: -6px;
    border: 6px solid var(--primary-dark);
    border-bottom-color: transparent;
}

.ribbon-3d::before {
    left: 0;
    border-left-color: transparent;
}

.ribbon-3d::after {
    right: 0;
    border-right-color: transparent;
}

/* ========== 3D PRICING CARD ========== */
.pricing-card-3d {
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.pricing-card-3d:hover {
    transform: perspective(1000px) rotateX(-5deg) translateY(-10px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.pricing-card-3d .card-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: translateZ(1px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.pricing-card-3d:hover .card-shine {
    opacity: 1;
}

/* ========== 3D ICON CONTAINER ========== */
.icon-3d-container {
    position: relative;
    width: 80px;
    height: 80px;
    perspective: 1000px;
}

.icon-3d {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    transform-style: preserve-3d;
    animation: iconFloat 3s ease-in-out infinite;
    box-shadow: 
        0 10px 20px rgba(99, 102, 241, 0.3),
        0 0 40px rgba(99, 102, 241, 0.1);
}

.icon-3d i {
    font-size: var(--fs-3xl);
    color: var(--white);
    transform: translateZ(20px);
}

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotateX(0deg) rotateY(0deg);
    }
    50% {
        transform: translateY(-10px) rotateX(10deg) rotateY(10deg);
    }
}

/* ========== 3D MORPHING SHAPES ========== */
.morph-shape {
    position: absolute;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    filter: blur(60px);
    animation: morphShape 15s ease-in-out infinite;
}

@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% 30% / 70% 30% 50% 60%;
    }
}

/* ========== 3D GLOW EFFECT ========== */
.glow-3d {
    position: relative;
}

.glow-3d::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: var(--primary-gradient);
    filter: blur(40px);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
    border-radius: inherit;
}

.glow-3d:hover::before {
    opacity: 0.5;
}

/* ========== 3D HOVER CARD ========== */
.hover-card-3d {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0) rotateY(0);
    transition: all 0.5s ease;
}

.hover-card-3d::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hover-card-3d:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(99, 102, 241, 0.2);
}

.hover-card-3d:hover::before {
    opacity: 1;
}

/* ========== 3D REFLECTION ========== */
.reflection-3d {
    position: relative;
}

.reflection-3d::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -100%;
    height: 100%;
    background: inherit;
    transform: scaleY(-1);
    opacity: 0.3;
    filter: blur(5px);
    mask-image: linear-gradient(to bottom, transparent 50%, black 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 50%, black 100%);
}

/* ========== 3D ORBIT ANIMATION ========== */
.orbit-container {
    position: relative;
    width: 200px;
    height: 200px;
    perspective: 1000px;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--primary-gradient);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.orbit-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: orbit 8s linear infinite;
}

.orbit-item:nth-child(2) { animation-delay: -2s; }
.orbit-item:nth-child(3) { animation-delay: -4s; }
.orbit-item:nth-child(4) { animation-delay: -6s; }

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(80px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(80px) rotate(-360deg);
    }
}

/* ========== PRESERVE 3D UTILITY ========== */
.preserve-3d {
    transform-style: preserve-3d;
}

.perspective-1000 {
    perspective: 1000px;
}

.perspective-2000 {
    perspective: 2000px;
}

.backface-hidden {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* ========== HARDWARE ACCELERATION ========== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}
