/* css/credits.css
 *
 * Profile credits: the Credits card under the profile's main card, and the
 * Credits tab of Edit Profile. See js/credits.js and includes/credits.php.
 *
 * The job field borrows the script dialog's tag field wholesale -- .sm-tag-field,
 * .sm-tag-chip, .sm-tag-dropdown, .sm-tag-option in css/dashboard.css -- so a
 * job chosen here looks exactly like a tag chosen there. Only its entry box is
 * restated below, because dashboard.css styles that one by id.
 */

/* ── THE CARD ON THE PROFILE ───────────────────────────────────────────── */

.profile-credits-card {
    margin-top: 20px;
    padding: 20px 24px;
}

.profile-credits-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.profile-credits-head .script-section-label {
    margin-bottom: 0;
}

.profile-credits-empty {
    margin: 0;
    font-size: 15px;
    color: var(--text-muted);
}

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

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

.profile-credit:first-child {
    border-top: 0;
    padding-top: 4px;
}

/* A poster's 2:3, whether or not there is a poster -- so a list with some and
   without others still lines up down the left. */
.profile-credit-poster {
    flex: none;
    width: 60px;
    height: 90px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 22px;
}

.profile-credit-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

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

.profile-credit-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.3;
}

.profile-credit-year {
    font-weight: 400;
    color: var(--text-muted);
}

.profile-credit-meta {
    margin-top: 2px;
    font-size: 14px;
    color: var(--text-soft);
}

.profile-credit-jobs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.profile-credit-details {
    font-size: 14px;
    font-style: italic;
    color: var(--text-muted);
}

/* IMDb's own yellow, so it reads as the link it is at a glance. */
.profile-credit-imdb {
    flex: none;
    align-self: center;
    padding: 2px 7px;
    border-radius: 4px;
    background: #f5c518;
    color: #000;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
    text-decoration: none;
}

.profile-credit-imdb:hover {
    background: #e2b616;
    color: #000;
}

/* The IMDb button and, for the member and Staff, how many people followed it
   (includes/linkclicks.php) -- stacked, so the count sits under its button
   rather than becoming a column of its own in the row. Takes over the
   button's place in the row: no shrink, centred down its height. */
.profile-credit-links {
    flex: none;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.profile-credit-links .link-clicks {
    margin-left: 0;
    font-size: 12px;
}

/* ── THE TAB: THE LIST ─────────────────────────────────────────────────── */

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

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

.cr-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.cr-list > li {
    padding: 10px 14px;
}

.cr-empty {
    font-size: 15px;
    color: var(--text-muted);
}

.cr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border);
}

.cr-item:first-child {
    border-top: 0;
}

.cr-item-poster {
    flex: none;
    width: 36px;
    height: 54px;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-muted);
}

.cr-item-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cr-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-item-year {
    font-weight: 400;
    color: var(--text-muted);
}

.cr-item-meta {
    font-size: 13px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-item-actions {
    flex: none;
    display: flex;
    gap: 4px;
}

.cr-item-delete:hover {
    color: #e85347;
}

/* ── THE TAB: THE FORM ─────────────────────────────────────────────────── */

.cr-form-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 20px;
}

.cr-poster-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.cr-poster {
    width: 120px;
    height: 180px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    cursor: pointer;
}

.cr-poster:hover {
    border-color: var(--primary);
}

.cr-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cr-poster img[hidden],
.cr-poster-empty[hidden] {
    display: none;
}

.cr-poster-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.cr-poster-empty i {
    font-size: 28px;
}

.cr-two {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
}

/* The entry box inside the job field -- the part dashboard.css styles by id
   (#sm-tag-entry), restated for this field's. */
#cr-job-chips {
    display: contents;
}

#cr-job-entry {
    flex: 1 1 140px;
    min-width: 110px;
    border: 0;
    outline: none;
    padding: 0;
    font: inherit;
    background: transparent;
}

.cr-job-none {
    cursor: default;
    color: var(--text-muted);
}

.cr-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

@media (max-width: 600px) {
    .profile-credits-card {
        padding: 16px;
    }

    .cr-form-grid {
        grid-template-columns: 1fr;
    }

    .cr-two {
        grid-template-columns: 1fr;
        gap: 0;
    }

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