/* =============================================================================
   7. DYNAMIC LIST ITEMS — HARDWARE ACCELERATED DRAG ENGINE
   ============================================================================= */

.items-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 1rem;
}

.list-item {
    background: var(--color-bg-input);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    position: relative;
    transform: translate3d(0, 0, 0); 
    transition: box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
    will-change: transform;
}

.list-item:hover {
    border-color: var(--color-border-hov);
}

.list-item:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 2px 10px -2px rgba(37, 99, 235, 0.18);
}

/* Item WHILE it is being dragged */
.list-item.dragging {
    position: fixed !important;
    z-index: var(--z-modal) !important;
    opacity: 0.96;
    box-shadow: var(--shadow-xl), 0 0 0 2px var(--color-primary);
    background: var(--color-bg-panel);
    border-color: var(--color-primary);
    cursor: grabbing;
    pointer-events: none !important;
    transform-origin: center center;
}

.item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    user-select: none;
}

.item-number {
    font-size: var(--text-xs);
    font-weight: var(--fw-bold);
    color: var(--color-text-mute);
    letter-spacing: 0.05em;
}

.item-actions {
    display: flex;
    gap: 4px;
}

.item-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-mute);
    font-size: 0.88rem;
    transition: all var(--dur-fast) var(--ease-out);
    cursor: grab;
    touch-action: none; 
    -webkit-tap-highlight-color: transparent;
}

.item-btn:hover {
    background: var(--color-bg-panel);
    color: var(--color-text-main);
    box-shadow: var(--shadow-sm);
}

.item-btn.delete:hover {
    background: var(--red-50);
    color: var(--color-danger);
}

[data-theme="dark"] .item-btn.delete:hover {
    background: rgba(239, 68, 68, 0.18);
}

.item-btn:active {
    cursor: grabbing;
}

.item-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.item-input {
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: var(--text-sm);
    font-weight: var(--fw-medium);
    transition: all var(--dur-fast) var(--ease-out);
    color: var(--color-text-main);
    -webkit-appearance: none;
    appearance: none;
}

.item-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-ring);
}

.item-input.full-width {
    grid-column: 1 / -1;
}

.item-textarea {
    grid-column: 1 / -1;
    min-height: 64px;
    resize: vertical;
    background: var(--color-bg-panel);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: var(--text-sm);
    font-family: inherit;
    line-height: var(--lh-norm);
    font-weight: var(--fw-medium);
    transition: all var(--dur-fast) var(--ease-out);
    color: var(--color-text-main);
    field-sizing: content;
    -webkit-appearance: none;
    appearance: none;
}

.item-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-ring);
}

/* Drag Placeholder Slot */
.drag-placeholder {
    background: var(--color-primary-sub);
    border: 2px dashed var(--color-primary);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    transition: all 0.1s ease;
    opacity: 0.5;
}
