/* 
 * 3D Cube Animation Styles
 * Advanced 3D rotating cube with features
 */

/* Container for the cube */
.cube-container {
    width: 100%;
    height: 300px;
    perspective: 1000px;
    margin: 70px auto 0;
    max-width: 300px;
}

/* Main cube element */
.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform: translateZ(-150px);
    animation: cube-rotation 20s infinite linear;
}

/* Pause rotation on hover */
.cube:hover {
    animation-play-state: paused;
}

/* Common styles for all cube faces */
.cube-face {
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
    border-radius: 15px;
}

/* Individual positioning of each face */
.cube-face.front {
    transform: rotateY(0deg) translateZ(150px);
}

.cube-face.back {
    transform: rotateY(180deg) translateZ(150px);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(150px);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(150px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(150px);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(150px);
}

/* Content inside each face */
.cube-content {
    text-align: center;
    padding: 20px;
}

.cube-content i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.cube-content h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.cube-content p {
    color: var(--grey);
    font-size: 0.9rem;
}

/* Cube rotation animation */
@keyframes cube-rotation {
    0% {
        transform: translateZ(-150px) rotateY(0deg) rotateX(0deg);
    }
    16% {
        transform: translateZ(-150px) rotateY(60deg) rotateX(60deg);
    }
    33% {
        transform: translateZ(-150px) rotateY(120deg) rotateX(30deg);
    }
    50% {
        transform: translateZ(-150px) rotateY(180deg) rotateX(0deg);
    }
    66% {
        transform: translateZ(-150px) rotateY(240deg) rotateX(-30deg);
    }
    83% {
        transform: translateZ(-150px) rotateY(300deg) rotateX(30deg);
    }
    100% {
        transform: translateZ(-150px) rotateY(360deg) rotateX(0deg);
    }
}

/* Custom hover effects for each face */
.cube-face.front:hover {
    background: linear-gradient(135deg, rgba(128, 0, 128, 0.1), rgba(255, 215, 0, 0.1));
}

.cube-face.back:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(128, 0, 128, 0.1));
}

.cube-face.right:hover, .cube-face.left:hover {
    background: linear-gradient(135deg, rgba(128, 0, 128, 0.05), rgba(255, 255, 255, 0.95));
}

.cube-face.top:hover, .cube-face.bottom:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(128, 0, 128, 0.05));
}

/* Make cube responsive */
@media screen and (max-width: 768px) {
    .cube-container {
        height: 250px;
    }
    
    .cube-face {
        width: 250px;
        height: 250px;
    }
    
    .cube-face.front {
        transform: rotateY(0deg) translateZ(125px);
    }
    
    .cube-face.back {
        transform: rotateY(180deg) translateZ(125px);
    }
    
    .cube-face.right {
        transform: rotateY(90deg) translateZ(125px);
    }
    
    .cube-face.left {
        transform: rotateY(-90deg) translateZ(125px);
    }
    
    .cube-face.top {
        transform: rotateX(90deg) translateZ(125px);
    }
    
    .cube-face.bottom {
        transform: rotateX(-90deg) translateZ(125px);
    }
    
    @keyframes cube-rotation {
        0% {
            transform: translateZ(-125px) rotateY(0deg) rotateX(0deg);
        }
        16% {
            transform: translateZ(-125px) rotateY(60deg) rotateX(60deg);
        }
        33% {
            transform: translateZ(-125px) rotateY(120deg) rotateX(30deg);
        }
        50% {
            transform: translateZ(-125px) rotateY(180deg) rotateX(0deg);
        }
        66% {
            transform: translateZ(-125px) rotateY(240deg) rotateX(-30deg);
        }
        83% {
            transform: translateZ(-125px) rotateY(300deg) rotateX(30deg);
        }
        100% {
            transform: translateZ(-125px) rotateY(360deg) rotateX(0deg);
        }
    }
    
    .cube-content i {
        font-size: 2rem;
    }
    
    .cube-content h3 {
        font-size: 1.2rem;
    }
    
    .cube-content p {
        font-size: 0.8rem;
    }
}
