/* 3D Effects and Transformations */

/* Floating Elements */
.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg) rotateY(0deg);
    }
    33% {
        transform: translateY(-20px) rotateX(5deg) rotateY(5deg);
    }
    66% {
        transform: translateY(10px) rotateX(-5deg) rotateY(-5deg);
    }
}

/* 3D Floating Boxes - For Service Cards ONLY */
.floating-3d {
    transform-style: preserve-3d;
    perspective: 1000px;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float3D 8s ease-in-out infinite;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border: none !important;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 5px 15px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(135, 206, 235, 0.3);
}

@keyframes float3D {
    0%, 100% {
        transform: 
            perspective(1000px)
            translateY(0)
            rotateX(0deg)
            rotateY(0deg)
            translateZ(0);
    }
    25% {
        transform: 
            perspective(1000px)
            translateY(-25px)
            rotateX(5deg)
            rotateY(5deg)
            translateZ(20px);
    }
    50% {
        transform: 
            perspective(1000px)
            translateY(15px)
            rotateX(-5deg)
            rotateY(-5deg)
            translateZ(-10px);
    }
    75% {
        transform: 
            perspective(1000px)
            translateY(-10px)
            rotateX(3deg)
            rotateY(-3deg)
            translateZ(15px);
    }
}

.floating-3d:hover {
    animation-play-state: paused;
    transform: 
        perspective(1000px)
        translateY(-15px)
        rotateX(10deg)
        rotateY(10deg)
        translateZ(50px)
        scale(1.05);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.3),
        0 10px 20px rgba(0, 0, 0, 0.15),
        inset 0 0 0 2px rgba(255, 255, 255, 0.9),
        0 0 30px rgba(135, 206, 235, 0.5);
}

.floating-3d i {
    transform: translateZ(40px);
    font-size: 3em;
    background: linear-gradient(45deg, #87ceeb, #4682b4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 5px 10px rgba(135, 206, 235, 0.3));
}

.floating-3d:hover i {
    transform: translateZ(60px) scale(1.2);
    background: linear-gradient(45deg, #87ceeb, #5dade2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 8px 15px rgba(135, 206, 235, 0.5));
}

/* Image Zoom Modal Effects */
.image-zoom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.image-zoom-modal.active {
    display: flex;
    opacity: 1;
    animation: modalAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateX(0deg);
    }
}

.zoomed-image {
    max-width: 90%;
    max-height: 90%;
    border-radius: 20px;
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.7),
        0 15px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transform: scale(0.9) rotateY(20deg);
    animation: zoomIn3D 0.6s 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    filter: brightness(1.1) contrast(1.05);
}

@keyframes zoomIn3D {
    to {
        transform: scale(1) rotateY(0deg);
    }
}

.close-zoom {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 50px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.6);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transform-style: preserve-3d;
}

.close-zoom:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: 
        rotate(90deg)
        translateZ(20px)
        scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
}

/* 3D Button Effects */
.cta-button {
    display: inline-block;
    padding: 15px 40px;
    margin: 10px;
    background: linear-gradient(45deg, skyblue, #4682b4);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 20px rgba(135, 206, 235, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: 
        translateY(-5px)
        translateZ(30px)
        scale(1.05);
    box-shadow: 
        0 20px 40px rgba(135, 206, 235, 0.4),
        0 15px 25px rgba(0, 0, 0, 0.2),
        inset 0 0 0 2px rgba(255, 255, 255, 0.3);
    background: linear-gradient(45deg, #87ceeb, #5dade2);
}

.cta-button.secondary {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    box-shadow: 
        0 10px 20px rgba(255, 154, 158, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.cta-button.secondary:hover {
    box-shadow: 
        0 20px 40px rgba(255, 154, 158, 0.4),
        0 15px 25px rgba(0, 0, 0, 0.2),
        inset 0 0 0 2px rgba(255, 255, 255, 0.3);
    background: linear-gradient(45deg, #ff9a9e, #ffb8b9);
}

/* 3D Form Input Effects */
.form-section input,
.form-section select,
.form-section button {
    transform-style: preserve-3d;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
}

.form-section input:focus,
.form-section select:focus {
    transform: translateZ(20px);
    border-color: skyblue;
    box-shadow: 
        0 0 20px rgba(135, 206, 235, 0.4),
        0 0 40px rgba(135, 206, 235, 0.2),
        inset 0 0 10px rgba(135, 206, 235, 0.1);
    outline: none;
    background: rgba(255, 255, 255, 0.15);
}

.form-section button.Send {
    transform-style: preserve-3d;
    background: linear-gradient(45deg, skyblue, #4682b4);
    border: none;
    position: relative;
    overflow: hidden;
}

.form-section button.Send:hover {
    transform: 
        translateY(-3px)
        translateZ(25px)
        scale(1.05);
    box-shadow: 
        0 15px 30px rgba(135, 206, 235, 0.4),
        0 10px 20px rgba(0, 0, 0, 0.2);
}

.form-section button.Send::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.form-section button.Send:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* 3D Card Hover Effects for Services */
.icon-box {
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.icon-box .service-desc,
.icon-box-inner .service-desc,
#icon-boxes-section .service-desc {
    color: rgba(255, 255, 255, 0.9) !important;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.4) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.4) 100%) !important;
}

.icon-box-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    position: relative !important;
}

.icon-box-inner .service-desc {
    flex-grow: 1 !important;
}

.icon-box:hover {
    transform: 
        translateZ(50px)
        rotateX(5deg)
        rotateY(5deg);
    z-index: 10;
}

.icon-box h2 {
    transform: translateZ(30px);
    transition: transform 0.3s ease;
    color: skyblue !important;
    text-shadow: 0 2px 10px rgba(135, 206, 235, 0.3);
}

.icon-box:hover h2 {
    transform: translateZ(50px) scale(1.1);
    color: #5dade2 !important;
    text-shadow: 0 5px 20px rgba(135, 206, 235, 0.5);
}

/* 3D Parallax Scroll Effect */
.content-wrapper {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.page-content {
    transform-style: preserve-3d;
}

/* Performance Optimizations */
@media (prefers-reduced-motion: reduce) {
    .floating,
    .floating-3d,
    .floating-element,
    .bubble,
    .interactive-circle,
    .rotating-ring,
    .central-orb,
    .color-blinker,
    .black-orb,
    .shape {
        animation: none !important;
        transition: none !important;
    }
    
    .image-zoom-modal.active {
        animation: none;
    }
    
    .zoomed-image {
        animation: none;
        transform: scale(1);
    }
    
    .cta-button:hover,
    .icon-box:hover,
    .feature-item:hover {
        transform: none !important;
    }
}