/* Reviewer Certificate Plugin Styles */

/* === Common === */
.certificate-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #003366;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 13px;
    cursor: pointer;
    border: none;
}

.certificate-button:hover {
    background-color: #004488;
    color: white;
    text-decoration: none;
}

/* === Editor Workflow Tab === */
.certificate-tab {
    padding: 16px;
}

.certificate-tab-description {
    margin-bottom: 16px;
    color: #666;
    font-size: 13px;
}

.certificate-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.certificate-table thead th {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
}

.certificate-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

/* Zebra striping: alternate row background colors */
.certificate-table tbody tr:nth-child(even) {
    background-color: #f8f9fb;
}

.certificate-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.certificate-table tbody tr:hover {
    background-color: #eef3f8;
}

.certificate-actions-cell {
    white-space: nowrap;
}

/* Status badges */
.certificate-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.certificate-status-generated {
    background-color: #e6f4ea;
    color: #1e7e34;
}

.certificate-status-not-generated {
    background-color: #fff3e0;
    color: #e65100;
}

.certificate-status-na,
.certificate-status-pending {
    color: #999;
    font-style: italic;
}

.certificate-action-disabled {
    color: #ccc;
}

/* Verification code label under status badge */
.certificate-code-label {
    display: inline-block;
    font-size: 10px;
    color: #999;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3px;
    margin-top: 2px;
}

/* Download count indicator */
.cert-download-count {
    display: inline-block;
    font-size: 10px;
    color: #888;
    margin-top: 2px;
}

/* Download button in table */
.certificate-btn-download {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Generate button in table */
.btn-generate-cert,
.btn-regenerate-cert {
    cursor: pointer;
}

.btn-generate-cert:disabled,
.btn-regenerate-cert:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Regenerate button - slightly muted style */
.btn-regenerate-cert {
    margin-left: 5px;
    font-size: 12px;
    background-color: #f0f0f0;
    color: #555;
    border: 1px solid #ccc;
}

.btn-regenerate-cert:hover {
    background-color: #e0e0e0;
    color: #333;
}

/* Notify button (envelope icon) */
.cert-notify-btn {
    display: inline-block;
    padding: 4px 8px;
    font-size: 16px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #b8860b;
    border-radius: 4px;
    color: #b8860b;
    vertical-align: middle;
    margin: 0 4px;
    line-height: 1;
}

.cert-notify-btn:hover {
    background-color: #b8860b;
    color: #fff;
}

.cert-notify-btn:disabled {
    cursor: wait;
}

/* Notification sent indicator */
.cert-notify-sent {
    display: inline-block;
    padding: 4px 8px;
    font-size: 14px;
    color: #1e7e34;
    vertical-align: middle;
    margin: 0 4px;
}

/* === Reviewer Download Section === */
.certificate-download-section {
    margin-top: 20px;
    padding: 12px;
}

.certificate-download-section .certificate-button {
    font-size: 14px;
    padding: 10px 20px;
}

/* === Verification Page === */
.certificate-verify-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Page header */
.cert-verify-header {
    text-align: center;
    margin-bottom: 32px;
}

.cert-verify-icon {
    font-size: 48px;
    color: #1a3c5e;
    margin-bottom: 8px;
    line-height: 1;
}

.cert-verify-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #1a3c5e;
    font-weight: 700;
}

.cert-verify-subtitle {
    color: #888;
    font-size: 14px;
    margin: 0;
}

/* Form card */
.cert-verify-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.certificate-verify-form {
    margin: 0;
}

.cert-verify-field {
    margin-bottom: 20px;
}

.cert-verify-field label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #444;
    margin-bottom: 6px;
}

.certificate-verify-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.certificate-verify-input:focus {
    border-color: #1a3c5e;
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.1);
}

/* Challenge field */
.cert-verify-challenge {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
}

.cert-verify-challenge label {
    margin-bottom: 10px;
    font-size: 14px;
    color: #555;
}

.cert-verify-challenge label strong {
    display: inline-block;
    background: #1a3c5e;
    color: #fff;
    padding: 3px 12px;
    border-radius: 4px;
    font-size: 15px;
    margin-left: 6px;
    letter-spacing: 1px;
}

.cert-verify-challenge-input {
    max-width: 120px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 2px;
}

/* Submit button */
.certificate-verify-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    margin-top: 4px;
    letter-spacing: 0.3px;
}

/* Result cards */
.cert-verify-result {
    padding: 24px;
    border-radius: 10px;
    margin-top: 24px;
    text-align: center;
}

.cert-result-icon {
    font-size: 36px;
    margin-bottom: 10px;
    line-height: 1;
}

.cert-verify-result h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
}

/* Valid result */
.cert-verify-valid {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 1px solid #b7dfbf;
}

.cert-result-valid-icon {
    color: #2e7d32;
}

.cert-verify-valid h3 {
    color: #1b5e20;
}

/* Invalid result */
.cert-verify-invalid {
    background: linear-gradient(135deg, #fde8e8 0%, #fce4ec 100%);
    border: 1px solid #f5c6c6;
}

.cert-result-invalid-icon {
    color: #c62828;
}

.cert-verify-invalid h3 {
    color: #b71c1c;
}

.cert-verify-invalid p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Challenge error */
.cert-verify-error {
    background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 100%);
    border: 1px solid #ffe0b2;
}

.cert-verify-error h3 {
    color: #e65100;
}

.cert-verify-error p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

/* Details table in valid result */
.certificate-verify-details {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin-top: 16px;
}

.certificate-verify-details th {
    padding: 12px 16px;
    color: #555;
    font-weight: 600;
    font-size: 13px;
    width: 140px;
    vertical-align: top;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.certificate-verify-details td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    font-size: 14px;
    color: #333;
}

.certificate-verify-details code {
    background: rgba(0,0,0,0.06);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 480px) {
    .cert-verify-card {
        padding: 20px 16px;
    }
    .certificate-verify-details th {
        display: block;
        width: 100%;
        padding-bottom: 2px;
        border-bottom: none;
    }
    .certificate-verify-details td {
        display: block;
        padding-top: 0;
        padding-bottom: 12px;
    }
}

/* === Centralized Management Page === */
.cert-manage-page {
    padding: 0;
}

.cert-manage-page .app__pageHeading {
    margin-bottom: 4px;
}

.cert-manage-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 20px;
}

/* Toolbar: filters + search */
.cert-manage-toolbar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.cert-manage-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.cert-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cert-filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cert-filter-select,
.cert-filter-input {
    padding: 7px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    min-width: 160px;
}

.cert-filter-select:focus,
.cert-filter-input:focus {
    border-color: #003366;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,51,102,0.1);
}

.cert-filter-search {
    flex: 1;
    min-width: 200px;
}

.cert-filter-search .cert-filter-input {
    width: 100%;
}

.cert-filter-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: 16px;
}

.cert-filter-btn {
    padding: 7px 20px;
    font-size: 13px;
    font-weight: 600;
}

.cert-filter-reset {
    font-size: 12px;
    color: #999;
    text-decoration: none;
}

.cert-filter-reset:hover {
    color: #333;
    text-decoration: underline;
}

/* Results count */
.cert-manage-count {
    font-size: 12px;
    color: #888;
    margin-bottom: 8px;
    padding-left: 2px;
}

/* Bulk actions toolbar */
.cert-bulk-toolbar {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    border-radius: 6px;
    padding: 10px 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.cert-bulk-count {
    font-weight: 700;
    color: #1565c0;
    font-size: 15px;
}

.cert-bulk-btn {
    font-size: 12px;
    padding: 5px 14px;
}

.cert-bulk-btn-notify {
    background-color: #b8860b;
    color: #fff;
    border-color: #b8860b;
}

.cert-bulk-btn-notify:hover {
    background-color: #9a7209;
}

.cert-bulk-result-success {
    font-weight: 600;
    color: #1e7e34;
    font-size: 14px;
}

.cert-bulk-result-warning {
    font-weight: 600;
    color: #e65100;
    font-size: 14px;
}

/* Checkbox column */
.cert-col-check {
    width: 36px;
    text-align: center;
}

/* Management table specific */
.cert-manage-table {
    margin-bottom: 16px;
}

.cert-col-id {
    width: 60px;
    text-align: center;
}

.cert-submission-link {
    font-weight: 600;
    color: #003366;
    text-decoration: none;
}

.cert-submission-link:hover {
    text-decoration: underline;
}

.cert-col-title {
    max-width: 240px;
}

.cert-title-link {
    color: #333;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.3;
}

.cert-title-link:hover {
    color: #003366;
    text-decoration: underline;
}

.cert-no-results {
    text-align: center;
    color: #999;
    padding: 30px 12px !important;
    font-style: italic;
}

/* Pagination */
.cert-manage-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 0;
}

.cert-page-btn {
    padding: 6px 16px;
    font-size: 13px;
    text-decoration: none;
}

.cert-page-info {
    font-size: 13px;
    color: #666;
}

/* Management page footer */
.cert-manage-footer {
    text-align: right;
    padding: 16px 4px 8px;
    font-size: 11px;
}

.cert-manage-footer a {
    color: #aaa;
    text-decoration: none;
}

.cert-manage-footer a:hover {
    color: #666;
    text-decoration: underline;
}

/* === Email Preview Button === */
.cert-preview-btn {
    display: inline-block;
    padding: 4px 7px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #5b9bd5;
    border-radius: 4px;
    color: #5b9bd5;
    vertical-align: middle;
    margin: 0 2px;
    line-height: 1;
}

.cert-preview-btn:hover {
    background-color: #5b9bd5;
    color: #fff;
}

.cert-preview-btn:disabled {
    cursor: wait;
    opacity: 0.5;
}

/* === Email Preview Modal === */
.cert-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cert-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cert-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cert-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.cert-modal-close {
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.cert-modal-close:hover {
    color: #333;
}

.cert-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.cert-preview-field {
    margin-bottom: 16px;
}

.cert-preview-field:last-child {
    margin-bottom: 0;
}

.cert-preview-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cert-preview-value {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
}

.cert-preview-subject {
    font-weight: 600;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.cert-preview-body {
    padding: 12px 14px;
    background: #fefefe;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 280px;
    overflow-y: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cert-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.cert-modal-send-btn {
    background-color: #b8860b !important;
    color: #fff !important;
    border-color: #b8860b !important;
    font-weight: 600;
}

.cert-modal-send-btn:hover {
    background-color: #9a7209 !important;
}

.cert-modal-send-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* === Reviewer Submissions List - Certificate Buttons === */
.cert-rcpro-list-btns {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    align-items: center;
}

.cert-rcpro-list-btn {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 3px;
    line-height: 1.4;
    cursor: pointer;
}

.cert-rcpro-list-btn-tr {
    background-color: #003366;
    color: #fff;
    border: 1px solid #003366;
}

.cert-rcpro-list-btn-tr:hover {
    background-color: #004488;
    color: #fff;
    text-decoration: none;
}

.cert-rcpro-list-btn-en {
    background-color: #fff;
    color: #003366;
    border: 1px solid #003366;
}

.cert-rcpro-list-btn-en:hover {
    background-color: #e8f0f8;
    color: #003366;
    text-decoration: none;
}

/* Responsive management page */
@media (max-width: 768px) {
    .cert-manage-filters {
        flex-direction: column;
    }
    .cert-filter-group {
        width: 100%;
    }
    .cert-filter-select,
    .cert-filter-input {
        width: 100%;
        min-width: auto;
    }
    .cert-filter-actions {
        width: 100%;
        justify-content: flex-start;
    }
    .cert-manage-table {
        font-size: 12px;
    }
    .certificate-actions-cell {
        white-space: normal;
    }
}
