/* 3D Effects Styles */

.threejs-container canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 3D Tiles Effect */
.tile-3d {
    position: relative;
    perspective: 1000px;
    cursor: pointer;
}

.tile-3d-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
    overflow: hidden;
}

.tile-3d:hover .tile-3d-inner {
    transform: rotateY(10deg) rotateX(5deg) scale(1.05);
}

.tile-3d-front, .tile-3d-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.tile-3d-front {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--dark-blue) 100%);
    color: white;
}

.tile-3d-back {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--dark-gold) 100%);
    color: var(--text-dark);
    transform: rotateY(180deg);
}

.tile-3d-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.tile-3d-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.tile-3d-desc {
    font-size: 16px;
    opacity: 0.9;
}

/* Service cards with 3D effect */
.service-card-3d {
    transform-style: preserve-3d;
    transition: all 0.5s ease;
    position: relative;
}

.service-card-3d:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.service-card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.service-card-3d:hover::before {
    transform: translateX(100%);
}

/* Floating animation for elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.floating-element {
    animation: float 3s ease-in-out infinite;
}

/* Parallax effect for backgrounds */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
}

.parallax-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

/* 3D transform for gallery items */
.gallery-item-3d {
    transition: transform 0.5s ease;
    transform-style: preserve-3d;
}

.gallery-item-3d:hover {
    transform: scale(1.05) rotateY(5deg);
    z-index: 10;
}

.gallery-item-3d img {
    backface-visibility: hidden;
}

/* 3D text effect */
.text-3d {
    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,.1),
        0 0 5px rgba(0,0,0,.1),
        0 1px 3px rgba(0,0,0,.3),
        0 3px 5px rgba(0,0,0,.2),
        0 5px 10px rgba(0,0,0,.25),
        0 10px 10px rgba(0,0,0,.2),
        0 20px 20px rgba(0,0,0,.15);
    color: var(--primary-blue);
}

/* Loading animation for 3D elements */
.loading-3d {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-blue);
    border-top: 5px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments for 3D effects */
@media (max-width: 768px) {
    .tile-3d:hover .tile-3d-inner {
        transform: none;
    }
    
    .service-card-3d:hover {
        transform: translateY(-10px);
    }
    
    .text-3d {
        text-shadow: 
            0 1px 0 #ccc,
            0 2px 0 #c9c9c9,
            0 3px 0 #bbb,
            0 4px 0 #b9b9b9,
            0 5px 0 #aaa;
    }
}