/* ==================== 공통 모달 오버레이 (프로젝트 전역 통합) ==================== */
/* 
 * 모든 모달에서 사용하는 공통 Overlay 스타일
 * QR 확대 모달을 기준으로 정의되었으며, 모든 모달이 동일한 시각적 스타일을 사용합니다.
 * 
 * 시각적 개선 사항:
 * - 배경색을 더 어둡게 하여 모달 컨텐츠와의 대비 강화
 * - 블러 강도를 높여 배경 요소가 더 흐리게 보이도록 개선
 * - 모달이 열릴 때 배경 스크롤 방지 (body 스크롤 잠금)
 * 
 * 사용 규칙:
 * - 모든 모달은 .modal-overlay 클래스를 기본으로 사용
 * - 특수 케이스는 modifier 클래스로 확장 (.modal-overlay--below-header 등)
 * - 내부 컨텐츠 스타일은 modal-content, modal-header 등에서 별도 정의
 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--spacing-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease-out;
    /* 모달이 열릴 때 배경 스크롤 방지 */
    overflow-y: auto;
    /* 모달 컨텐츠가 중앙에 위치하도록 */
    overscroll-behavior: contain;
}

/* 헤더 아래에서 시작해야 하는 특수 케이스용 modifier */
.modal-overlay--below-header {
    top: var(--header-height, 64px);
}

.modal-content {
    background: var(--color-bg-card, #ffffff);
    border-radius: var(--radius-lg, 8px);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    /* 모달 컨텐츠 등장 애니메이션 */
    animation: modalSlideUp 0.3s ease-out;
    /* 모달 컨텐츠가 배경보다 명확하게 보이도록 */
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* 모달 컨텐츠 등장 애니메이션 */
@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.password-modal {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-main);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    padding: var(--spacing-xs);
    cursor: pointer;
    color: var(--color-text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.modal-close:hover:not(:disabled) {
    background: var(--color-bg-subtle);
    color: var(--color-text-main);
}

/* 공통 모달 닫기 버튼 - 비활성화 상태 */
.modal-close:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* disabled 상태에서는 hover 효과 제거 */
.modal-close:disabled:hover {
    background: none;
    color: var(--color-text-sub);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

/* 모달 하단 액션 영역 */
.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--color-border-light);
}
