/* Admin layout */
.fjp-admin-wrap {
    max-width: 1120px;
}

.fjp-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin: 16px 0;
}

.fjp-card {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fjp-admin-wrap .fjp-card > h2 {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fjp-admin-wrap .fjp-card > h2::after {
    content: '+';
    font-size: 18px;
    line-height: 1;
}

.fjp-admin-wrap .fjp-card.fjp-expanded > h2::after {
    content: '−';
}

.fjp-admin-wrap .fjp-card > :not(h2) {
    display: none;
}

.fjp-admin-wrap .fjp-card.fjp-expanded > :not(h2) {
    display: block;
}

.fjp-full {
    margin-top: 16px;
}

/* Admin and shared forms */
.fjp-form {
    display: flex;
    flex-direction: column;
}

.fjp-form input[type="text"],
.fjp-form input[type="url"] {
    width: 100%;
    max-width: 500px;
}

.fjp-form label {
    font-weight: 700;
    display: block;
}

.fjp-form p {
    margin: 4px 0 8px;
}

.fjp-form > label {
    margin-top: 12px;
}

.fjp-form > label:first-child {
    margin-top: 0;
}

.fjp-form > input,
.fjp-form > select,
.fjp-form > textarea {
    margin-top: 6px;
}

.fjp-form .button {
    margin-top: 14px;
}

.fjp-invite-form {
    margin-bottom: 12px;
}

.fjp-inline-row {
    display: flex;
    gap: 10px;
    align-items: baseline;
    width: 100%;
}

.fjp-inline-row input[type="email"] {
    flex: 1 1 auto;
}

.fjp-inline-row input[type="text"] {
    flex: 1 1 auto;
    max-width: 500px;
}

.fjp-inline-row-right input[type="text"] {
    flex: 1 1 0;
    max-width: 100%;
}

.fjp-inline-row-right .button {
    margin-left: auto;
}

.fjp-inline-row .button {
    margin-top: 0;
}

.fjp-inline-row input[type="text"],
.fjp-inline-row input[type="email"] {
    line-height: 1.2;
    padding: 6px 8px;
}

.fjp-form input::placeholder,
.fjp-form textarea::placeholder,
.fjp-judge-form input::placeholder,
.fjp-judge-form textarea::placeholder {
    font-weight: 300;
}

.fjp-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-end;
}

.fjp-actions form {
    margin: 0;
}

.fjp-actions-header {
    text-align: right;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.fjp-actions-header .button {
    margin-left: 8px;
    vertical-align: middle;
}

.fjp-genre-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 12px;
    width: 100%;
}

#fjp-genre-add {
    margin-left: 10px;
    white-space: nowrap;
}

.fjp-genre-input {
    width: 100%;
    padding: 6px 8px;
}

#fjp-genre-bulk-input {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    width: auto !important;
    margin-right: 0;
}

.fjp-genre-input[readonly] {
    background: #f6f7f7;
}

.fjp-genre-table th:first-child,
.fjp-genre-table td:first-child {
    width: 32px;
    text-align: center;
    vertical-align: middle;
}

.fjp-genre-table th,
.fjp-genre-table td {
    vertical-align: middle;
}

.fjp-genre-table th.fjp-actions-header,
.fjp-genre-table td.fjp-actions {
    width: 92px;
}

.fjp-genre-table th.fjp-genre-check,
.fjp-genre-table td.fjp-genre-check {
    padding-left: 0;
    padding-right: 0;
}

.fjp-genre-table input[type="checkbox"] {
    margin: 0;
    vertical-align: middle;
}

.fjp-genre-table .fjp-actions {
    white-space: nowrap;
}

.fjp-icon-button {
    padding: 2px 4px;
    line-height: 1.2;
    min-width: 24px;
    text-align: center;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.fjp-icon-button .dashicons {
    font-size: 16px;
    line-height: 1;
    width: 16px;
    height: 16px;
}

.fjp-icon-add .dashicons {
    color: #1b5e20;
}

.fjp-icon-edit .dashicons {
    color: #b45309;
}

.fjp-icon-save .dashicons {
    color: #1b5e20;
}

.fjp-icon-cancel .dashicons {
    color: #4b5563;
}

.fjp-icon-delete .dashicons {
    color: #b32d2e;
}


.fjp-subsection h3 {
    margin: 0 0 8px;
}

.fjp-admin-wrap .button.button-primary,
.fjp-admin-wrap .button.button-secondary,
.fjp-admin-wrap .button:not(.button-link-delete) {
    background: var(--global-palette1, #0a4b78);
    border-color: var(--global-palette1, #0a4b78);
    color: #fff;
}

.fjp-admin-wrap .button.button-primary:hover,
.fjp-admin-wrap .button.button-secondary:hover,
.fjp-admin-wrap .button:not(.button-link-delete):hover {
    background: var(--global-palette1, #093a5d);
    border-color: var(--global-palette1, #093a5d);
    filter: brightness(0.9);
}

.fjp-admin-wrap .button.fjp-icon-button {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none;
}

.fjp-admin-wrap .button.fjp-icon-button:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
}

.fjp-sortable-table .fjp-sort-handle {
    cursor: move;
    width: 24px;
    text-align: center;
    color: #6b7280;
}

.fjp-sortable-table tbody tr {
    cursor: move;
    user-select: none;
}

.fjp-checklist {
    display: grid;
    gap: 6px;
}

.fjp-checklist label {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Judge form container */
.fjp-judge-form {
    display: grid;
    gap: 10px;
    max-width: 980px;
    padding: 14px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #fff;
}

.fjp-card h2,
.fjp-judge-form h1,
.fjp-judge-form h2,
.fjp-judge-form h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--global-palette1, #1f2937);
}

.fjp-judge-form select,
.fjp-judge-form input[type="number"],
.fjp-judge-form input[type="range"] {
    width: 100%;
    padding: 8px;
}

.fjp-film-note {
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

.fjp-judge-form button {
    width: fit-content;
    justify-self: center;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--global-palette1, #0a4b78);
    color: #fff;
    cursor: pointer;
}

.fjp-judge-form button:hover {
    background: var(--global-palette1, #093a5d);
    filter: brightness(0.9);
}

.fjp-judge-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 6px;
}

.fjp-judge-notice.notice-success {
    background: #f0f6fc;
    border: 1px solid #72aee6;
}

.fjp-judge-notice.notice-error {
    background: #fcf0f1;
    border: 1px solid #d63638;
}

.fjp-judge-progress {
    font-weight: 600;
    color: var(--global-palette3, #1f2937);
}

/* Score table layout */
.fjp-score-table {
    display: grid;
    gap: 6px;
    padding: 8px 0;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.fjp-judge-form .fjp-score-header,
.fjp-judge-form .fjp-score-row {
    display: flex !important;
    gap: 10px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.fjp-judge-form .fjp-score-header {
    font-weight: 600;
    background: var(--global-palette1, #eef3f8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
}

.fjp-score-header-label {
    white-space: nowrap;
}

.fjp-judge-form .fjp-score-row > div:first-child,
.fjp-judge-form .fjp-score-header > div:first-child {
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fjp-judge-form .fjp-score-row > div:last-child,
.fjp-judge-form .fjp-score-header > div:last-child {
    flex: 0 0 120px;
    text-align: right;
}

.fjp-score-control {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.fjp-score-slider {
    width: 120px;
}

.fjp-score-value {
    min-width: 22px;
    text-align: right;
    font-weight: 600;
}

.fjp-category-name {
    font-weight: 600;
}

.fjp-nominee {
    font-size: 12px;
    color: #4b5563;
}


.fjp-score-na {
    background: #f3f4f6;
    color: #9ca3af;
}

.fjp-score-table .fjp-score-row:nth-child(odd) {
    background: #f8f9fb;
}

.fjp-score-table .fjp-score-row {
    padding: 6px 8px;
    width: 100%;
    box-sizing: border-box;
}

.fjp-submit-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

.fjp-film-complete {
    color: #7a7a7a;
}

.fjp-selected-challenge {
    font-weight: 700;
    font-size: 18px;
    background: var(--global-palette1, #f3f6fb);
    border: 1px solid var(--global-palette1, #d6e0ea);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 6px;
}

.fjp-judge-login {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 16px;
}

.fjp-judge-login .fjp-card {
    padding: 24px;
}

/* Judge page two-column layout */
.fjp-judge-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 920px;
    margin: 0 auto;
}

.fjp-judge-box {
    background: #ffffff;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Film embed container */
.fjp-film-embed {
    margin-top: 12px;
}

.fjp-film-embed iframe,
.fjp-film-embed embed,
.fjp-film-embed object {
    width: 100%;
    max-width: 100%;
}

.fjp-film-embed-wide {
    width: 100%;
    max-width: 100%;
    margin: 10px 0 16px;
}

@media (max-width: 860px) {
    .fjp-judge-layout {
        grid-template-columns: 1fr;
    }
}

.fjp-judge-form .fjp-film-search {
    margin: 6px 0 10px;
}

.fjp-judge-form .fjp-film-search input[type="text"] {
    width: 100%;
    padding: 8px;
}

.fjp-judge-form .fjp-score-row > div:last-child,
.fjp-judge-form .fjp-score-header > div:last-child {
    flex: 0 0 120px;
    text-align: right;
}


.fjp-film-embed-empty {
    padding: 10px 12px;
    background: #f8f9fb;
    border: 1px dashed #c7cdd1;
    border-radius: 6px;
}

@media (max-width: 860px) {
    .fjp-judge-layout {
        grid-template-columns: 1fr;
    }
}
