.root {
    display: grid;
    width: 100%;
    gap: var(--space-2);
}

.disabled {
    opacity: 0.72;
}

.input {
    display: none;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.label {
    color: var(--text-secondary);
    font-weight: 650;
}

.type {
    color: var(--text-tertiary);
    font-size: var(--admin-font-size);
}

.panel {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-input);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.previewArea {
    position: relative;
}

.preview {
    position: relative;
    display: flex;
    width: 100%;
    height: 168px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(45deg, rgba(100, 116, 139, 0.08) 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(45deg, transparent 75%, rgba(100, 116, 139, 0.08) 75%) 0 0 / 16px 16px,
        linear-gradient(45deg, transparent 75%, rgba(100, 116, 139, 0.08) 75%) 8px 8px / 16px 16px,
        linear-gradient(45deg, rgba(100, 116, 139, 0.08) 25%, transparent 25%) 8px 8px / 16px 16px,
        var(--bg-card-strong);
    color: var(--text-tertiary);
    cursor: pointer;
}

.preview:disabled {
    cursor: not-allowed;
}

.previewActions {
    position: absolute;
    z-index: 1;
    top: var(--space-2);
    right: var(--space-2);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.previewAction {
    display: inline-flex;
    width: var(--control-height);
    height: var(--control-height);
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-flyout);
    box-shadow: var(--shadow-soft);
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        border-color var(--motion-fast) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard),
        background var(--motion-fast) var(--ease-standard),
        transform var(--motion-base) var(--ease-emphasized);
}

.previewAction:hover:not(:disabled) {
    border-color: var(--primary-border);
    background: var(--primary-hover);
    color: var(--primary);
    transform: translateY(-1px);
}

.previewAction:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

.previewAction:disabled {
    cursor: wait;
    opacity: 0.6;
}

.image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.empty {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    color: var(--text-tertiary);
    font-weight: 650;
}

.empty svg {
    width: 28px;
    height: 28px;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.68);
    color: var(--primary);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.player {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.playerSurface {
    width: 100%;
    height: 100%;
}

.playerSurface canvas {
    display: block;
}

.pagCanvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.footer {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
}

.name {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.actions {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--space-2);
}

.action {
    display: inline-flex;
    height: var(--control-height);
    min-width: var(--control-height);
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: 0 var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background: var(--bg-input-strong);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--admin-font-size);
    line-height: var(--admin-line-height);
    transition:
        border-color var(--motion-fast) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard),
        background var(--motion-fast) var(--ease-standard);
}

.action:hover:not(:disabled) {
    border-color: var(--primary-border);
    background: var(--primary-hover);
    color: var(--primary);
}

.action:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

.videoPreviewFrame {
    display: flex;
    width: 100%;
    min-height: 320px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    background:
        linear-gradient(45deg, rgba(100, 116, 139, 0.08) 25%, transparent 25%) 0 0 / 16px 16px,
        linear-gradient(45deg, transparent 75%, rgba(100, 116, 139, 0.08) 75%) 0 0 / 16px 16px,
        linear-gradient(45deg, transparent 75%, rgba(100, 116, 139, 0.08) 75%) 8px 8px / 16px 16px,
        linear-gradient(45deg, rgba(100, 116, 139, 0.08) 25%, transparent 25%) 8px 8px / 16px 16px,
        var(--bg-card-strong);
}

.videoPreview {
    display: block;
    width: 100%;
    max-height: min(68vh, 640px);
    object-fit: contain;
}

.compact {
    gap: var(--space-1);
}

.compact .label {
    font-size: 13px;
}

.compact .type,
.compact .name,
.compact .action {
    font-size: 12px;
}

.compact .preview {
    height: 112px;
}

.compact .previewAction {
    width: 28px;
    height: 28px;
}

.compact .empty svg {
    width: 22px;
    height: 22px;
}

.compact .footer {
    min-height: 40px;
    padding: var(--space-1) var(--space-2);
}

.compact .action {
    height: 28px;
    min-width: 28px;
    padding: 0 var(--space-2);
}
