/* ════════════════════════════════════════════════════════════════
   BAH Voice Picker — Select Voice modal + Fish Audio section styles
   Uses existing --bahub-* CSS variables from bah-frontend.css
   ════════════════════════════════════════════════════════════════ */

/* ── Voice picker overlay & modal ────────────────────────────── */
#bahub-voice-picker-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}
#bahub-voice-picker-overlay[style*="display:flex"],
#bahub-voice-picker-overlay.bahub-vp-open {
    display: flex !important;
}

.bahub-voice-picker-modal {
    background: var(--bahub-bg, #fff);
    border-radius: 12px;
    width: min(900px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────── */
.bahub-voice-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--bahub-border, #eee);
    flex-shrink: 0;
}

/* ── Tabs ────────────────────────────────────────────────────── */
.bahub-voice-picker-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 22px 0;
    border-bottom: 1px solid var(--bahub-border, #eee);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.bahub-voice-picker-tabs::-webkit-scrollbar { display: none; }

.bahub-vp-tab {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--bahub-text-sub, #888);
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}
.bahub-vp-tab:hover { color: var(--bahub-primary, #de7356); }
.bahub-vp-tab.bahub-vp-tab-active {
    color: var(--bahub-primary, #de7356);
    border-bottom-color: var(--bahub-primary, #de7356);
    font-weight: 600;
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.bahub-voice-picker-toolbar {
    display: flex;
    gap: 10px;
    padding: 12px 22px;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.bahub-voice-picker-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 180px;
    border: 1px solid var(--bahub-border, #ddd);
    border-radius: var(--bahub-radius-sm, 8px);
    padding: 8px 12px;
    background: var(--bahub-bg, #fff);
}

/* ── Voice grid ─────────────────────────────────────────────── */
.bahub-voice-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px 22px 22px;
    overflow-y: auto;
    flex: 1;
}
@media (max-width: 680px) {
    .bahub-voice-picker-grid { grid-template-columns: 1fr; }
}
@media (min-width: 681px) and (max-width: 900px) {
    .bahub-voice-picker-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Voice card ─────────────────────────────────────────────── */
.bahub-voice-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--bahub-border, #eee);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
    position: relative;
    background: var(--bahub-bg, #fff);
}
.bahub-voice-card:hover {
    border-color: var(--bahub-primary, #de7356);
    box-shadow: 0 2px 10px rgba(222,115,86,.15);
}
.bahub-voice-card.bahub-voice-card-selected {
    border-color: var(--bahub-primary, #de7356);
    background: var(--bahub-primary-subtle, #fff5f2);
}

.bahub-voice-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bahub-border, #eee);
}

.bahub-voice-card-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--bahub-primary, #de7356);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    text-transform: uppercase;
}

.bahub-voice-card-body {
    flex: 1;
    min-width: 0;
}

.bahub-voice-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--bahub-text, #1a1a2e);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.bahub-voice-card-author {
    font-weight: 400;
    color: var(--bahub-text-sub, #888);
    font-size: 12px;
}

.bahub-voice-card-desc {
    font-size: 12px;
    color: var(--bahub-text-sub, #888);
    line-height: 1.4;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bahub-voice-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 5px;
}

.bahub-voice-tag {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--bahub-primary-subtle, #fff0ee);
    color: var(--bahub-primary, #de7356);
    font-weight: 500;
    border: 1px solid rgba(222,115,86,.25);
}

.bahub-voice-card-stats {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--bahub-text-sub, #888);
}
.bahub-voice-card-stats span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.bahub-voice-card-stats svg,
.bahub-voice-card-stats [data-lucide] {
    width: 12px;
    height: 12px;
}

/* Bookmark button on card */
.bahub-voice-bookmark-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: var(--bahub-text-sub, #bbb);
    transition: color .15s;
}
.bahub-voice-bookmark-btn:hover,
.bahub-voice-bookmark-btn.bahub-bookmarked {
    color: var(--bahub-primary, #de7356);
}

/* ── Trigger button ─────────────────────────────────────────── */
.bahub-voice-trigger {
    text-align: left;
    cursor: pointer;
}

/* ── Empty state ────────────────────────────────────────────── */
.bahub-vp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--bahub-text-sub, #888);
    font-size: 14px;
}
.bahub-vp-empty svg,
.bahub-vp-empty [data-lucide] {
    width: 32px;
    height: 32px;
    margin: 0 auto 12px;
    display: block;
    opacity: .4;
}

/* ── Load More footer ───────────────────────────────────────── */
#bahub-vp-load-more {
    font-size: 13px;
    padding: 8px 22px;
}

/* ── Instant clone upload card ──────────────────────────────── */
.bahub-vp-clone-card {
    border: 1.5px dashed var(--bahub-primary, #de7356);
    border-radius: 10px;
    padding: 18px 20px;
    background: var(--bahub-primary-subtle, #fff5f2);
    margin-bottom: 4px;
}

/* ── Job history card ────────────────────────────────────────── */
.bahub-fishaudio-job-card {
    border: 1px solid var(--bahub-border, #eee);
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--bahub-bg, #fff);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.bahub-fishaudio-job-card audio {
    flex: 1;
    min-width: 200px;
}
.bahub-fishaudio-job-meta {
    flex: 1;
    min-width: 160px;
}
.bahub-fishaudio-job-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}
