/* ==========================================
       [추가됨] 팝업 등장 애니메이션 
    ========================================== */
/* 1. 배경이 서서히 어두워지는 효과 */
@keyframes fadeInOverlay {
    from {
        background-color: rgba(0, 0, 0, 0);
    }

    to {
        background-color: rgba(0, 0, 0, 0.6);
    }
}

/* 2. 팝업창이 부드럽게 나타나는 효과 */
@keyframes scaleUpPopup {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ==========================================
       레이어 팝업 CSS
    ========================================== */
.layer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* 애니메이션 적용 (0.3초 동안 실행) */
    animation: fadeInOverlay 0.3s ease-out forwards;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 2rem;
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

.layer-popup {
    width: 100%;
    max-height: 90dvh;
    background-color: #ffffff;
    border-radius: 12px;
    position: relative;
    box-sizing: border-box;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    /* 애니메이션 적용 (0.3초 동안 실행) */
    animation: scaleUpPopup 0.3s ease-out forwards;
}

.layer-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    z-index: 10;
}

.layer-close-btn:hover {
    color: #333;
}

.layer-content {
    border-radius: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.layer-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

/* 커스텀 스크롤바 (오버레이 트랙) */
.custom-scrollbar-track {
    position: absolute;
    top: 2rem;
    bottom: 2rem;
    right: 6px;
    width: 6px;
    background: transparent;
    z-index: 5;
}

/* 커스텀 스크롤바 막대 (Thumb) */
.custom-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.custom-scrollbar-thumb:hover,
.custom-scrollbar-thumb:active {
    background-color: rgba(0, 0, 0, 0.5);
}



@media screen and (max-width: 768px) {
    .layer-overlay {
        padding: 1rem;
    }
}