@charset "utf-8";

/*
 * rumiPopup CSS
 * 제작자: 조정영(루미집사)
 * 업데이트: 2024.11.01
 * 웹접근성 및 모던 CSS 적용
 */

/* ==========================================================================
   팝업 오버레이 및 컨테이너
   ========================================================================== */

/* 팝업 오버레이 배경 */
.rumi-popup-overlay,
#rumipopup_sub {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9998;
    border: 0;
}

/* 팝업 컨테이너 */
.rumi-popup-container,
#rumipopup {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    z-index: 9999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* width, height, max-width, max-height는 JavaScript에서 동적으로 설정 */
}

/* ==========================================================================
   팝업 헤더
   ========================================================================== */

.rumi-popup-header,
#rumipopup #rumiHead {
    position: relative;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
    flex-shrink: 0;
}

/* 팝업 제목 */
.rumi-popup-header .rumiTitle,
#rumipopup .rumiTitle {
    background: #f8f9fa;
    width: 100%;
    height: 50px;
    line-height: 50px;
    font-size: 16px;
    font-weight: 600;
    padding: 0 60px 0 20px;
    margin: 0;
    color: #495057;
    border: 0;
}

/* 닫기 버튼 */
.rumi-popup-header .rumiClose,
#rumipopup .rumiClose {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    border: 0;
    background: transparent;
    font-size: 18px;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rumi-popup-header .rumiClose:hover,
#rumipopup .rumiClose:hover {
    background: #e9ecef;
    color: #dc3545;
}

.rumi-popup-header .rumiClose:focus,
#rumipopup .rumiClose:focus {
    outline: 2px solid #007bff;
    outline-offset: -2px;
}

/* ==========================================================================
   팝업 메인 콘텐츠
   ========================================================================== */

.rumi-popup-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* iframe 스타일 */
.rumi-popup-content .rumiIframe,
#rumipopup .rumiIframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
	padding: 0px 0px 50px 20px;
}

/* 일반 콘텐츠 */
.rumi-popup-content .pop_inbox,
#rumipopup .pop_inbox {
    width: 100%;
    height: 100%;
    padding: 20px;
    background: #fff;
    overflow: auto;
    box-sizing: border-box;
}

/* ==========================================================================
   팝업 푸터
   ========================================================================== */

.rumi-popup-footer,
#rumipopup .rumiButton {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0px 10px;
    text-align: right;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    box-sizing: border-box;
}

/* 새로고침 버튼 영역 */
.rumi-popup-footer .rumiReload,
#rumipopup .rumiReload {
    display: inline-block;
}

/* 버튼 그룹 */
.rumi-popup-footer .rumiButton {
    display: flex;
    gap: 10px;
}

/* ==========================================================================
   버튼 스타일
   ========================================================================== */

.rumi_btn,
.rumi-popup-footer button {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #007bff;
    color: #fff;
    outline: none;
}

.rumi_btn:hover,
.rumi-popup-footer button:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.rumi_btn:focus,
.rumi-popup-footer button:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.rumi_btn:active,
.rumi-popup-footer button:active {
    transform: translateY(0);
}

/* 새로고침 버튼 */
.rumiReload .rumi_btn {
    background: #6c757d;
}

.rumiReload .rumi_btn:hover {
    background: #545b62;
}

/* ==========================================================================
   아이콘 스타일
   ========================================================================== */

.fa-folder-open {
    font-size: 16px;
    vertical-align: middle;
    margin-right: 8px;
    color: #007bff;
}

/* ==========================================================================
   웹접근성 지원
   ========================================================================== */

/* 스크린 리더 전용 텍스트 */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 스크롤 고정 */
.rumi_html_fixed {
    position: fixed !important;
    width: 100% !important;
    overflow-y: scroll !important;
}

/* ==========================================================================
   반응형 디자인
   ========================================================================== */

/* 태블릿 및 모바일 */
@media only screen and (max-width: 1024px) {
    .rumi-popup-container,
    #rumipopup {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0;
        transform: none;
        top: 0;
        left: 0;
    }

    .rumi-popup-header .rumiTitle,
    #rumipopup .rumiTitle {
        font-size: 18px;
        height: 60px;
        line-height: 60px;
        padding-left: 20px;
    }

    .rumi-popup-header .rumiClose,
    #rumipopup .rumiClose {
        width: 60px;
        height: 60px;
        font-size: 20px;
    }

    .rumi-popup-footer,
    #rumipopup .rumiButton {
        padding: 20px;
        /* min-height: 80px; */
    }

    .rumi_btn,
    .rumi-popup-footer button {
        padding: 8px 20px;
        font-size: 16px;
        min-height: 44px; /* 터치 타겟 최소 크기 */
    }
}

/* 모바일 */
@media only screen and (max-width: 480px) {
    .rumi-popup-header .rumiTitle,
    #rumipopup .rumiTitle {
        font-size: 16px;
        padding-right: 70px; /* 닫기 버튼 공간 확보 */
    }

    .rumi-popup-footer,
    #rumipopup .rumiButton {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .rumi-popup-footer .rumiButton {
        flex-direction: column;
        width: 100%;
		padding: 0 !important;
    }

    .rumi_btn,
    .rumi-popup-footer button {
        width: 100%;
        margin: 0;
    }
}

/* ==========================================================================
   다크모드 지원 (선택사항)
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    .rumi-popup-container,
    #rumipopup {
        background-color: #2d3748;
        color: #e2e8f0;
    }

    .rumi-popup-header,
    #rumipopup #rumiHead {
        background: #4a5568;
        border-bottom-color: #2d3748;
    }

    .rumi-popup-header .rumiTitle,
    #rumipopup .rumiTitle {
        background: #4a5568;
        color: #e2e8f0;
    }

    .rumi-popup-footer,
    #rumipopup .rumiButton {
        background: #4a5568;
        border-top-color: #2d3748;
    }

    .rumi-popup-content .pop_inbox,
    #rumipopup .pop_inbox {
        background: #2d3748;
        color: #e2e8f0;
    }
}
