/* =============================================
 * PDF Viewer Component Styles
 * Canvas ベースの PDF.js ビューワ用スタイル
 * iOS Safari のタッチ操作に最適化
 * ============================================= */

.pdf-viewer-container {
    display: flex;
    flex-direction: column;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: #f8f9fa;
}

/* ── ツールバー ── */
.pdf-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: #343a40;
    color: #fff;
    flex-shrink: 0;
    flex-wrap: wrap;
    user-select: none;
    -webkit-user-select: none;
}

.pdf-viewer-toolbar .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.2;
    min-width: 2.25rem;
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* タッチデバイスではボタンを少し大きく */
@media (pointer: coarse) {
    .pdf-viewer-toolbar .btn {
        min-width: 2.75rem;
        min-height: 2.75rem;
        font-size: 1rem;
    }
}

.pdf-page-info {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 4rem;
    text-align: center;
    white-space: nowrap;
}

.pdf-toolbar-separator {
    width: 1px;
    height: 1.5rem;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 0.25rem;
}

/* ── Canvas ラッパー ── */
.pdf-canvas-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 8px;
    background-color: #525659;

    /* iOS Safari スムーズスクロール */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.pdf-canvas {
    display: block;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── ローディング表示（オーバーレイ） ── */
.pdf-viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #adb5bd;
    font-size: 0.875rem;
    background-color: rgba(82, 86, 89, 0.9);
    z-index: 2;
}

.pdf-viewer-loading .spinner-border {
    width: 2rem;
    height: 2rem;
}

/* ── エラー表示（オーバーレイ） ── */
.pdf-viewer-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #dc3545;
    font-size: 0.875rem;
    text-align: center;
    background-color: rgba(82, 86, 89, 0.95);
    z-index: 2;
}

.pdf-viewer-error .error-icon {
    font-size: 2rem;
}
