/* ===================================
   Loader Styles
   =================================== */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-primary);
    /* ブランドカラー */
    z-index: 9999;
    /* 最前面 */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

/* ローディング完了後の非表示クラス */
.loader-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
    position: relative;
    width: 100%;
    max-width: 200px;
}

.loader-logo {
    width: 120px;
    height: auto;
    margin: 0 auto 2rem auto;
    display: block;
    animation: pulse 2s infinite ease-in-out;
}

.loader-bar-bg {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    max-width: 150px;
    margin: 0 auto;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: #fff;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.2s ease;
    animation: loadProgress 2s ease-in-out infinite;
    /* JSで進捗制御する場合はanimationを外す */
}

/* シンプルなパルスアニメーション */
@keyframes pulse {
    0% {
        opacity: 0.8;
        transform: scale(0.95);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    100% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

@keyframes loadProgress {
    0% {
        width: 0%;
        left: 0;
    }

    50% {
        width: 50%;
        left: 25%;
    }

    100% {
        width: 100%;
        left: 100%;
    }
}