/* 録画再生画面（/recordings/playback）専用スタイル。
   scoped CSS のキャッシュ取りこぼしを避けるためグローバルに定義する。
   クラス名は pb- 接頭辞で限定しているため他画面に影響しない。 */

/* ── リアルタイムステータス（再生連動） ───────────────────────────────── */
.pb-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 6px 20px;
}

.pb-status-item {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default, #eceff1);
}

.pb-status-label {
    font-size: 11px;
    color: var(--mud-palette-text-secondary, #9e9e9e);
    line-height: 1.4;
}

.pb-status-value {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    min-height: 1.6em;
}

/* ── タイムライン ─────────────────────────────────────────────────────── */
/* 固定幅のスクロール枠。解像度(ズーム)を上げてトラックが枠を超えると横スクロールになる。 */
.pb-timeline-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

/* pb-track の幅 = 24時間軸（インラインで zoom×100% を指定）。時刻ラベル・録画帯・
   シークバーはすべてこの幅に対する left/width(%) で配置するため、左右パディングは付けない。 */
.pb-track {
    position: relative;
    box-sizing: border-box;
    min-width: 100%;
    background: #1e1e1e;
    border-radius: 6px;
    padding: 22px 0 12px 0;
    user-select: none;
    cursor: pointer;
}

.pb-hours {
    position: absolute;
    top: 4px;
    left: 0;
    right: 0;
    height: 14px;
}

.pb-hour {
    position: absolute;
    transform: translateX(-50%);
    font-size: 10px;
    color: #9e9e9e;
    white-space: nowrap;
}

/* 目盛り線。ラベル位置（major）は長め・中間（minor）は短めの縦線をラベル帯の下端に引く。
   ラベル・線とも解像度（ズーム）に応じた間隔で playbackSync.js が動的に生成する。 */
.pb-tick {
    position: absolute;
    bottom: 0;
    width: 1px;
    height: 4px;
    background: rgba(158, 158, 158, 0.5);
    pointer-events: none;
}

.pb-tick-major {
    height: 6px;
    background: rgba(207, 207, 207, 0.75);
}

.pb-cam {
    margin: 8px 0;
}

.pb-cam-name {
    font-size: 10px;
    color: #cfcfcf;
    margin: 0 0 2px 4px;
    line-height: 1.2;
}

/* カメラごとの録画帯。上段=通常録画（赤）/ 下段=イベント録画（黄）の 2 段構成。
   段をクリックすると再生対象の種別が切り替わる（同一時刻の二重再生を防ぐため排他再生）。 */
.pb-cam-bar {
    position: relative;
    height: 14px;
    background: #2c2c2c;
    border-radius: 3px;
    overflow: hidden;
}

.pb-cam-bar + .pb-cam-bar {
    margin-top: 3px;
}

/* 段の左端に置く種別ラベル。絶対配置にして 24 時間軸の %(left/width) 配置を崩さない。 */
.pb-kind-label {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 2;
}

/* 選択中の段は白枠で強調し、非選択の段は減光する（ホバーでクリック可能なことを示す）。 */
.pb-row-selected {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}

.pb-row-unselected {
    opacity: 0.35;
}

.pb-row-unselected:hover {
    opacity: 0.7;
}

.pb-range {
    position: absolute;
    top: 0;
    height: 100%;
    min-width: 1px;
    border-radius: 2px;
}

.pb-normal {
    background: #e53935;
}

.pb-evt {
    background: #fdd835;
}

.pb-seek-handle {
    position: absolute;
    top: 18px;
    bottom: 8px;
    left: 0;
    width: 2px;
    background: #ffffff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
    cursor: ew-resize;
    z-index: 5;
}

.pb-seek-handle::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.6);
}

/* 凡例 */
.pb-legend-swatch {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 2px;
}
