/* ProPresenter: the slide browser (shared by the plan builder's picker and the Slides page) and
   the activity timeline.

   Lifted out of PlanBuilder.razor's page-local <style> when the picker became a shared component —
   two copies of this would have drifted the moment either page was touched. Colours are all
   translucent tints or theme tokens rather than fixed light values, so everything adapts to the
   portal's light and dark surfaces. */

/* ── The deck list + preview pane ─────────────────────────────────────────────────────────── */

.pp-picker { display: flex; gap: 16px; height: calc(88vh - 140px); }
.pp-picker-page { height: calc(100vh - 260px); min-height: 420px; }
.pp-list-pane { flex: 0 0 320px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pp-preview-pane { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.pp-search { width: 100%; }

.pp-list {
    border: 1px solid var(--hb-border, #dee2e6); border-radius: 8px;
    flex: 1 1 auto; overflow-y: auto; min-height: 0;
}

.pp-row { padding: 7px 10px; cursor: pointer; border-bottom: 1px solid var(--hb-border, #eee); }
.pp-row:last-child { border-bottom: none; }
.pp-row:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.pp-row-active,
.pp-row-active:hover {
    background: color-mix(in srgb, var(--hb-accent, #512BD4) 16%, transparent);
    box-shadow: inset 3px 0 0 var(--hb-accent, #512BD4);
}
.pp-row-active:hover { background: color-mix(in srgb, var(--hb-accent, #512BD4) 24%, transparent); }
.pp-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pp-row-name { font-weight: 500; font-size: .88rem; min-width: 0; overflow-wrap: anywhere; }
.pp-row-flag { flex: none; }
.pp-row-sub { font-size: .72rem; color: var(--hb-muted, #6c757d); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 2px; }

/* Above the slides: what you can do with the deck on the left, how you look at it on the right. */
.pp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pp-toolbar-danger { margin-left: 8px; }
.pp-caption { margin-bottom: 6px; }
.pp-toolbar-end { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.pp-zoom { display: flex; align-items: center; gap: 8px; color: var(--hb-muted, #6c757d); }
.pp-zoom .fa-image { font-size: .95rem; }
.pp-zoom .pp-zoom-small { font-size: .7rem; }

.pp-slides { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow-y: auto; flex: 1 1 auto; min-height: 0; align-content: start; }
.pp-slide { border: 1px solid var(--hb-border, #dee2e6); border-radius: 6px; overflow: hidden; position: relative; background: #000; }
.pp-slide img { display: block; width: 100%; height: auto; }
.pp-slide-noimg { padding: 14px 8px; font-size: .72rem; color: #eee; white-space: pre-wrap; min-height: 84px; }
.pp-slide-cap {
    position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff;
    font-size: .66rem; border-radius: 10px; padding: 1px 7px;
}

.pp-text {
    width: 100%; min-height: 420px; font-family: inherit; font-size: .85rem;
    border: 1px solid var(--hb-border, #dee2e6); border-radius: 8px; padding: 10px; white-space: pre-wrap;
    background: var(--color-sf-content-bg-color, var(--hb-card-bg, #fff)); color: var(--hb-fg, #212529);
}

/* ── Usage shading ────────────────────────────────────────────────────────────────────────── */
/* How much a slide is actually used. Shown as a labelled band as well as a tint, because a colour
   on its own says nothing to anyone who can't separate these hues. */

.pp-slide-heat { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.pp-slide-use {
    position: absolute; top: 4px; left: 4px; background: rgba(0,0,0,.6); color: #fff;
    font-size: .66rem; border-radius: 10px; padding: 1px 7px;
}
.pp-slide-unused { opacity: .55; }

/* ── The activity timeline ────────────────────────────────────────────────────────────────── */
/* A real time axis, unlike plan-segments.css's .seg-timeline, which is proportional-flex. One
   swimlane per capture PC so two machines running at once read as two machines. */

.pp-tl { display: flex; flex-direction: column; gap: 10px; }
.pp-tl-lane { border: 1px solid var(--hb-border, #dee2e6); border-radius: 8px; padding: 8px 10px 12px; }
.pp-tl-lane-head {
    display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600;
    margin-bottom: 8px; color: var(--hb-fg, #212529);
}
.pp-tl-zoom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pp-tl-range { padding: 4px 8px 14px; }
.pp-tl-track { position: relative; height: 46px; overflow: hidden; background: color-mix(in srgb, currentColor 5%, transparent); border-radius: 5px; }
.pp-tl-slide {
    position: absolute; top: 6px; height: 22px; border-radius: 3px; overflow: hidden;
    background: color-mix(in srgb, var(--hb-accent, #512BD4) 45%, transparent);
    border: 1px solid color-mix(in srgb, var(--hb-accent, #512BD4) 70%, transparent);
    font-size: .62rem; line-height: 20px; padding: 0 4px; white-space: nowrap; color: var(--hb-fg, #212529);
    cursor: default;
}
/* A slide with no recorded end could have been up for hours or could be the moment the capture
   service died. Hatched rather than solid so it never reads as a measurement. */
.pp-tl-slide-open {
    background: repeating-linear-gradient(45deg,
        color-mix(in srgb, var(--hb-accent, #512BD4) 40%, transparent) 0 6px,
        transparent 6px 12px);
}
.pp-tl-event {
    position: absolute; bottom: 4px; width: 2px; height: 14px;
    background: var(--hb-fg, #212529); opacity: .75; cursor: default;
}
.pp-tl-event::after {
    content: ''; position: absolute; top: -4px; left: -3px; width: 8px; height: 8px;
    border-radius: 50%; background: inherit;
}
.pp-tl-axis { position: relative; height: 18px; margin-top: 2px; font-size: .66rem; color: var(--hb-muted, #6c757d); }
.pp-tl-tick { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pp-tl-empty { padding: 24px; text-align: center; color: var(--hb-muted, #6c757d); font-size: .85rem; }

/* ── Machine cards ────────────────────────────────────────────────────────────────────────── */

.pp-machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pp-machine { border: 1px solid var(--hb-border, #dee2e6); border-radius: 10px; padding: 14px 16px; background: var(--hb-card-bg, #fff); }
.pp-machine-name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pp-machine-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 12px; font-size: .78rem; }
.pp-machine-stat-label { color: var(--hb-muted, #6c757d); }
.pp-machine-stat-value { font-weight: 600; }
.pp-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.pp-dot-ok { background: #2a9d8f; }
.pp-dot-warn { background: #f77f00; }
.pp-dot-off { background: var(--hb-muted, #6c757d); }

/* ── Rules workbench ──────────────────────────────────────────────────────────────────────── */

.pp-rule { border: 1px solid var(--hb-border, #dee2e6); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.pp-rule-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pp-rule-label { font-weight: 600; font-size: .88rem; }
.pp-rule-meta { font-size: .74rem; color: var(--hb-muted, #6c757d); }
.pp-rule-flag { font-size: .72rem; border-radius: 10px; padding: 1px 9px; display: inline-block; }
.pp-rule-flag-bad { background: color-mix(in srgb, #e63946 18%, transparent); }
.pp-rule-flag-warn { background: color-mix(in srgb, #f77f00 22%, transparent); }
.pp-rule-flag-ok { background: color-mix(in srgb, #2a9d8f 20%, transparent); }

@media (max-width: 767.98px) {
    .pp-picker { flex-direction: column; height: auto; }
    .pp-picker-page { height: auto; }
    .pp-list-pane { flex-basis: auto; }
    .pp-list { max-height: 260px; }
    .pp-machine-stats { grid-template-columns: 1fr; }
}
