/**
 * 로딩 인디케이터 스타일 (L-6)
 */

/* 기본 스피너 (버튼 내부용) */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* 어두운 배경 버튼용 스피너 */
.btn-outline-primary .loading-spinner,
.btn-outline-secondary .loading-spinner,
.btn-light .loading-spinner {
    border-color: rgba(0, 0, 0, 0.2);
    border-top-color: #333;
}

/* 큰 스피너 (오버레이용) */
.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(139, 69, 19, 0.2);
    border-radius: 50%;
    border-top-color: #8B4513;
    animation: spin 0.8s linear infinite;
}

/* 인라인 스피너 (요소 옆) */
.loading-spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(139, 69, 19, 0.2);
    border-radius: 50%;
    border-top-color: #8B4513;
    animation: spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* 스핀 애니메이션 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 로딩 중인 버튼 스타일 */
button.loading,
.btn.loading {
    cursor: wait;
    opacity: 0.8;
}

/* 오버레이 공통 스타일 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: inherit;
}

/* 전체화면 오버레이 */
.loading-overlay-fullscreen {
    position: fixed;
    z-index: 9999;
}

.loading-overlay-content {
    text-align: center;
}

.loading-message {
    margin-top: 16px;
    color: #666;
    font-size: 14px;
}

/* 카드/테이블 로딩 상태 */
.card.loading,
.table-responsive.loading {
    position: relative;
    min-height: 100px;
}

/* 스켈레톤 로딩 (선택적) */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 토글 스위치 로딩 상태 */
.form-check-input.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* 페이드 인 효과 */
.loading-overlay {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
