/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #ffffff;
    color: #333333;
    overflow-x: hidden;
    /* スクリーンショット対策 */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* アプリコンテナ */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* PDF表示エリア */
#pdf-container {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: #f5f5f5;
}

#pdf-canvas {
    max-width: 100%;
    max-height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
}

/* ローディング */
#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #666;
}

#loading.hidden {
    display: none;
}

/* ウォーターマーク */
.watermark-item {
    position: absolute;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-family: Arial, sans-serif;
    pointer-events: none;
    z-index: 10;
    white-space: pre-line;
    text-align: center;
    font-weight: bold;
}

/* バナー */
#banner {
    background-color: #B01F24;
    color: white;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 18px;
    font-weight: bold;
}

#banner:hover {
    background-color: #8E181C;
}

/* ページナビゲーション */
#navigation {
    background: white;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #e0e0e0;
}

.nav-btn {
    background: #B01F24;
    color: white;
    border: none;
    width: 50px;
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.nav-btn:hover:not(:disabled) {
    background: #8E181C;
}

/* 左右ボタンのhover効果（記号の色のみ変更） */
.nav-btn-left:hover:not(:disabled),
.nav-btn-right:hover:not(:disabled) {
    background: transparent;
    color: #8E181C;
}

/* 左右ボタンのactive効果（押下時） */
.nav-btn-left:active:not(:disabled),
.nav-btn-right:active:not(:disabled) {
    background: rgba(0, 0, 0, 0.02);
    color: #B01F24;
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 左右ボタンのdisabled状態 */
.nav-btn-left:disabled,
.nav-btn-right:disabled {
    background: transparent;
    color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 左右のナビゲーションボタン */
.nav-btn-left,
.nav-btn-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 90px;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    font-size: 36px;
    font-weight: bold;
    color: #B01F24;
    box-shadow: none;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn-left {
    left: 10px;
}

.nav-btn-right {
    right: 10px;
}

#page-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

#page-info:hover {
    background-color: rgba(176, 31, 36, 0.1);
}

/* 進捗バー */
#progress-dots {
    position: relative;
    width: 300px;
    height: 16px; /* より大きくして押しやすく */
    background-color: #ddd;
    border-radius: 8px;
    margin: 8px auto;
    cursor: pointer;
    z-index: 10;
}

#progress-dots:hover {
    background-color: #bbb;
    transform: scale(1.02); /* ホバー時に少し大きく */
    transition: all 0.2s ease;
}

.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: #B01F24;
    border-radius: 8px;
    transition: width 0.3s ease;
    pointer-events: none; /* クリックを親要素に透過 */
}

/* ドット表示は削除、バーのみ使用 */
.progress-dot {
    display: none;
}

/* ページカウンター */
#page-counter {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* レスポンシブ対応 */
@media (max-width: 767px) {
    /* モバイル */
    #pdf-container {
        padding: 10px;
    }
    
    #navigation {
        padding: 6px 15px;
    }
    
    .nav-btn {
        width: 45px;
        height: 36px;
        font-size: 16px;
    }
    
    /* モバイル用の左右ナビゲーションボタン */
    .nav-btn-left,
    .nav-btn-right {
        width: 80px;
        height: 100%;
        top: 0;
        bottom: 0;
        font-size: 32px;
        background: transparent;
        color: #B01F24;
        box-shadow: none;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 0;
    }
    
    .nav-btn-left {
        left: 5px;
    }
    
    .nav-btn-right {
        right: 5px;
    }
    
    /* モバイル用の左右ボタンactive効果 */
    .nav-btn-left:active:not(:disabled),
    .nav-btn-right:active:not(:disabled) {
        background: rgba(0, 0, 0, 0.02);
        color: #B01F24;
    }
    
    #banner {
        font-size: 16px;
        height: 70px;
    }
    
    #progress-dots {
        width: 250px;
        height: 14px; /* モバイルでも押しやすく */
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    /* タブレット */
    #pdf-container {
        padding: 15px;
    }
}

@media (min-width: 1024px) {
    /* デスクトップ */
    #app {
        max-width: 800px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
}

/* タッチ操作用のスタイル */
.touch-device .nav-btn {
    min-height: 44px; /* iOS推奨タッチターゲット */
}

/* スクリーンショット対策 */
html {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 右クリックメニュー無効化 */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ドラッグ無効化 */
img, canvas {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}