/* 팝업 컨테이너 - 모든 팝업을 포함하는 영역 */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

/* 팝업 레이아웃 - 팝업들을 플렉스로 배치 */
.popup-layout {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    width: 95%;
    max-width: 2000px;
    max-height: 90vh;
    gap: 30px;
    padding: 40px;
    overflow-y: auto;
    z-index: 10000;
}

/* 팝업 박스 */
.popup-box {
    position: relative;
    margin: 10px;
    z-index: 10001;
    width: 450px;
    height: 550px;
}

/* 기본 팝업 스타일 */
.popup {
    display: block;
    background-color: #ffffff !important;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    opacity: 0;
    animation: popup 0.5s forwards;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10001;
    display: flex;
    flex-direction: column;
}

/* 이미지 컨테이너 개선 */
.popup .img-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

/* 이미지 개선 - 무조건 컨테이너에 맞추기 */
.popup img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* 해상도 상관없이 강제로 채우기 */
    display: block;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.popup-footer {
    background-color: #ffffff;
    padding: 10px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    position: relative;
    z-index: 10002;
    height: 35px;
}

.popup-footer .text-r {
    text-align: right;
    margin-right: 10px;
}

.popup-footer span {
    cursor: pointer;
}

/* 팝업 애니메이션 */
@keyframes popup {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    padding: 5px 10px;
    font-size: 24px;
    color: #000;
    cursor: pointer;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10003;
}

/* X 버튼 호버 효과 */
.close-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* 공지사항 팝업 스타일 */
.popup-notice {
    background-color: #fff;
    border-radius: 10px;
    width: 550px;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.popup-notice .notice-content {
    position: relative;
    padding: 20px;
    border-radius: 8px;
    flex: 1;
    overflow-y: auto;
}

.popup-notice-title {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #D2D2D2;
    font-weight: bold;
}

.txt-color-red {
    color: red;
}

/* 스크롤바 스타일링 */
.popup-layout::-webkit-scrollbar,
.notice-content::-webkit-scrollbar {
    width: 8px;
}

.popup-layout::-webkit-scrollbar-track,
.notice-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.popup-layout::-webkit-scrollbar-thumb,
.notice-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.popup-layout::-webkit-scrollbar-thumb:hover,
.notice-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
    .popup-layout {
        width: 95%;
        gap: 20px;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .popup-layout {
        flex-direction: column;
        align-items: center;
        max-height: 85vh;
        gap: 15px;
        padding: 20px;
        width: 95%;
    }

    .popup-box,
    .popup-notice {
        width: 550px;
        height: 600px;
        max-width: 90vw;
        max-height: 90vw;
    }

    .popup img {
        width: 100%;
        height: 100%;
        object-fit: fill;
    }

    .popup-footer .text-r {
        font-size: 12px;
    }

    .close-btn {
        width: 25px;
        height: 25px;
        font-size: 18px;
    }
}

/* 모바일에서 스크롤 개선 */
@media (max-width: 480px) {
    .popup-layout {
        padding: 15px 10px;
        width: 100%;
    }

    .popup-box,
    .popup-notice {
        max-width: 95vw;
        max-height: 95vw;
    }
}