/**
 * Enhanced 3D Cube Animation Styles
 * Ensures proper rendering across all browsers
 */

/* Base cube container */
.cube-container {
    perspective: 1000px;
    width: 300px;
    height: 300px;
    position: relative;
    margin: 0 auto;
    z-index: 10;
}

/* Cube */
.cube {
    width: 200px;
    height: 200px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: translate(-50%, -50%);
}

/* Cube faces - shared styles */
.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
    background-color: rgba(30, 41, 59, 0.9);
    box-shadow: 0 0 20px rgba(108, 99, 255, 0.5);
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

/* Individual face positioning */
.cube-face.front {
    transform: translateZ(100px);
}

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

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

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

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

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

/* Face content styling */
.cube-content {
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}

.cube-content i {
    font-size: 40px;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.cube-content span {
    font-size: 16px;
    font-weight: bold;
}

/* Hover effects */
.cube-face:hover {
    background-color: rgba(108, 99, 255, 0.8);
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.8);
    transition: all 0.3s ease;
}

/* Responsive styles */
@media (max-width: 768px) {
    .cube {
        width: 150px;
        height: 150px;
    }
    
    .cube-face {
        width: 150px;
        height: 150px;
    }
    
    .cube-face.front {
        transform: translateZ(75px);
    }
    
    .cube-face.back {
        transform: rotateY(180deg) translateZ(75px);
    }
    
    .cube-face.right {
        transform: rotateY(90deg) translateZ(75px);
    }
    
    .cube-face.left {
        transform: rotateY(-90deg) translateZ(75px);
    }
    
    .cube-face.top {
        transform: rotateX(90deg) translateZ(75px);
    }
    
    .cube-face.bottom {
        transform: rotateX(-90deg) translateZ(75px);
    }
    
    .cube-content i {
        font-size: 30px;
    }
    
    .cube-content span {
        font-size: 14px;
    }
}

/* Safari browser fix */
@media not all and (min-resolution:.001dpcm) { 
    @supports (-webkit-appearance:none) {
        .cube-container {
            transform: translateZ(0);
        }
        
        .cube {
            transform-style: preserve-3d !important;
            -webkit-transform-style: preserve-3d !important;
        }
    }
}
