/* Sound Box — Cross-tool audio dock */

/* ─── Dock Container ─── */
.soundbox-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9000;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    transition: height 0.25s ease;
    display: flex;
    flex-direction: column;
}
.soundbox-dock.collapsed { height: 36px; }
.soundbox-dock.expanded  { height: 220px; }

/* ─── Header Bar ─── */
.soundbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 36px;
    min-height: 36px;
    cursor: pointer;
    user-select: none;
}
.soundbox-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.5px;
}
.soundbox-title .sb-icon {
    font-size: 14px;
}
.soundbox-count {
    font-size: 11px;
    color: var(--dim);
    font-weight: 600;
}
.soundbox-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.soundbox-btn {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--surface2);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.soundbox-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}
.soundbox-btn.sb-clear:hover {
    border-color: var(--pink);
    color: var(--pink);
}
.soundbox-toggle {
    padding: 4px 8px;
    border: none;
    background: none;
    color: var(--dim);
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.25s;
}
.soundbox-dock.expanded .soundbox-toggle { transform: rotate(180deg); }

/* ─── Tray (items area) ─── */
.soundbox-tray {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}
.soundbox-tray::-webkit-scrollbar { height: 5px; }
.soundbox-tray::-webkit-scrollbar-track { background: transparent; }
.soundbox-tray::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.soundbox-dock.collapsed .soundbox-tray { display: none; }

/* ─── Empty State ─── */
.soundbox-empty {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dim);
    font-size: 12px;
    font-style: italic;
    padding: 40px 0;
}

/* ─── Item Cards ─── */
.soundbox-item {
    flex-shrink: 0;
    width: 140px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    cursor: grab;
    transition: all 0.15s;
    position: relative;
}
.soundbox-item:active { cursor: grabbing; }
.soundbox-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}
.soundbox-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Source colors */
.soundbox-item[data-source="soundlab"]     { border-left: 3px solid var(--cyan); }
.soundbox-item[data-source="beatlab"]      { border-left: 3px solid var(--pink); }
.soundbox-item[data-source="studio"]       { border-left: 3px solid var(--lime); }
.soundbox-item[data-source="easysoundlab"] { border-left: 3px solid var(--orange); }

.soundbox-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.soundbox-play {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
    border: 1px solid var(--border);
}
.soundbox-play:hover {
    background: var(--cyan);
    color: #fff;
    border-color: var(--cyan);
}
.soundbox-play svg { width: 12px; height: 12px; }

.soundbox-item-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.soundbox-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.soundbox-item-info {
    font-size: 10px;
    color: var(--dim);
    font-weight: 500;
}
.soundbox-item-info .sb-src {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.soundbox-item[data-source="soundlab"]     .sb-src { color: var(--cyan); }
.soundbox-item[data-source="beatlab"]      .sb-src { color: var(--pink); }
.soundbox-item[data-source="studio"]       .sb-src { color: var(--lime); }
.soundbox-item[data-source="easysoundlab"] .sb-src { color: var(--orange); }

.soundbox-remove {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--dim);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.soundbox-remove:hover {
    background: var(--pink);
    color: #fff;
}

/* ─── Body Padding ─── */
body.soundbox-active { padding-bottom: 36px; }
body.soundbox-expanded { padding-bottom: 220px; }

/* ─── Toast ─── */
.soundbox-toast {
    position: fixed;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface);
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}
.soundbox-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Responsive ─── */
@media (max-width: 600px) {
    .soundbox-item { width: 120px; padding: 8px; }
    .soundbox-item-name { font-size: 10px; }
}
