/* PDFビューア全体のコンテナ */
.simple-pdf-viewer {
    width: 100%;
    max-width: 900px; /* PCでの最大幅を900pxに設定 */
    margin: 0 auto;   /* PC表示時に中央揃えにする */
}

/* ローディング表示 */
.pdf-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    position: relative;
}

/* シンプルなスピナーアニメーション */
.pdf-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #666;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* エラー表示 */
.pdf-error {
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
    font-size: 16px;
}

/* 各ページのコンテナ */
.pdf-page-container {
    position: relative;
    margin: 0 auto 20px auto; /* ページ下の余白 */
    line-height: 0;
}

/* 描画されるキャンバス */
.pdf-page-container canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* テキスト選択用の透明レイヤー */
.pdf-text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.pdf-text-layer > span {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0% 0%;
    user-select: text;
}

/* テキスト選択時のハイライト色 */
.pdf-text-layer ::selection {
    background: rgba(0, 123, 255, 0.3);
}

/* --- レスポンシブ設定 --- */
/* 画面幅が768px以下のデバイス（スマホなど）に適用 */
@media screen and (max-width: 768px) {
    .simple-pdf-viewer {
        max-width: 100%;
    }

    .pdf-page-container {
        margin-bottom: 10px;
    }
    
    .pdf-loading,
    .pdf-error {
        padding: 20px 10px;
        font-size: 14px;
    }
}