/* ========================================
   PayLin Premium Folding Cube Preloader
   ======================================== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0b0c10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

.preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

/* Folding Cube Container */
.folding-cube {
    width: 48px;
    height: 48px;
    position: relative;
    transform: rotate(45deg);
    margin-bottom: 3rem;
}

.cube-leaf {
    float: left;
    width: 50%;
    height: 50%;
    position: relative;
    transform: scale(1.1);
}

.cube-leaf::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-accent);
    animation: fold-cube 1.4s infinite linear both;
    transform-origin: 100% 100%;
    border-radius: 2px;
}

/* Specific colors and delays for each leaf */
.cube-leaf:nth-child(2) {
    transform: scale(1.1) rotate(90deg);
}

.cube-leaf:nth-child(3) {
    transform: scale(1.1) rotate(270deg);
}

.cube-leaf:nth-child(4) {
    transform: scale(1.1) rotate(180deg);
}

.cube-leaf:nth-child(2)::before {
    background: var(--color-cyan);
    animation-delay: 0.18s;
}

.cube-leaf:nth-child(4)::before {
    background: #10b981;
    animation-delay: 0.36s;
}

.cube-leaf:nth-child(3)::before {
    background: #06b6d4;
    animation-delay: 0.54s;
}

@keyframes fold-cube {

    0%,
    10% {
        transform: perspective(140px) rotateX(-180deg);
        opacity: 0;
    }

    25%,
    75% {
        transform: perspective(140px) rotateX(0deg);
        opacity: 1;
    }

    90%,
    100% {
        transform: perspective(140px) rotateY(180deg);
        opacity: 0;
    }
}

.loader-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loader-logo-icon {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 15px rgba(74, 222, 128, 0.3));
    margin-bottom: 5px;
}

.loader-logo-text {
    height: 24px;
    width: auto;
    opacity: 0.8;
}