/* bd.css — BD cards, capacity bars, detail view */

.bd-detail {
    padding: 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bd-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.bd-detail-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.bd-size-label {
    font-size: 12px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 2px 8px;
    border-radius: 10px;
}

.bd-actions {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

/* Capacity bar */
.bd-capacity {
    margin-bottom: 16px;
}

.capacity-bar {
    height: 12px;
    background: var(--color-bg);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}

.capacity-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease, background 0.3s ease;
}

.capacity-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
}

/* Items list */
.bd-items-header {
    margin-bottom: 8px;
}

.bd-items-header h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.bd-items-list {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
}

.bd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    transition: background 0.1s;
}

.bd-item:hover {
    background: var(--color-surface);
}

.bd-item-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.bd-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.bd-item-size {
    flex-shrink: 0;
    color: var(--color-text-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* BD tree view */
.bd-tree-chevron {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    font-size: 10px;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: transform 0.15s;
    transform: rotate(0deg);
    user-select: none;
}

.bd-tree-chevron.expanded {
    transform: rotate(90deg);
}

.bd-tree-chevron-spacer {
    flex-shrink: 0;
    width: 16px;
}

.bd-tree-children {
    /* collapsible container for children */
}

/* BD folder drop target highlight */
.bd-folder-item.bd-folder-drop-target {
    outline: 2px dashed var(--color-primary, #6c9fff);
    outline-offset: -2px;
    background: rgba(108, 159, 255, 0.08);
}

/* Create folder button in BD header */
.btn-create-folder {
    font-size: 14px;
}

/* Subfolder add button */
.btn-add-subfolder {
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.15s;
}

.bd-tree-item:hover .btn-add-subfolder {
    opacity: 1;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
}

.btn-icon:hover {
    background: var(--color-danger);
    color: #fff;
}

.btn-delete-disk {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.btn-rename-disk,
.btn-rename-bd {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.sidebar-item {
    position: relative;
}

.sidebar-item:hover .btn-delete-disk,
.sidebar-item:hover .btn-rename-disk,
.sidebar-item:hover .btn-rename-bd {
    opacity: 1;
}

.btn-rename-disk:hover,
.btn-rename-bd:hover {
    background: var(--color-surface);
}

.btn-delete-disk:hover {
    background: var(--color-danger);
    color: #fff;
}

/* Drop zone */
.bd-drop-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 13px;
    transition: border-color 0.2s, background 0.2s;
}

.bd-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(108, 159, 255, 0.05);
}

.bd-drop-zone.drag-reject {
    border-color: var(--color-danger);
    background: rgba(238, 85, 85, 0.05);
}
