/* css/placements.css
 *
 * Competition placements: the widget under AI Extras on a screenplay's summary
 * page, and the Placements step of the Edit Script dialog. See js/placements.js
 * and includes/placements.php.
 */

/* ── THE WIDGET ────────────────────────────────────────────────────────── */

.placements-card {
    padding: 6px 20px;
}

.placements-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.placement {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.placement:first-child {
    border-top: 0;
}

/* The place as a badge of fixed width, so the competition names line up. */
.placement-place {
    flex: none;
    width: 150px;
    padding: 3px 8px;
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-soft);
}

/* The top three in the site's gold, which is what anybody scanning the list
   is looking for first. */
.placement-winner,
.placement-award,
.placement-placed {
    background: var(--cream);
    border-color: var(--gold-light);
    color: var(--text-dark);
}

.placement-info {
    flex: 1 1 auto;
    min-width: 0;
}

.placement-competition {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.placement-meta {
    margin-top: 2px;
    font-size: 14px;
    color: var(--text-muted);
}

.placement-meta a {
    color: var(--primary);
}

.placement-meta a i {
    font-size: 11px;
}

/* ── THE POPUP ─────────────────────────────────────────────────────────────
 *
 * The ribbon on a Script Library card opens the same list in the shared AI
 * dialog (js/dashboard.js, AI_DIALOGS). A list of a few lines does not need
 * the 900px a coverage report does -- the pitch's width, for the same reason. */

.sc-ai-dialog--placements {
    width: 42rem;
    max-width: 100%;
}

.sc-ai-dialog--placements .placements-list {
    padding: 0 4px;
}

/* ── THE DIALOG STEP ───────────────────────────────────────────────────── */

.pl-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.pl-head-gap {
    flex: 1 1 auto;
}

.pl-note {
    margin: 0 0 10px;
}

.pl-note[hidden],
.pl-empty[hidden] {
    display: none;
}

.pl-empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
}

.pl-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-light);
}

.pl-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pl-line .pl-competition {
    flex: 1 1 auto;
}

.pl-remove:hover {
    color: #e85347;
}

.pl-three {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    gap: 8px;
}

.pl-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

/* jQuery UI's suggestion list, over the dialog. */
#script-modal-body .ui-autocomplete {
    z-index: 2000;
    max-height: 240px;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .placement {
        flex-direction: column;
        gap: 6px;
    }

    .placement-place {
        width: auto;
    }

    .pl-three,
    .pl-two {
        grid-template-columns: 1fr;
    }

    .pl-head {
        flex-wrap: wrap;
    }
}
