/* 회원 등급별 접근 제한 스타일 */

/* 블러 효과 애니메이션 - 제거 (그라데이션으로 대체) */
.content-blur-old {
    filter: blur(5px);
    transition: filter 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    user-select: none;
}

/* 그라데이션 오버레이 - 등급 1 사용자용 */
.gradient-overlay {
    position: absolute;  /* 테이블 컨테이너에 대해 절대 위치 */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.6) 0%,     /* 상단 60% 반투명 */
        rgba(255, 255, 255, 0.62) 10%,
        rgba(255, 255, 255, 0.65) 20%,
        rgba(255, 255, 255, 0.68) 30%,
        rgba(255, 255, 255, 0.72) 40%,
        rgba(255, 255, 255, 0.76) 50%,
        rgba(255, 255, 255, 0.8) 60%,
        rgba(255, 255, 255, 0.83) 70%,
        rgba(255, 255, 255, 0.86) 80%,
        rgba(255, 255, 255, 0.88) 90%,
        rgba(255, 255, 255, 0.9) 100%   /* 하단 90% 불투명 */
    );
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1),
                visibility 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 100;  /* 테이블 위에 표시되도록 */
    pointer-events: none;  /* 스크롤은 가능하도록 */
}

.gradient-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: none;  /* 스크롤은 여전히 가능 */
    animation: gradientFadeIn 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 테이블 컨테이너 wrapper - 그라데이션 효과를 위한 */
.table-wrapper-with-gradient {
    position: relative;
}

@keyframes gradientFadeIn {
    0% {
        opacity: 0;
        background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0) 100%
        );
    }
    100% {
        opacity: 1;
        background: linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.6) 0%,     /* 상단 60% 반투명 */
            rgba(255, 255, 255, 0.62) 10%,
            rgba(255, 255, 255, 0.65) 20%,
            rgba(255, 255, 255, 0.68) 30%,
            rgba(255, 255, 255, 0.72) 40%,
            rgba(255, 255, 255, 0.76) 50%,
            rgba(255, 255, 255, 0.8) 60%,
            rgba(255, 255, 255, 0.83) 70%,
            rgba(255, 255, 255, 0.86) 80%,
            rgba(255, 255, 255, 0.88) 90%,
            rgba(255, 255, 255, 0.9) 100%   /* 하단 90% 불투명 */
        );
    }
}

/* 테이블 컨테이너 제한 - 그라데이션 오버레이를 위해 position relative 필수 */
.table-wrapper-restricted {
    position: relative;
    overflow: hidden;  /* 오버레이가 컨테이너 밖으로 나가지 않도록 */
}

/* 기본 오버레이 스타일 */
.access-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 1, 0.5, 1),
                visibility 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.access-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 오버레이 모달 */
.access-modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
                0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.access-overlay.active .access-modal {
    transform: scale(1) translateY(0);
}

/* 모달 헤더 */
.access-modal-header {
    margin-bottom: 16px;
}

.access-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.access-modal-description {
    font-size: 16px;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

/* 모달 버튼 그룹 */
.access-modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.access-modal-buttons button {
    flex: 1;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Primary 버튼 (로그인, 업그레이드) */
.btn-primary-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-primary-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(102, 126, 234, 0.4);
}

/* Secondary 버튼 (회원가입, 닫기) */
.btn-secondary-modal {
    background: white;
    color: #6B7280;
    border: 1px solid #E5E7EB;
}

.btn-secondary-modal:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

/* 테이블 제한 표시 */
.table-restricted {
    position: relative;
}

.table-restricted::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom,
                transparent 0%,
                rgba(255, 255, 255, 0.8) 50%,
                rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
    z-index: 10;
}

/* 스크롤 제한 오버레이 */
.scroll-restriction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(2px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.scroll-restriction-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 등급 배지 */
.user-grade-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.grade-badge-0 {
    background: #F3F4F6;
    color: #6B7280;
}

.grade-badge-1 {
    background: #D1FAE5;
    color: #065F46;
}

.grade-badge-2 {
    background: #DBEAFE;
    color: #1E3A8A;
}

.grade-badge-3 {
    background: #EDE9FE;
    color: #5B21B6;
}

/* 모바일 반응형 */
@media (max-width: 640px) {
    .access-modal {
        padding: 24px;
        width: 95%;
        max-width: none;
    }

    .access-modal-title {
        font-size: 20px;
    }

    .access-modal-description {
        font-size: 14px;
    }

    .access-modal-buttons {
        flex-direction: column;
    }

    .access-modal-buttons button {
        width: 100%;
        padding: 14px;
    }
}

/* IE11 폴백 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .content-blur {
        opacity: 0.5;
        filter: none;
    }

    .access-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* 클릭 차단 레이어 */
.click-blocker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    cursor: not-allowed;
}

/* 페이드 효과 */
.fade-bottom {
    position: relative;
}

.fade-bottom::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.9) 60%,
        white
    );
    pointer-events: none;
}