/* Action Builder - Inline chip-based action editor */

.action-builder {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Inline row: [Action ▾] [Column ▾] to [Value ▾] */
.action-builder-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Selectable chip button */
.action-builder-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.action-builder-chip:hover {
    background: var(--hover-bg);
    border-color: var(--blue-primary);
}

.action-builder-chip.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.action-builder-chip::after {
    content: '▾';
    font-size: 10px;
    margin-inline-start: 4px;
    opacity: 0.6;
}

/* Connector text ("to") */
.action-builder-connector {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 0 2px;
}

/* Popup styles */
.action-builder-popup {
    position: fixed;
    min-width: 180px;
    max-width: 300px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: var(--z-popup-deep, 10200);
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
}

.action-builder-popup.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.action-builder-popup-header {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.action-builder-popup-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.action-builder-popup-item:hover {
    background: var(--hover-bg);
}

/* Column navigation popup */
.action-builder-column-popup {
    max-height: 400px;
    overflow-y: auto;
}

/* Tree navigation */
.action-builder-tree {
    padding: 4px 0;
}

.action-builder-tree-item {
    /* Collapsed by default */
}

.action-builder-tree-content {
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.action-builder-tree-content:hover {
    background: var(--hover-bg);
}

.action-builder-tree-content::before {
    content: '';
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* Folder icon */
.action-builder-tree-folder > .action-builder-tree-content::before {
    content: '📁';
    font-size: 11px;
}

/* Board icon */
.action-builder-tree-board > .action-builder-tree-content::before {
    content: '📋';
    font-size: 11px;
}

/* Group icon */
.action-builder-tree-group > .action-builder-tree-content::before {
    content: '📊';
    font-size: 11px;
}

/* Column icon */
.action-builder-tree-column > .action-builder-tree-content::before {
    content: '•';
    font-size: 16px;
    color: var(--blue-primary);
}

/* Children container */
.action-builder-tree-children {
    display: none;
    padding-inline-start: 16px;
}

.action-builder-tree-item.expanded > .action-builder-tree-children {
    display: block;
}

/* Arrow indicator for expandable items */
.action-builder-tree-folder > .action-builder-tree-content::after,
.action-builder-tree-board > .action-builder-tree-content::after,
.action-builder-tree-group > .action-builder-tree-content::after {
    content: '›';
    margin-inline-start: auto;
    font-size: 14px;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.action-builder-tree-item.expanded > .action-builder-tree-content::after {
    transform: rotate(90deg);
}

/* Leaf items (columns) don't have arrow */
.action-builder-tree-leaf > .action-builder-tree-content::after {
    content: none;
}

/* Value input */
.action-builder-value-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--input-bg);
    border: none;
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.action-builder-value-input::placeholder {
    color: var(--text-secondary);
}
