/* 3D Loading Spinner with Logo Animation */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    position: relative;
    width: 200px;
    height: 200px;
    perspective: 1000px;
}

/* 3D Spinning Cube */
.loader-cube {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: rotateCube 3s infinite ease-in-out;
}

@keyframes rotateCube {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    33% {
        transform: rotateX(360deg) rotateY(180deg) rotateZ(0deg);
    }
    66% {
        transform: rotateX(180deg) rotateY(360deg) rotateZ(180deg);
    }
    100% {
        transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg);
    }
}

/* Cube Faces */
.cube-face {
    position: absolute;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
    color: white;
    border: 2px solid rgba(79, 70, 229, 0.5);
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.3) 0%, rgba(124, 58, 237, 0.3) 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.5);
}

.cube-face::before {
    content: 'IT';
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.cube-face.front {
    transform: translateZ(60px);
}

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

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

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

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

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

/* Orbital Rings */
.loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 3px solid transparent;
    border-top-color: #4f46e5;
    border-right-color: #7c3aed;
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.loader-ring:nth-child(1) {
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    animation-duration: 2s;
}

.loader-ring:nth-child(2) {
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    animation-duration: 1.5s;
    animation-direction: reverse;
    border-top-color: #7c3aed;
    border-right-color: #4f46e5;
}

.loader-ring:nth-child(3) {
    width: 120px;
    height: 120px;
    margin: -60px 0 0 -60px;
    animation-duration: 1s;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.loader-text {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.loader-dots {
    display: inline-block;
    width: 30px;
}

.loader-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Glowing Particles */
.loader-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(79, 70, 229, 0.8);
    animation: float 3s ease-in-out infinite;
}

.loader-particle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.loader-particle:nth-child(2) {
    top: 80%;
    left: 20%;
    animation-delay: 0.5s;
}

.loader-particle:nth-child(3) {
    top: 30%;
    right: 15%;
    animation-delay: 1s;
}

.loader-particle:nth-child(4) {
    bottom: 25%;
    right: 10%;
    animation-delay: 1.5s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-30px) scale(1.5);
        opacity: 1;
    }
}

/* Progress Bar */
.loader-progress {
    position: absolute;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 10px;
    animation: progress 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(79, 70, 229, 0.8);
}

@keyframes progress {
    0% {
        width: 0%;
    }
    50% {
        width: 70%;
    }
    100% {
        width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .loader-container {
        width: 150px;
        height: 150px;
    }

    .cube-face {
        width: 90px;
        height: 90px;
        font-size: 36px;
    }

    .cube-face.front,
    .cube-face.back {
        transform: translateZ(45px);
    }

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

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

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

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

    .loader-ring:nth-child(1) {
        width: 140px;
        height: 140px;
        margin: -70px 0 0 -70px;
    }

    .loader-ring:nth-child(2) {
        width: 110px;
        height: 110px;
        margin: -55px 0 0 -55px;
    }

    .loader-ring:nth-child(3) {
        width: 90px;
        height: 90px;
        margin: -45px 0 0 -45px;
    }

    .loader-text {
        font-size: 14px;
    }
}
