/* ページ全体の余白を消す */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden; /* スクロールバーを防ぐ */
}

#main-layout {
    display: flex;
    width: 100vw;
    height: 100vh;
}

/* 広告用サイドバー */
#sidebar {
    width: 200px;
    flex-shrink: 0; /* 幅を縮めない */
    background-color: #f4f4f4;
    border-right: 1px solid #ccc;
    overflow-y: hidden;
}

/* PDFの入るメインエリア */
#main-content {
    flex-grow: 1; /* 残りの幅を全部使う */
    position: relative;
    overflow: hidden;
}

/* PDFとマスクを包むコンテナ */
#pdf-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
}

#pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: relative;
    z-index: 1; /* PDFを一番下に固定 */
}

/* 窓部分の色レイヤー */
#highlight-layer {
    position: absolute;
    left: 0px;
    width: calc(100% - 15px);
    z-index: 5; /* マスク(10)より下、PDFより上 */
    pointer-events: none;
    background-color: rgba(255, 255, 0, 0.2); /* 初期値：黄色 */
}

/* マスクの共通設定から背景色を分離（JSで操作するため） */
.mask {
    position: absolute;
    left: 0px;
    width: calc(100% - 15px);
    z-index: 10;
    pointer-events: none;
    background-color: rgb(0, 0, 0); /* 色は固定、透明度だけJSで変える */
}

/* ツールバー部分を避けるための設定 */
#mask-top {
    /* PDF.jsのツールバーの高さを考慮（約32px） */
    top: 32px !important; 
}

#mask-bottom {
    bottom: 0;
}

/* 設定パネルの見た目 */
.control-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999 !important;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-family: sans-serif;
    width: 200px;
}

.control-group {
    margin-bottom: 10px;
}

.control-group label {
    display: block;
    font-size: 12px;
    margin-bottom: 5px;
}

input[type="range"] {
    width: 100%;
}


.mini-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #333;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    bottom: 30px; 
    right: 30px;
}

.mini-btn:hover {
    background: #eee;
}

/* 前へ・次へボタンは少し色を変えてもOK */
#mini-prev-btn, #mini-next-btn {
    background: #f0f0f0;
}

#show-panel-btn {
    position: static; /* 親のflexに従うようにする */
    display: block;   /* 親が flex になったときに表示されるように */
}

#show-panel-btn:hover {
    background: #fff;
}

/* 説明書ボタンのスタイル */
#manual-btn {
    display: block;
    width: 100%;
    background-color: #e3f2fd; /* 薄い青色で「ヘルプ」感を出す */
    color: #1976d2;
    border: 1px solid #bbdefb;
    padding: 8px;
    border-radius: 4px;
    text-align: center;
    text-decoration: none; /* 下線を消す */
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-sizing: border-box; /* パディングを含めた幅計算 */
    transition: background 0.2s;
    margin-bottom: 5px;
}

#manual-btn:hover {
    background-color: #bbdefb;
    color: #0d47a1;
}
