/* =========================================================
   PDF Viewer layout (uses existing .go-btn / .primary styles)
   - Container height 확보
   - 한 페이지가 화면에 전부 들어오도록(스크롤 없이)
   - 버튼(이전/다음/페이지표시) 중앙 정렬
   ========================================================= */

/* main-menu-section을 "뷰어 전용" 레이아웃으로 */
#viewer-section{
    width: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;

    /* ✅ 화면에서 헤더 공간을 뺀 영역을 '정확히' 사용 */
    min-height: calc(100vh - 140px);
}

/* PDF 캔버스가 들어갈 영역 */

/* PDF 표시 영역 */
#pdf-viewer-container{
    width: min(1200px, 96vw);

    /* ✅ 남은 영역을 전부 먹게 */
    flex: 1;

    /* header 영역(140px) + 컨트롤 높이 고려 */
    height: calc(100vh - 140px - 110px);

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f6f6f6;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    overflow: hidden;
}

/* 캔버스는 JS가 width/height를 직접 세팅하므로 display만 정리 */
#pdf-viewer-canvas {
    display: block;
    /* JS에서 canvas.style.width/height를 지정하는 경우 자연스럽게 적용됨 */
}

.controls{
    width: min(1200px, 96vw);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.page-indicator{
    font-family:"SUIT Variable", sans-serif;
    font-size:18px;
    font-weight:600;
    color:#555;
    padding:0 6px;
    white-space:nowrap;
}

/* 아이콘 버튼 */
.icon-btn{
    width:44px;
    height:44px;
    border-radius:999px;
    border:1px solid rgba(0,0,0,0.08);
    background:#fff;
    color:#222;

    display:inline-flex;
    align-items:center;
    justify-content:center;

    cursor:pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
}

.icon-btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    background: #fafafa;
}

.icon-btn:active{
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.icon-btn:disabled{
    opacity: .45;
    cursor:not-allowed;
    transform:none;
    box-shadow:none;
}


/* 비활성 버튼 */
.controls button.go-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none; /* hover transform 방지 */
}

/* 모바일 */
@media (max-width: 600px){
    #viewer-section{
        padding: 16px 14px 20px;
    }

    #pdf-viewer-container,
    .pdf-controls{
        width: 96vw;
    }

    #pdf-viewer-container{
        height: calc(100vh - 140px - 120px);
        border-radius: 14px;
    }

    .controls{
        gap: 10px;
        padding: 14px 12px;
    }

    .page-indicator{
        order: 1;
        width: 100%;
        text-align: center;
        font-size: 14px;
        padding: 2px 0 6px;
    }

    /* 버튼을 한 줄로 다시 중앙 정렬 */
    .controls{
        align-items: center;
    }

    /* 좌우 버튼 간 간격 확보 */
    .controls{
        position: relative;
    }

    #prev-page,
    #next-page{
        margin: 0 14px;
    }

    /* 버튼 터치 영역 강조 */
    .icon-btn{
        width: 48px;
        height: 48px;
    }
}
