/*
 * SalmasFlix — sync URL picker modal styles.
 *
 * Picker shown when a user pastes an unknown page URL into the Sync
 * queue input. Server's resolver returns N candidates; this modal
 * shows them as themed cards with thumbnail / title / quality /
 * extractor / confidence.
 *
 * Theme parity with Sync tab + SfxModal canonical chrome:
 *   - Backdrop blur + saturate on rgba secondary tint
 *   - Glass cards with hairline borders
 *   - Hover state pulses primary glow + lifts card 1px
 *   - Confidence meter is a gold→purple gradient bar
 *   - "DIRECT" / "YT-DLP" / "HTML-SCRAPE" extractor badges color-coded
 *
 * Mounted by features/media-sync/url-picker.ts via SfxModal — the
 * .sfx-m-card host comes for free; only the body needs scoped CSS.
 */

/* ── Sub-header (host source line) ─────────────────────────────── */

.sfx-pick-sub {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.86rem;
    margin-bottom: 14px;
    line-height: 1.5;
}
.sfx-pick-sub b {
    color: var(--primary);
    font-weight: 600;
}

/* ── Warning row (when candidates AND warnings both exist) ─────── */

.sfx-pick-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.20);
    color: #f59e0b;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.78rem;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* ── Card grid ─────────────────────────────────────────────────── */

.sfx-pick-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 56vh;
    overflow-y: auto;
    padding: 2px;
}

/* Each candidate is a clickable card */
.sfx-pick-card {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 12px;
    align-items: center;
    background: rgba(var(--secondary-rgb), 0.06);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.07));
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    color: var(--text);
    text-align: left;
    font-family: inherit;
    transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
    position: relative;
    width: 100%;
}
.sfx-pick-card:hover {
    background: rgba(var(--secondary-rgb), 0.10);
    border-color: rgba(var(--primary-rgb), 0.30);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(var(--secondary-rgb), 0.18);
}
.sfx-pick-card:active { transform: translateY(0); }

/* Thumb */
.sfx-pick-thumb-wrap {
    position: relative;
    width: 100px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.20), rgba(var(--primary-rgb), 0.15));
    border: 1px solid var(--hairline, rgba(255, 255, 255, 0.05));
}
.sfx-pick-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sfx-pick-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--secondary-rgb), 0.20), rgba(var(--primary-rgb), 0.15));
}
.sfx-pick-dur {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.2px;
}

/* Body — title + meta + host */
.sfx-pick-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sfx-pick-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    color: var(--text);
}
.sfx-pick-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.sfx-pick-badge {
    font-size: 0.62rem;
    padding: 2px 7px;
    border-radius: 100px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid transparent;
    line-height: 1.4;
}
.sfx-pick-badge-q {
    background: rgba(var(--primary-rgb), 0.10);
    color: var(--primary);
    border-color: rgba(var(--primary-rgb), 0.30);
}
.sfx-pick-badge-t {
    background: rgba(var(--secondary-rgb), 0.12);
    color: var(--secondary-alt, #b88ad9);
    border-color: rgba(var(--secondary-rgb), 0.30);
}
.sfx-pick-badge-e {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    border-color: var(--hairline, rgba(255, 255, 255, 0.05));
    text-transform: lowercase;
}
.sfx-pick-host {
    font-size: 0.7rem;
    color: var(--text-faint, #6e6e8a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Confidence meter */
.sfx-pick-conf {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 50px;
}
.sfx-pick-conf-bar {
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    overflow: hidden;
}
.sfx-pick-conf-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 100px;
    transition: width 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sfx-pick-conf-label {
    font-size: 0.62rem;
    color: var(--text-faint, #6e6e8a);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* ── Empty state (no candidates found) ─────────────────────────── */

.sfx-pick-empty {
    text-align: center;
    padding: 28px 18px 8px;
}
.sfx-pick-empty-icon {
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    background: rgba(var(--secondary-rgb), 0.08);
    border: 1px solid rgba(var(--secondary-rgb), 0.18);
    border-radius: 50%;
    margin-bottom: 14px;
}
.sfx-pick-empty-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}
.sfx-pick-empty-msg {
    font-size: 0.84rem;
    color: var(--text-dim);
    line-height: 1.55;
    max-width: 380px;
    margin: 0 auto 14px;
}
.sfx-pick-empty-cta {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.10), rgba(var(--secondary-rgb), 0.10));
    border: 1px solid rgba(var(--primary-rgb), 0.20);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.82rem;
    color: var(--text);
    line-height: 1.55;
    text-align: left;
    max-width: 460px;
    margin: 0 auto;
}
.sfx-pick-empty-cta strong {
    color: var(--primary);
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

/* ── Mobile (≤600px) ───────────────────────────────────────────── */

@media (max-width: 600px) {
    .sfx-pick-card {
        grid-template-columns: 80px 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
    }
    .sfx-pick-thumb-wrap { width: 80px; height: 50px; }
    .sfx-pick-conf {
        grid-column: 1 / 3;
        flex-direction: row;
        justify-content: flex-start;
    }
    .sfx-pick-conf-bar { width: 80px; }
}
