/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

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

.loader-content {
    text-align: center;
    padding: 2rem;
}

/* Construction Animation */
.construction-animation {
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
    position: relative;
}

/* Crane */
.crane {
    position: absolute;
    width: 100%;
    height: 100%;
    animation: craneSway 3s ease-in-out infinite;
}

.crane-arm {
    position: absolute;
    top: 20px;
    left: 50%;
    width: 4px;
    height: 80px;
    background: linear-gradient(to bottom, #e67e22 0%, #d35400 100%);
    transform: translateX(-50%);
    transform-origin: top center;
}

.crane-arm::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 4px;
    background: linear-gradient(to right, #e67e22 0%, #d35400 100%);
}

.crane-line {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(40px);
    width: 2px;
    height: 60px;
    background: repeating-linear-gradient(
        to bottom,
        #34495e 0px,
        #34495e 5px,
        transparent 5px,
        transparent 10px
    );
    animation: craneLineMove 2s ease-in-out infinite;
}

.crane-hook {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(35px);
    width: 15px;
    height: 15px;
    background: #95a5a6;
    border-radius: 3px;
    animation: hookBounce 2s ease-in-out infinite;
}

/* Building Blocks */
.building-blocks {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    align-items: flex-end;
}

.block {
    width: 40px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 2px;
    position: relative;
    opacity: 0;
    animation: blockBuild 3s ease-in-out infinite;
}

.block::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 5px;
    right: 5px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.block-1 {
    height: 35px;
    animation-delay: 0.5s;
}

.block-2 {
    height: 55px;
    animation-delay: 1s;
}

.block-3 {
    height: 45px;
    animation-delay: 1.5s;
}

/* Logo */
.loader-logo {
    margin: 2rem 0 1rem;
    animation: logoFloat 2s ease-in-out infinite;
}

.loader-logo-img {
    max-width: 150px;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

/* Loader Text */
.loader-text {
    font-size: 1.125rem;
    color: var(--color-gray-dark);
    font-weight: 600;
    margin: 1.5rem 0;
    animation: textPulse 1.5s ease-in-out infinite;
}

/* Progress Bar */
.loader-progress {
    width: 250px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 1.5rem auto 0;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border-radius: 10px;
    animation: progressBar 2s ease-in-out infinite;
}

/* Animations */
@keyframes craneSway {
    0%, 100% {
        transform: rotate(-2deg);
    }
    50% {
        transform: rotate(2deg);
    }
}

@keyframes craneLineMove {
    0%, 100% {
        height: 60px;
    }
    50% {
        height: 80px;
    }
}

@keyframes hookBounce {
    0%, 100% {
        transform: translateX(35px) translateY(0);
    }
    50% {
        transform: translateX(35px) translateY(20px);
    }
}

@keyframes blockBuild {
    0%, 20% {
        opacity: 0;
        transform: translateY(-20px) scale(0.8);
    }
    30% {
        opacity: 1;
        transform: translateY(0) scale(1.05);
    }
    40%, 100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes textPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes progressBar {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

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

    .loader-logo-img {
        max-width: 120px;
    }

    .loader-text {
        font-size: 1rem;
    }

    .loader-progress {
        width: 200px;
    }
}
