/* サブページ用ローディング */

#loading-sub {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

#loading-sub.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* スピナーコンテナ */
.spinner-container {
    position: relative;
    width: 80px;
    height: 80px;
}

/* メインスピナー */
.spinner {
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 内側のスピナー */
.spinner-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid #0056b3;
    border-radius: 50%;
    animation: spin-inner 0.8s linear infinite reverse;
}

/* 最も内側のスピナー */
.spinner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid #fff;
    border-radius: 50%;
    animation: spin-core 0.6s linear infinite;
}

/* 回転アニメーション */
@keyframes spin {
    0% {
        /* transform: translate(-50%, -50%) rotate(0deg); */
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        /* transform: translate(-50%, -50%) rotate(360deg); */
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
@keyframes spin-inner {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
@keyframes spin-core {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ローディングテキスト */
.loading-text {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    opacity: 0.8;
}

/* ドットアニメーション */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .spinner-container {
        width: 60px;
        height: 60px;
    }
    
    .spinner-inner {
        width: 40px;
        height: 40px;
    }
    
    .spinner-core {
        width: 15px;
        height: 15px;
    }
    
    .loading-text {
        font-size: 12px;
        bottom: -35px;
    }
}

/* フェードアウト時のアニメーション */
#loading-sub.fade-out .spinner-container {
    animation: scaleOut 0.5s ease-out forwards;
}

@keyframes scaleOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.8);
        opacity: 0;
    }
} 