﻿/* Action recognition workbench styles. */

.human-action-controls {
    display: grid;
    align-content: start;
    gap: 12px;
}

.human-action-workbench {
    grid-template-columns: minmax(205px, 0.58fr) minmax(500px, 1.66fr) minmax(240px, 0.62fr);
}

.human-action-controls .human-button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.human-action-controls [data-action-run-video] {
    grid-column: 1 / -1;
}

.human-action-video-picker {
    margin-top: -2px;
}

.human-action-video-source {
    display: none;
}

.human-action-stage {
    min-height: 590px;
}

.human-action-stage-body {
    display: grid;
    gap: 14px;
    padding: 14px;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        linear-gradient(0deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        #f8fbff;
    background-size: 28px 28px;
}

.human-action-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.human-action-toolbar span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 0 10px;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 900;
}

.human-action-flow {
    display: grid;
    grid-template-columns: minmax(220px, 1.25fr) minmax(170px, 0.9fr) minmax(190px, 0.95fr);
    gap: 10px;
    align-items: stretch;
}

.human-action-flow-card {
    position: relative;
    display: grid;
    grid-template-rows: auto minmax(118px, 1fr) auto;
    gap: 8px;
    min-height: 192px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.07);
    transition: border-color 260ms var(--pose-motion), box-shadow 260ms var(--pose-motion), transform 260ms var(--pose-motion);
}

.human-action-flow-card:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: 50%;
    right: -11px;
    width: 12px;
    height: 2px;
    background: linear-gradient(90deg, #93c5fd, var(--pose-cyan));
    transform: translateY(-50%);
}

.human-action-flow-card.is-active {
    border-color: #93c5fd;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.12);
    animation: posePulsePanel 760ms var(--pose-motion) both;
}

.human-action-flow-card.is-done {
    border-color: #bae6fd;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

.human-action-flow-head {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #172554;
    font-size: 12px;
    font-weight: 950;
}

.human-action-flow-head span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--pose-blue), var(--pose-cyan));
    font-size: 11px;
    box-shadow: 0 8px 14px rgba(37, 99, 235, 0.18);
}

.human-action-flow-card p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.human-action-video-preview-shell,
.human-action-flow-skeleton {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    max-height: 184px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(37, 99, 235, 0.05) 1px, transparent 1px),
        #eef6ff;
    background-size: 22px 22px;
}

.human-action-video-preview-shell {
    aspect-ratio: 16 / 9;
}

.human-action-video-preview {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #eef6ff;
}

.human-action-video-preview-shell b {
    position: absolute;
    left: 8px;
    top: 8px;
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid rgba(191, 219, 254, 0.9);
    border-radius: 999px;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.86);
    font-size: 10px;
    font-weight: 950;
    pointer-events: none;
}

.human-action-flow-skeleton {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
}

.human-action-flow-skeleton svg {
    width: 100%;
    height: 100%;
}

.human-action-flow-skeleton line {
    stroke: var(--pose-cyan);
    stroke-width: 3.2;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 3px rgba(14, 165, 233, 0.16));
}

.human-action-flow-skeleton circle {
    fill: rgba(255, 255, 255, 0.82);
    stroke: var(--pose-blue);
    stroke-width: 2.2;
}

.human-action-flow-skeleton.is-real circle {
    fill: rgba(255, 255, 255, 0.72);
    stroke: var(--pose-orange);
}

.human-action-flow-prob {
    display: grid;
    align-content: center;
    gap: 8px;
    min-height: 118px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 10px;
    background: #f8fbff;
}

.human-action-flow-prob div {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 8px;
}

.human-action-flow-prob span,
.human-action-flow-prob strong {
    color: #334155;
    font-size: 11px;
    font-weight: 900;
}

.human-action-flow-prob i {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pose-blue), var(--pose-cyan));
    transition: width 620ms var(--pose-motion);
}

.human-action-flow-prob div.is-top i {
    background: linear-gradient(90deg, #2563eb, #f59e0b);
}

.human-action-clip {
    position: relative;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.08);
}

.human-frame-strip {
    --action-frame-count: 8;
    position: relative;
    display: grid;
    grid-template-columns: repeat(var(--action-frame-count), minmax(78px, 1fr));
    gap: 9px;
    padding: 18px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}

.human-frame-strip article {
    position: relative;
    display: grid;
    gap: 8px;
    min-width: 78px;
    border: 1px solid #dbeafe;
    border-radius: 13px;
    padding: 8px;
    background: #ffffff;
    scroll-snap-align: start;
    cursor: pointer;
    transition: border-color 240ms var(--pose-motion), box-shadow 240ms var(--pose-motion), transform 240ms var(--pose-motion);
}

.human-frame-strip article:hover,
.human-frame-strip article.is-active {
    transform: translateY(-2px);
    border-color: var(--pose-orange);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.14);
    animation: posePulsePanel 700ms var(--pose-motion) both;
}

.human-frame-strip article.is-in-window:not(.is-active) {
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.human-frame-strip span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
}

.human-frame-visual {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 10px;
    background: #eef6ff;
}

.human-frame-rgb {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, hsla(var(--frame-hue, 204), 90%, 86%, 0.92) 0%, rgba(255,255,255,0.92) 48%, hsla(var(--frame-hue, 204), 76%, 88%, 0.92) 100%),
        linear-gradient(90deg, transparent 0 24%, rgba(37, 99, 235, 0.1) 24% 26%, transparent 26% 54%, rgba(18, 181, 208, 0.13) 54% 56%, transparent 56%),
        #eef6ff;
}

.human-frame-rgb::before,
.human-frame-rgb::after {
    content: "";
    position: absolute;
    border-radius: 999px;
}

.human-frame-rgb::before {
    left: calc(18% + var(--motion-shift, 0) * 14%);
    bottom: 10%;
    width: 34%;
    height: 8%;
    background: rgba(37, 99, 235, 0.14);
}

.human-frame-rgb::after {
    right: 10%;
    top: 16%;
    width: 18%;
    height: 28%;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 0.44);
}

.human-frame-strip article.has-video-frame .human-frame-rgb {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: saturate(1.03) contrast(1.02);
}

.human-frame-strip article.has-video-frame .human-frame-rgb::before,
.human-frame-strip article.has-video-frame .human-frame-rgb::after {
    display: none;
}

.human-frame-skeleton {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
}

.human-frame-skeleton svg {
    width: 100%;
    height: 100%;
}

.human-action-pose-bbox {
    fill: rgba(245, 158, 11, 0.06);
    stroke: rgba(245, 158, 11, 0.82);
    stroke-width: 1.4;
    stroke-dasharray: 3 2;
}

.human-frame-skeleton line {
    stroke: var(--pose-cyan);
    stroke-width: 3.6;
    stroke-linecap: round;
    filter: drop-shadow(0 2px 3px rgba(14, 165, 233, 0.18));
}

.human-frame-skeleton circle {
    fill: #ffffff;
    stroke: var(--pose-blue);
    stroke-width: 2.6;
}

.human-action-workbench.hide-rgb .human-frame-rgb {
    opacity: 0.16;
    filter: grayscale(1);
}

.human-action-workbench.hide-skeleton .human-frame-skeleton {
    display: none;
}

.human-action-workbench.hide-skeleton .human-action-flow-skeleton svg {
    opacity: 0.18;
}

.human-action-workbench.hide-window .human-conv-window {
    display: none;
}

.human-action-workbench.is-video-busy .vision-status-chip {
    animation: posePulsePanel 780ms var(--pose-motion) infinite;
}

.human-conv-window {
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: calc(18px + (100% - 36px) * var(--window-start, 0) / var(--frame-count, 8));
    width: calc((100% - 36px - 9px * (var(--frame-count, 8) - 1)) * var(--window-size, 4) / var(--frame-count, 8) + 9px * (var(--window-size, 4) - 1));
    border: 2px solid rgba(245, 158, 11, 0.9);
    border-radius: 16px;
    background: rgba(245, 158, 11, 0.08);
    pointer-events: none;
    transition: left 520ms var(--pose-motion), width 360ms var(--pose-motion), opacity 300ms var(--pose-motion);
    box-shadow: 0 12px 26px rgba(245, 158, 11, 0.16);
}

.human-action-feature-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.human-action-feature-row article {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 138px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    padding: 12px;
    background: #ffffff;
}

.human-action-feature-row span {
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
}

.human-action-feature-row strong {
    color: #172554;
    font-size: 18px;
}

.human-action-feature-row small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.human-action-cube {
    position: relative;
    width: 92px;
    height: 68px;
    margin: 2px 0;
}

.human-action-cube i {
    position: absolute;
    width: 58px;
    height: 42px;
    border: 1px solid #93c5fd;
    border-radius: 10px;
    background: rgba(239, 246, 255, 0.88);
    box-shadow: 0 8px 14px rgba(37, 99, 235, 0.08);
}

.human-action-cube i:nth-child(1) {
    left: 0;
    top: 18px;
}

.human-action-cube i:nth-child(2) {
    left: 16px;
    top: 9px;
    background: rgba(219, 234, 254, 0.88);
}

.human-action-cube i:nth-child(3) {
    left: 32px;
    top: 0;
    border-color: var(--pose-orange);
    background: rgba(245, 158, 11, 0.16);
}

.human-action-feature-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 5px;
}

.human-action-feature-grid i {
    aspect-ratio: 1;
    border-radius: 5px;
    background: linear-gradient(145deg, #eff6ff, #dbeafe);
    transition: transform 360ms var(--pose-motion), background 360ms var(--pose-motion);
}

.human-action-feature-grid i.is-active {
    transform: scale(1.08);
    background: linear-gradient(145deg, rgba(18, 181, 208, 0.42), rgba(37, 99, 235, 0.3));
    animation: poseMerge 520ms var(--pose-motion) both;
}

.human-action-pipeline {
    grid-template-columns: 1fr 16px 1fr 16px 1fr 16px 1fr 16px 1fr;
    padding: 0;
    margin-top: 0;
}

.human-action-pipeline article {
    min-height: 102px;
    cursor: pointer;
    transition: border-color 240ms var(--pose-motion), box-shadow 240ms var(--pose-motion), transform 240ms var(--pose-motion);
}

.human-action-pipeline article.is-active {
    border-color: var(--pose-blue);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
    animation: posePulsePanel 700ms var(--pose-motion) both;
}

.human-action-pipeline article.is-done {
    border-color: #bae6fd;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
}

.human-action-stepper li {
    cursor: pointer;
}

.human-probability-list {
    display: grid;
    gap: 10px;
}

.human-probability-list div {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 10px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    padding: 9px 10px;
    background: #ffffff;
}

.human-probability-list div.is-top {
    border-color: #93c5fd;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%);
    animation: poseCollision 720ms var(--pose-motion) both;
}

.human-probability-list span,
.human-probability-list strong {
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.human-probability-list i {
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--pose-blue), var(--pose-cyan));
    transition: width 620ms var(--pose-motion);
}

@media (max-width: 980px) {
    .human-action-flow {
        grid-template-columns: 1fr;
    }

    .human-action-flow-card:not(:last-child)::after {
        display: none;
    }
}

