/* Preloader Component Styles - assets/css/preloader.css */

.preloader {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: #2d3436;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 3D 方块加载动画 */
.cube-3d-loader {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    /* 连续单向旋转 + 轻微浮动：比原来的折返旋转更流畅，且循环首尾完全衔接不跳变 */
    animation: cubeSpin 2.2s infinite;
}

.cube-face {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid rgba(108, 92, 231, 0.6);
    background: rgba(108, 92, 231, 0.15);
    box-shadow: 0 0 15px rgba(108, 92, 231, 0.3) inset;
    animation: colorShift 3s ease-in-out infinite;
}

.cube-front  { transform: translateZ(40px); animation-delay: 0s; }
.cube-back   { transform: rotateY(180deg) translateZ(40px); animation-delay: 0.2s; }
.cube-right  { transform: rotateY(90deg) translateZ(40px); animation-delay: 0.4s; }
.cube-left   { transform: rotateY(-90deg) translateZ(40px); animation-delay: 0.6s; }
.cube-top    { transform: rotateX(90deg) translateZ(40px); animation-delay: 0.8s; }
.cube-bottom { transform: rotateX(-90deg) translateZ(40px); animation-delay: 1s; }

/* 三轴翻滚（2.2s 循环，关键帧内逐段指定缓动）：
   Y 轴连续正转两圈（左下→右上主线）+ X 轴反向翻回（左上→右下）+ Z 轴慢转，
   三轴不同步 → 立体翻滚；加速(ease-in)/减速(ease-out) 保留洗衣机质感；
   首尾 X/Y/Z 均为 360° 整数倍、速度 0、scale 一致 → 无缝循环 */
@keyframes cubeSpin {
    0%   { transform: rotateX(0deg)    rotateY(0deg)    rotateZ(0deg)    scale(0.9);  animation-timing-function: ease-in; }
    25%  { transform: rotateX(-180deg) rotateY(180deg)  rotateZ(90deg)   scale(1.08); animation-timing-function: ease-out; }
    50%  { transform: rotateX(-360deg) rotateY(360deg)  rotateZ(180deg)  scale(0.9);  animation-timing-function: ease-in; }
    75%  { transform: rotateX(-180deg) rotateY(540deg)  rotateZ(270deg)  scale(1.08); animation-timing-function: ease-out; }
    100% { transform: rotateX(0deg)    rotateY(720deg)  rotateZ(360deg)  scale(0.9); }
}

@keyframes colorShift {
    0%, 100% {
        border-color: rgba(66, 105, 225, 0.8);
        background: rgba(66, 105, 225, 0.2);
        box-shadow: 0 0 15px rgba(66, 105, 225, 0.4) inset,
                    0 0 20px rgba(66, 105, 225, 0.3);
    }
    25% {
        border-color: rgba(108, 92, 231, 0.8);
        background: rgba(108, 92, 231, 0.2);
        box-shadow: 0 0 15px rgba(108, 92, 231, 0.4) inset,
                    0 0 20px rgba(108, 92, 231, 0.3);
    }
    50% {
        border-color: rgba(255, 59, 147, 0.8);
        background: rgba(255, 59, 147, 0.2);
        box-shadow: 0 0 15px rgba(255, 59, 147, 0.4) inset,
                    0 0 20px rgba(255, 59, 147, 0.3);
    }
    75% {
        border-color: rgba(228, 107, 255, 0.8);
        background: rgba(228, 107, 255, 0.2);
        box-shadow: 0 0 15px rgba(228, 107, 255, 0.4) inset,
                    0 0 20px rgba(228, 107, 255, 0.3);
    }
}

.loading-text {
    display: block;
    text-align: center;
    color: white;
    margin-top: 30px;
    font-size: 14px;
    opacity: 0.8;
    letter-spacing: 1px;
}

/* Back to home button for docs */
.back-to-home {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6c5ce7 0%, #a363d9 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    transition: all 0.3s ease;
    z-index: 1001;
}

.back-to-home:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6);
    color: white;
}
