/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #22B24C;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: transform 0.8s ease-in-out, opacity 0.5s ease, visibility 0.5s ease;
    overflow: hidden;
}

.page-loader.hidden {
    transform: scaleY(0);
    opacity: 0;
    visibility: hidden;
}

.ply-loader {
    position: relative;
    width: 400px;
    height: 300px;
    margin-bottom: 20px;
}

.plywood-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.plywood-piece {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.plywood-piece.top-left {
    animation: crackTopLeft 2.5s ease-in-out forwards;
    clip-path: polygon(0 0, 50% 0, 50% 50%, 0 50%);
}

.plywood-piece.top-right {
    animation: crackTopRight 2.5s ease-in-out 0.2s forwards;
    clip-path: polygon(50% 0, 100% 0, 100% 50%, 50% 50%);
}

.plywood-piece.bottom-left {
    animation: crackBottomLeft 2.5s ease-in-out 0.4s forwards;
    clip-path: polygon(0 50%, 50% 50%, 50% 100%, 0 100%);
}

.plywood-piece.bottom-right {
    animation: crackBottomRight 2.5s ease-in-out 0.6s forwards;
    clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%);
}

@keyframes crackTopLeft {
    0%, 30% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
        clip-path: polygon(0 0, 50% 0, 50% 50%, 0 50%);
    }
    60% {
        transform: translateX(-20px) translateY(-20px) rotate(-5deg);
        opacity: 1;
        clip-path: polygon(0 0, 50% 0, 40% 40%, 0 50%);
    }
    100% {
        transform: translateX(-150px) translateY(-120px) rotate(-20deg);
        opacity: 0;
        clip-path: polygon(0 0, 50% 0, 30% 30%, 0 50%);
    }
}

@keyframes crackTopRight {
    0%, 30% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
        clip-path: polygon(50% 0, 100% 0, 100% 50%, 50% 50%);
    }
    60% {
        transform: translateX(20px) translateY(-20px) rotate(5deg);
        opacity: 1;
        clip-path: polygon(50% 0, 100% 0, 100% 50%, 60% 40%);
    }
    100% {
        transform: translateX(150px) translateY(-120px) rotate(20deg);
        opacity: 0;
        clip-path: polygon(50% 0, 100% 0, 100% 50%, 70% 30%);
    }
}

@keyframes crackBottomLeft {
    0%, 30% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
        clip-path: polygon(0 50%, 50% 50%, 50% 100%, 0 100%);
    }
    60% {
        transform: translateX(-20px) translateY(20px) rotate(5deg);
        opacity: 1;
        clip-path: polygon(0 50%, 40% 60%, 50% 100%, 0 100%);
    }
    100% {
        transform: translateX(-150px) translateY(120px) rotate(20deg);
        opacity: 0;
        clip-path: polygon(0 50%, 30% 70%, 50% 100%, 0 100%);
    }
}

@keyframes crackBottomRight {
    0%, 30% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
        clip-path: polygon(50% 50%, 100% 50%, 100% 100%, 50% 100%);
    }
    60% {
        transform: translateX(20px) translateY(20px) rotate(-5deg);
        opacity: 1;
        clip-path: polygon(60% 40%, 100% 50%, 100% 100%, 50% 100%);
    }
    100% {
        transform: translateX(150px) translateY(120px) rotate(-20deg);
        opacity: 0;
        clip-path: polygon(70% 30%, 100% 50%, 100% 100%, 50% 100%);
    }
}

.page-loader p {
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}
