/* Canvas 3D Component Styles */
.canvas-3d-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1200px;
    transform-style: preserve-3d;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-frame {
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(-5deg) rotateY(40deg);
    transition: transform 0.3s ease;
    width: 80%;
    height: 80%;
    max-width: 400px;
    max-height: 300px;
}

/* Per schermi superiori ai 480px */
@media (min-width: 481px) {
    .canvas-frame {
        width: 70%;
        height: 80%;
    }
}

/* Per schermi superiori ai 768px */
@media (min-width: 769px) {
    .canvas-front {
        background-size: 270px 300px !important;
        background-position: -25px 0px !important;
    }
    
    .canvas-frame {
        width: 60%;
        height: 80%;
    }
}

.canvas-front {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateZ(20px);
}

.canvas-front::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/canva-effect.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.edge-top,
.edge-bottom,
.edge-left,
.edge-right {
    position: absolute;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Overlay scuro per effetto realistico sui bordi */
.edge-top::after,
.edge-bottom::after,
.edge-left::after,
.edge-right::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.edge-top {
    width: 100%;
    height: 35px;
    top: -35px;
    left: 0;
    transform: rotateX(-90deg) translateZ(17.5px);
}

.edge-bottom {
    width: 100%;
    height: 35px;
    bottom: -35px;
    left: 0;
    transform: rotateX(90deg) translateZ(17.5px);
}

.edge-left {
    width: 38px;
    height: 100%;
    top: 0;
    left: 0px;
    transform: rotateY(270deg) translateZ(17.5px);
}

.edge-right {
    width: 35px;
    height: 100%;
    top: 0;
    right: -35px;
    transform: rotateY(-90deg) translateZ(17.5px);
}

.canvas-side {
    position: absolute;
    background: linear-gradient(135deg, #8B4513 0%, #654321 50%, #8B4513 100%);
    border-radius: 4px;
}

.canvas-side.canvas-top {
    width: 100%;
    height: 35px;
    top: -35px;
    left: 0;
    transform: rotateX(-90deg) translateZ(52.5px);
}

.canvas-side.canvas-bottom {
    width: 0%;
    height: 35px;
    bottom: -35px;
    left: 0;
    transform: rotateX(90deg) translateZ(52.5px);
}

.canvas-side.canvas-left {
    width: 35px;
    height: 100%;
    top: 0;
    left: -35px;
    transform: rotateY(90deg) translateZ(52.5px);
}

.canvas-side.canvas-right {
    width: 35px;
    height: 100%;
    top: 0;
    right: -35px;
    transform: rotateY(-90deg) translateZ(52.5px);
}

/* Stili specifici per canvas-front e edge-left */
.canvas-front {
    background-size: 270px 300px !important;
    background-position: -25px 0px !important;
}

.edge-left {
    background-size: 460px 300px !important;
    background-position: 0px 0px !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .canvas-frame {
        transform: rotateX(-2deg) rotateY(40deg) scale(0.8);
    }
    
    .canvas-container {
        perspective: 800px;
    }
}

@media (max-width: 480px) {
    .canvas-frame {
        transform: rotateX(-1deg) rotateY(40deg) scale(0.7);
    }
}

/* Hover effects */
.canvas-container:hover .canvas-frame {
    transform: rotateX(-3deg) rotateY(30deg) scale(1.02);
    transition: transform 0.5s ease;
}

/* Loading state */
.canvas-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: canvas-loading 1s linear infinite;
}

@keyframes canvas-loading {
    0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
    100% { background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px; }
} 