
body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

/* Main Header Styles */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    background: #f9f9f9;
    border-bottom: 3px solid #2c5aa0;
}

.header-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title {
    margin: 0;
    color: #333;
    font-weight: 600;
}

.help-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #2c5aa0;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    transition: background-color 0.2s, transform 0.2s;
}

.help-link:hover {
    background: #1e3a6f;
    transform: scale(1.1);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 50px;
    width: auto;
}

.header-nav {
    display: flex;
    flex-direction: column;
}

.nav-link {
    color: #2c5aa0;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.nav-link:hover {
    background-color: #e9ecef;
    text-decoration: underline;
}

/* Markdown Content Container */
.markdown-container {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

.markdown-container h1 {
    color: #333;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 10px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.markdown-container h2 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.markdown-container h3 {
    color: #555;
    margin-top: 20px;
    margin-bottom: 10px;
}

.markdown-container p {
    margin-bottom: 15px;
    color: #444;
}

.markdown-container a {
    color: #2c5aa0;
    text-decoration: none;
}

.markdown-container a:hover {
    text-decoration: underline;
}

.markdown-container ul,
.markdown-container ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.markdown-container li {
    margin-bottom: 8px;
}

.markdown-container code {
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
}

.markdown-container pre {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid #ddd;
}

.markdown-container pre code {
    background: none;
    padding: 0;
}

.markdown-container blockquote {
    border-left: 4px solid #2c5aa0;
    padding-left: 15px;
    margin-left: 0;
    color: #666;
    font-style: italic;
}

.markdown-container table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 15px;
}

.markdown-container table th,
.markdown-container table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.markdown-container table th {
    background: #f5f5f5;
    font-weight: 600;
}

/* Report List Container */
#report-list-container {
    padding: 40px;
    font-family: sans-serif;
    max-width: 800px;
    margin: 0 auto;
}

#report-list-container h1 {
    color: #333;
    margin-bottom: 30px;
}

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

.report-list-item {
    margin: 10px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: background 0.2s;
}

.report-list-item:hover {
    background: #f0f0f0;
}

.report-link {
    color: #2c5aa0;
    text-decoration: none;
    font-size: 16px;
    display: block;
}

.report-link:hover {
    color: #1e3a6f;
    text-decoration: underline;
}

.no-reports {
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Error Reports Container */
#error-reports-container {
    padding: 20px;
    font-family: sans-serif;
}

.error-summary {
    margin-bottom: 20px;
}

/* Error Report Box */
.error-report {
    margin: 20px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f9f9f9;
}

.error-header {
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f0f0;
    border-radius: 5px 5px 0 0;
}

.error-header-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.error-header-title {
    /* title content styling handled inline for now due to dynamic content */
}

.error-exception-name {
    color: #d32f2f;
}

.error-occurrence-count {
    color: #666;
    font-size: 0.9em;
}

.error-header-message {
    font-size: 0.9em;
    color: #444;
}

.item-toggle {
    font-size: 12px;
    transition: transform 0.3s;
    display: inline-block;
    margin-left: 10px;
}

.expanded .item-toggle {
    transform: rotate(90deg);
}

.error-content {
    display: none;
    padding: 15px;
}

.error-content.expanded {
    display: block;
}

/* Error Details */
.error-detail-section {
    margin-bottom: 10px;
}

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

.error-traceback {
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    overflow-x: auto;
    font-size: 12px;
}

/* Error Loading/Error State */
.error-message {
    color: red;
    padding: 20px;
}

.context-command {
    display: inline-block;
    margin: 1px;
    background: purple;
    color: white;
    font-weight: bold;
    padding: 2px;
    padding-left: 5px;
    padding-right: 5px;
    border-radius: 3px;
}

.context-richlog {
    display: inline-block;
    margin: 1px;
    background: red;
    color: white;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
}

.context-richlog::before {
    content: "In richlog: ";
}

/* Log Header */
.log-header {
    margin: 20px 0;
    padding: 15px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.log-title {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.log-title a {
    color: #2c5aa0;
    text-decoration: none;
}

.log-title a:hover {
    text-decoration: underline;
}

.running-indicator {
    color: #ff8c00;
    font-style: italic;
    font-size: 0.8em;
}

.log-time-info {
    font-size: 14px;
    color: #333;
}

/* Statistics Section */
.statistics-section,
.progressive-counts-section {
    margin: 20px 0;
}

.statistics-section h2,
.progressive-counts-section h2 {
    margin-bottom: 10px;
}

.statistics-table,
.progressive-counts-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #ccc;
}

.statistics-table th,
.statistics-table td,
.progressive-counts-table th,
.progressive-counts-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ddd;
}

.statistics-table th,
.progressive-counts-table th {
    background: #f0f0f0;
    font-weight: bold;
}

.statistics-table tbody tr:hover {
    background: #f9f9f9;
}

/* Progressive Counts Collapsible */
.category-row {
    cursor: pointer;
}

.category-row:hover {
    background: #f9f9f9;
}

.category-cell {
    display: flex;
    align-items: center;
}

.category-cell .item-toggle {
    margin-left: 0;
    margin-right: 5px;
}


.category-detail-row {
    display: none;
}

.category-detail-row.expanded {
    display: table-row;
}

.category-detail-row td {
    padding: 0;
    background: #f9f9f9;
}

.origin-breakdown-table {
    width: calc(100% - 20px);
    border-collapse: collapse;
    margin: 10px;
}

.origin-breakdown-table th,
.origin-breakdown-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

.origin-breakdown-table th {
    background: #e8e8e8;
    font-size: 0.9em;
}

.origin-breakdown-table tbody tr:hover {
    background: #fff;
}

/* Command Description Section */
.command-description-section {
    margin: 20px 0;
}

.command-description {
    margin: 20px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #f9f9f9;
}

.command-header {
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f0f0;
    border-radius: 5px 5px 0 0;
}

.command-header-content {
    flex: 1;
    font-weight: 500;
    color: #333;
}


.command-content {
    display: none;
    padding: 15px;
}

.command-content.expanded {
    display: block;
}

.command-json {
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    overflow-x: auto;
    font-size: 12px;
    margin: 0;
}

/* Edit Page Styles */

/* Table Styles */
.edit-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

.edit-table thead {
    background: #f5f5f5;
}

.edit-table th {
    padding: 6px 8px;
    text-align: left;
    border: 1px solid #ddd;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.edit-table td {
    padding: 0;
    border: 1px solid #ddd;
    vertical-align: middle;
}

.edit-table tbody tr:hover {
    background: #f9f9f9;
}

/* Table Column Widths */
.authors-table th:nth-child(1) { width: 60px; text-align: center; }
.authors-table th:nth-child(2) { width: 40%; }
.authors-table th:nth-child(3) { width: 55%; }
.authors-table th:nth-child(4) { width: 40px; text-align: center; }

.releases-table th:nth-child(1) { width: 120px; }
.releases-table th:nth-child(2) { width: 25%; }
.releases-table th:nth-child(3) { width: 120px; }
.releases-table th:nth-child(4) { width: 20%; }
.releases-table th:nth-child(5) { width: 120px; }
.releases-table th:nth-child(6) { width: 40px; text-align: center; }

.links-table th:nth-child(1) { width: 20%; }
.links-table th:nth-child(2) { width: 75%; }
.links-table th:nth-child(3) { width: 40px; text-align: center; }

.info-table th:nth-child(1) { width: 25%; }
.info-table th:nth-child(2) { width: 70%; }
.info-table th:nth-child(3) { width: 40px; text-align: center; }

/* Form Input Styles */
.edit-input {
    width: 100%;
    padding: 8px;
    border: none;
    box-sizing: border-box;
    font-size: 13px;
    background: transparent;
    height: 100%;
    /* min-height: 32px; */
}

.edit-input:focus {
    outline: none;
    background: #f8f9fa;
}

.edit-input-large {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

/* Cell Alignment */
.cell-center {
    text-align: center;
    padding: 4px;
}

.cell-center-padded {
    text-align: center;
    padding: 2px;
}

/* Button Container */
.btn-container {
    display: flex;
    gap: 2px;
    justify-content: center;
}

/* Move Buttons */
.btn-move-up,
.btn-move-down {
    background: none;
    border: 1px solid #6c757d;
    color: #6c757d;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
    border-radius: 3px;
}

.btn-move-up:hover:not(:disabled),
.btn-move-down:hover:not(:disabled) {
    background: #6c757d;
    color: white;
}

.btn-move-up:disabled,
.btn-move-down:disabled {
    cursor: not-allowed;
}

/* Focuses Page Flexbox Layout */
.focuses-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    box-sizing: border-box;
    overflow: hidden; /* Prevent outer scroll */
}

/* Focuses Tabs */
.focuses-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    flex: 0 0 auto;
}

.focuses-tab {
    padding: 12px 28px;
    border: none;
    background: #e8e8e8;
    background: var(--bg-tertiary, #e8e8e8);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    color: var(--text-muted, #666);
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    margin-right: 2px;
    position: relative;
}

.focuses-tab:hover {
    background: #d8d8d8;
    background: var(--bg-secondary, #d8d8d8);
    color: #333;
    color: var(--text-primary, #333);
}

.focuses-tab.active {
    background: #fff;
    background: var(--bg-primary, #fff);
    color: #2c5aa0;
    color: var(--accent-color, #2c5aa0);
    border: 1px solid #ddd;
    border: 1px solid var(--border-color, #ddd);
    border-bottom: 1px solid #fff;
    border-bottom-color: var(--bg-primary, #fff);
    z-index: 2;
}

.focuses-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    border: 1px solid #ddd;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 0 8px 8px 8px;
    margin-top: -1px;
}

.focuses-tab-content.active {
    display: flex;
}

.focuses-tab-content .focuses-table-container {
    flex: 1;
    height: auto; /* Override fixed height */
    overflow-y: auto;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
}

.focuses-tab-content .focuses-actions {
    flex: 0 0 auto;
    padding: 10px;
    background: #f9f9f9;
    background: var(--bg-secondary, #f9f9f9);
    border-top: 1px solid #ddd;
    border-top: 1px solid var(--border-color, #ddd);
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.focuses-actions-right {
    display: flex;
    gap: 10px;
}

.focuses-page .focuses-table-container {
    flex: 1;
    height: auto; /* Override fixed height */
    overflow-y: auto;
    margin-bottom: 0;
    border: 1px solid #ddd; /* fallback */
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px 8px 0 0;
}

.focuses-page .focuses-actions {
    flex: 0 0 auto;
    padding: 10px;
    background: #f9f9f9;
    border: 1px solid #ddd; /* fallback */
    border: 1px solid var(--border-color, #ddd);
    border-top: none;
    border-radius: 0 0 8px 8px;
    margin-top: 0;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.focuses-table-container table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.focuses-table-container thead th {
    position: sticky;
    top: 0;
    background-color: #f5f5f5;
    background-color: var(--bg-secondary, #f5f5f5);
    z-index: 10;
    box-shadow: 0 1px 0 #ddd;
    box-shadow: 0 1px 0 var(--border-color, #ddd);
}

/* Remove Button (X) */
.btn-remove-x {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 6px;
    line-height: 1;
    width: 100%;
    height: 100%;
    /* min-height: 32px; */
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-x:hover {
    background: #f8d7da;
    color: #c82333;
}

/* Badge Styles */
.topic-badge {
    display: inline-flex;
    align-items: center;
    background: #e8f4f8;
    border: 1px solid #b8daed;
    border-radius: 4px;
    padding: 6px 10px;
    margin: 4px 4px 4px 0;
    font-size: 14px;
    color: #0c5460;
    transition: transform 0.1s;
}

.topic-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.flag-badge {
    display: inline-flex;
    align-items: center;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 6px 10px;
    margin: 4px 4px 4px 0;
    font-size: 14px;
    color: #155724;
    transition: transform 0.1s;
}

.flag-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Badge Remove Button */
.btn-badge-remove {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    margin-left: 8px;
    line-height: 1;
}

.btn-badge-remove:hover {
    transform: scale(1.3);
}

/* Drag Handle */
.drag-handle {
    cursor: grab;
    color: #6c757d;
    font-size: 14px;
    font-weight: bold;
    user-select: none;
    border-radius: 3px;
    transition: all 0.2s;
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle:hover {
    background: #f8f9fa;
    color: #495057;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Drag and Drop States */
.edit-table tr.dragging {
    /* No visual changes to the dragged row - keep it normal */
}

.edit-table tr.drag-over {
    border-top: 4px solid #2c5aa0 !important;
}

.edit-table tr.drag-over-bottom {
    border-bottom: 4px solid #2c5aa0 !important;
}

/* Remove draggable styling from rows since only handle is draggable now */

/* Input Container with Margin */
.input-container {
    margin-top: 10px;
}

/* Editable Abstract Div */
.editable-abstract {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    resize: vertical;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.editable-abstract:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

.editable-abstract:empty::before {
    content: attr(data-placeholder);
    color: #999;
    font-style: italic;
}

.editable-abstract:focus:empty::before {
    content: '';
}

/* Read-only Input */
.readonly-input {
    background: #f5f5f5 !important;
    color: #666;
    cursor: not-allowed;
}

.readonly-input:focus {
    border-color: #ccc;
    box-shadow: none;
}

/* Editable JSON Textarea */
.editable-json {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
    resize: vertical;
    tab-size: 2;
}

.editable-json:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.1);
}

/* Field Hint Text */
.field-hint {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Edit Page Layout */
.edit-container {
    padding: 40px;
    font-family: sans-serif;
    max-width: 1000px;
    margin: 0 auto;
}

.edit-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.edit-header h1 {
    color: #333;
    margin: 0;
}

.back-link {
    color: #2c5aa0;
    text-decoration: none;
    font-size: 14px;
}

.back-link:hover {
    text-decoration: underline;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.success-message {
    background: #efe;
    border: 1px solid #cfc;
    color: #070;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.edit-form {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section h2 {
    color: #333;
    font-size: 18px;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #2c5aa0;
}

/* Section Header with Button */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #2c5aa0;
}

.section-header h2 {
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.edit-pending-note {
    color: #2c5aa0;
    font-size: 0.9em;
    font-weight: normal;
    margin-left: 6px;
}

/* Top Save Button */
.btn-save-top {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-save-top:hover {
    background: #218838;
}

.btn-save-top:active {
    background: #1e7e34;
}

/* Floating Save Button */
.form-actions.sticky-bottom {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    z-index: 1000;
}

.btn-save-sticky {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-save-sticky:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-save-sticky:active {
    background: #1e7e34;
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-save-sticky.btn-save-delete {
    background: #dc3545;
}

.btn-save-sticky.btn-save-delete:hover:not(:disabled) {
    background: #c82333;
}

.btn-save-sticky.btn-save-delete:active {
    background: #bd2130;
}

/* Subdued delete toggle next to Basic Information */
.btn-delete-toggle {
    background: transparent;
    color: #888;
    border: 1px solid #ccc;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-toggle:hover {
    color: #666;
    border-color: #999;
    background: #f5f5f5;
}

.btn-delete-toggle.active {
    color: #c82333;
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 6px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid #28a745;
}

.toast-success {
    border-left-color: #28a745;
}

.toast-error {
    border-left-color: #dc3545;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.toast-close {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.toast-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.toast-hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(calc(100% + 20px));
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(calc(100% + 20px));
        opacity: 0;
    }
}

/* Pending page: comments */
.pending-filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.pending-filter-btn {
    padding: 6px 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f9fa;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.pending-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.pending-filter-btn.active {
    background: #2c5aa0;
    color: white;
    border-color: #2c5aa0;
}

.pending-delete-paper {
    background: #ffe6e6;
    padding: 12px;
    border-radius: 6px;
}

.pending-delete-label {
    font-weight: bold;
    color: #dc3545;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.pending-comments {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f0f4f8;
    border-radius: 6px;
    font-size: 13px;
}

.pending-comment-item {
    margin-bottom: 6px;
}

.pending-comment-item:last-child {
    margin-bottom: 0;
}

.pending-comment-user {
    font-weight: 600;
    color: #2c5aa0;
}

.pending-comment-text {
    margin-left: 4px;
}

/* Pending page: approve/reject actions */
.pending-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.btn-approve-pending {
    padding: 6px 14px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.btn-approve-pending:hover:not(.faded) {
    background: #c3e6cb;
}

.btn-approve-pending.selected {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.btn-approve-pending.selected:hover {
    background: #218838;
}

.btn-approve-pending.faded {
    opacity: 0.4;
}

.btn-approve-pending.faded:hover {
    opacity: 0.7;
}

.btn-reject-pending {
    padding: 6px 14px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, opacity 0.2s;
}

.btn-reject-pending:hover:not(.faded) {
    background: #f5c6cb;
}

.btn-reject-pending.selected {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn-reject-pending.selected:hover {
    background: #c82333;
}

.btn-reject-pending.faded {
    opacity: 0.4;
}

.btn-reject-pending.faded:hover {
    opacity: 0.7;
}

.pending-confirm-toast {
    border-left-color: #2c5aa0;
}

.btn-confirm-pending {
    padding: 6px 14px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.btn-confirm-pending:hover {
    background: #1e3a6f;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c5aa0;
}

.form-group .help-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.array-field {
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 15px;
    background: #f9f9f9;
}

.array-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.array-item:last-child {
    margin-bottom: 10px;
}

.array-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.array-item-title {
    font-weight: 500;
    color: #555;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-remove:hover {
    background: #c82333;
}

.btn-add {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.btn-add:hover {
    background: #218838;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.btn-primary {
    background: #2c5aa0;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-primary:hover:not(:disabled) {
    background: #1e3a6f;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-apply {
    background: #dc3545;
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.btn-apply:hover:not(:disabled) {
    background: #c82333;
}

.btn-apply:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}

.operate-footer-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #5a6268;
}

.readonly-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 3px;
    padding: 10px 15px;
    font-size: 13px;
    color: #666;
}

.nested-form-group {
    margin-bottom: 15px;
}

.nested-form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.topics-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    min-height: 40px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: #fafafa;
}

.flags-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    min-height: 40px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: #fafafa;
}

/* Search Page Styles */
.search-container {
    padding: 40px;
    font-family: sans-serif;
    max-width: 1200px;
    margin: 0 auto;
}

.search-header {
    margin-bottom: 30px;
}

.search-header h1 {
    color: #333;
    margin: 0 0 10px 0;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f9f9f9;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.search-form .form-row {
    display: flex;
    gap: 15px;
}

.search-form .form-group {
    flex: 1;
    margin-bottom: 0px;
}

.search-form .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.search-form .form-group input,
.search-form .form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-form .form-group input:focus,
.search-form .form-group select:focus {
    outline: none;
    border-color: #2c5aa0;
}

.radio-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.results-info {
    color: #666;
    font-size: 14px;
}

.results-info .count {
    font-weight: bold;
    color: #333;
}

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

.paper-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s;
}

.paper-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Paper item with score band (for validation view) */
.paper-item-with-score {
    display: flex;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.paper-item-with-score:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.paper-item-with-score .score-band {
    color: white;
    padding: 20px 15px;
    min-width: 70px;
    width: 70px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3a6f 100%);
}

.paper-item-with-score .score-value {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.paper-item-with-score .paper-content-wrapper {
    flex: 1;
    min-width: 0;
}

.paper-item-with-score .paper-content-wrapper .paper-item {
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.paper-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c5aa0;
    margin: 0 0 10px 0;
}

.paper-authors-container {
    margin-bottom: 10px;
}

.paper-authors {
    color: #555;
    margin-bottom: 5px;
}

.paper-authors strong {
    font-weight: 500;
}

.paper-institutions {
    color: #777;
    font-size: 12px;
    line-height: 1.4;
    margin-left: 20px;
}

.paper-institutions sup {
    margin-right: 2px;
}

.author-name,
.institution-item {
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 3px;
    transition: background-color 0.15s;
}

.author-name:hover,
.institution-item:hover {
    background-color: #e9ecef;
}

.author-name.highlight,
.institution-item.highlight {
    background-color: #cfe2ff;
}

.author-name.search-match,
.institution-item.search-match,
.release-venue.search-match {
    font-weight: bold;
}

.paper-collapsible-section {
    margin-top: 10px;
}

.toggle-details-button {
    background: none;
    border: none;
    color: #2c5aa0;
    cursor: pointer;
    font-size: 13px;
    padding: 5px 0;
    text-align: left;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-details-button:hover {
    color: #1e3a6f;
}

.toggle-details-button .item-toggle {
    margin-left: 0;
}

.details-content {
    display: none;
    margin-top: 10px;
}

.details-content.expanded {
    display: block;
}

.paper-abstract-section {
    margin-top: 8px;
    margin-bottom: 10px;
}

.paper-abstract {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    transition: max-height 0.3s ease;
    position: relative;
}

.paper-abstract.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.paper-abstract.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 50%;
    height: 1.5em;
    background: linear-gradient(to right, transparent, white);
    pointer-events: none;
}

.paper-abstract.expanded {
    display: block;
    overflow: visible;
}

.paper-abstract.expanded::after {
    display: none;
}

.paper-abstract:hover {
    color: #444;
}

.paper-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #777;
}

.paper-meta-item {
    margin-top: 10px;
}

.paper-releases {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 10px;
}

.release-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
}

.release-date {
    font-weight: bold;
    min-width: 85px;
}

.release-status {
    color: #28a745;
    min-width: 125px;
}

.release-venue {
    color: #555;
}

.clickable-venue {
    cursor: pointer;
    padding: 1px 3px;
    border-radius: 3px;
    transition: background-color 0.15s;
}

.clickable-venue:hover {
    background-color: #cfe2ff;
}

.clickable-year {
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.15s;
}

.clickable-year:hover {
    background-color: #cfe2ff;
}

.paper-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    align-items: center;
}

.topics-more-link {
    color: #2c5aa0;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 8px;
}

.topics-more-link:hover {
    text-decoration: underline;
}

.topics-hidden {
    display: none;
}

.topics-hidden.visible {
    display: contents;
}

.badge {
    background: #e8e8e8;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.badge.topic {
    background: #cfe2ff;
    color: #084298;
}

.badge.link {
    background: #e2e3e5;
    color: #41464b;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.badge.link:hover {
    background: #c6c8ca;
}

.badge.pdf {
    background: #dc3545;
    color: white;
    text-decoration: none;
    cursor: pointer;
    margin-left: 8px;
    transition: background 0.2s;
}

.badge.pdf:hover {
    background: #bb2d3b;
}

.paper-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.paper-title-link {
    color: inherit;
    text-decoration: none;
}

.paper-title-link:hover {
    text-decoration: underline;
}

.pagination {
    display: grid;
    grid-template-columns: 1fr auto auto auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
}

.pagination .results-info {
    justify-self: start;
}

.pagination button {
    padding: 8px 16px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    min-width: 90px;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination button:not(:disabled):hover {
    background: #1e3a6f;
}

.pagination .page-info {
    color: #666;
    font-size: 14px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

.validation-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.validation-buttons button {
    padding: 6px 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    background: white;
}

.validation-buttons button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.validation-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.validation-buttons .btn-yes {
    color: #0d6efd;
    border-color: #0d6efd;
}

.validation-buttons .btn-yes:hover:not(:disabled) {
    background: #0d6efd;
    color: white;
}

.validation-buttons .btn-no {
    color: #dc3545;
    border-color: #dc3545;
}

.validation-buttons .btn-no:hover:not(:disabled) {
    background: #dc3545;
    color: white;
}

.validation-buttons .btn-unknown {
    color: #6c757d;
    border-color: #6c757d;
}

.validation-buttons .btn-unknown:hover:not(:disabled) {
    background: #6c757d;
    color: white;
}

.validation-buttons .status-message {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 13px;
    font-style: italic;
}

.btn-clear {
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-clear:hover {
    background: #5a6268;
}

/* Operate page */
.operate-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 80px);
    padding-bottom: 70px;
}

.operate-content {
    flex: 1;
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.operate-form {
    margin-bottom: 24px;
}

.operate-form .form-group {
    max-width: 600px;
}

.operate-editor-group {
    max-width: none !important;
    width: 100%;
}

.operate-blocks-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.operate-blocks-bar select {
    max-width: 300px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.operate-blocks-bar .btn-block-update {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #6c757d;
    background: #6c757d;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.operate-blocks-bar .btn-block-update:hover {
    background: #5a6268;
}

.operate-blocks-bar .btn-block-new {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #28a745;
    background: #28a745;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.operate-blocks-bar .btn-block-new:hover {
    background: #218838;
}

.operate-blocks-bar .btn-block-clone {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #007bff;
    background: #007bff;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.operate-blocks-bar .btn-block-clone:hover {
    background: #0069d9;
}

.operate-blocks-bar .btn-block-delete {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #dc3545;
    background: #dc3545;
    color: white;
    cursor: pointer;
    font-size: 13px;
}

.operate-blocks-bar .btn-block-delete:hover {
    background: #c82333;
}

.operate-blocks-bar .btn-block-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.operate-blocks-bar .btn-block-delete:disabled:hover {
    background: #dc3545;
}

.monaco-editor-container {
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.operate-results-section {
    margin-top: 24px;
}

.operate-traceback {
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    margin: 8px 0 0 0;
}

.operate-section-header {
    margin: 24px 0 12px 0;
    font-size: 18px;
    color: #333;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 8px;
}

.operate-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 40px;
    background: #f9f9f9;
    border-top: 1px solid #ddd;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.operate-counts {
    font-size: 14px;
    color: #555;
}

.operate-apply-success {
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    color: #155724;
    font-size: 16px;
}

/* Workset Styles */
.workset-container {
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.workset-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.workset-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#pendingContainer .workset-item.pending-selected {
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px #2c5aa0;
}

.workset-content {
    display: flex;
    gap: 0;
    align-items: stretch;
}

.score-band {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3a6f 100%);
    color: white;
    padding: 20px 15px;
    min-width: 80px;
    width: 80px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-radius: 8px 0 0 8px;
    font-weight: 600;
}

/* Score band color classes - gradient from green (high) to blue to red (low) */
.score-band.score-20 {
    background: linear-gradient(180deg, #28a745 0%, #1e7e34 100%);
}

.score-band.score-10 {
    background: linear-gradient(180deg, #5cb85c 0%, #449d44 100%);
}

.score-band.score-5 {
    background: linear-gradient(180deg, #17a2b8 0%, #117a8b 100%);
}

.score-band.score-3 {
    background: linear-gradient(180deg, #2c5aa0 0%, #1e3a6f 100%);
}

.score-band.score-2 {
    background: linear-gradient(180deg, #6f42c1 0%, #5a32a3 100%);
}

.score-band.score-1 {
    background: linear-gradient(180deg, #fd7e14 0%, #dc6502 100%);
}

.score-band.score-0 {
    background: linear-gradient(180deg, #dc3545 0%, #bd2130 100%);
}

.score-value {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    word-break: break-word;
}

.workset-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 12px;
    border-bottom: 2px solid #ddd;
    background: #f9f9f9;
    border-radius: 0 8px 0 0;
    flex-shrink: 0;
    align-items: center;
}

.tab-button {
    padding: 6px 12px;
    margin: 6px 4px;
    border: none;
    background: #e0e0e0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    border-radius: 12px;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    line-height: 1.2;
    position: relative;
}

/* Badge classes for paper content indicators */
.tab-button.has-releases {
    background: #d4edda;
    color: #155724;
}

.tab-button.has-affiliations {
    background: #e0ccff;
    color: #5a189a;
}

/* Combined states - use the most prominent feature */
.tab-button.has-releases.has-affiliations {
    background: linear-gradient(135deg, #d4edda 0%, #e0ccff 100%);
    color: #333;
}

.tab-button .tab-title {
    display: block;
    line-height: 1.3;
}

.tab-button .tab-subtitle {
    display: block;
    font-size: 9px;
    opacity: 0.75;
    line-height: 1.1;
    margin-top: 1px;
}

.tab-button::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 4px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
}

.tab-button.has-pdf::after {
    background: #dc3545;
}

.tab-button:hover {
    filter: brightness(0.92);
    transform: scale(1.05);
}

.tab-button.active {
    box-shadow: 0 0 0 2px #2c5aa0;
    transform: scale(1.05);
}

.tab-contents {
    position: relative;
    min-height: 200px;
    overflow-y: auto;
    flex: 1;
}

.tab-contents > .tab-content {
    padding: 20px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Diff view tab buttons - small, over top right of paper */
.diff-view-tabs-wrapper {
    position: relative;
}

.diff-tab-buttons {
    position: absolute;
    top: 0px;
    right: 12px;
    display: flex;
    gap: 4px;
    z-index: 10;
}

.diff-tab {
    padding: 2px 6px;
    border: none;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    border-radius: 3px;
    transition: background 0.15s;
}

.diff-tab-diff {
    color: #6f42c1;
}

.diff-tab-diff:hover,
.diff-tab-diff.active {
    background: #e8d8fa;
}

.diff-tab-old {
    color: #dc3545;
}

.diff-tab-old:hover,
.diff-tab-old.active {
    background: #f8d7da;
}

.diff-tab-new {
    color: #28a745;
}

.diff-tab-new:hover,
.diff-tab-new.active {
    background: #90e5a7;
}

.diff-tab-contents {
    position: relative;
    min-height: 200px;
    overflow-y: auto;
    flex: 1;
}

.diff-tab-contents .tab-content.active {
    display: block;
}

/* Diff view styles - added = green (new), removed = red (deleted) */
/* Scoped under .diff-view with higher specificity to override .badge, .badge.topic, .badge.link, etc. */
.diff-view .diff-added,
.diff-view .badge.diff-added,
.diff-view .author-name.diff-added,
.diff-view .institution-item.diff-added,
.diff-view .release-item.diff-added,
.diff-view span.diff-added,
.diff-view td.diff-added,
.diff-view tr.diff-added {
    background-color: rgba(182, 255, 182, 0.6) !important;
}

.diff-view .diff-removed,
.diff-view .badge.diff-removed,
.diff-view .author-name.diff-removed,
.diff-view .institution-item.diff-removed,
.diff-view .release-item.diff-removed,
.diff-view span.diff-removed,
.diff-view td.diff-removed,
.diff-view tr.diff-removed {
    background-color: rgba(255, 182, 182, 0.6) !important;
}

.diff-view .diff-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
}

.diff-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.diff-legend-hint {
    margin-left: auto;
    font-size: 11px;
    opacity: 0.7;
}

.diff-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.tab-button.diff-v1 {
    box-shadow: 0 0 0 2px rgba(34, 139, 34, 0.7);
}

.tab-button.diff-v2 {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.7);
}

.paper-content {
    padding: 0;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.info-table thead {
    background: #f9f9f9;
    border-bottom: 2px solid #ddd;
}

.info-table td {
    padding: 5px;
}

.info-table .info-key {
    font-weight: 500;
    color: #2c5aa0;
    width: 200px;
}

.info-table .info-value {
    color: #666;
    word-break: break-word;
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 12px;
}

.info-table tbody tr:hover {
    background: #f9f9f9;
}

/* Capabilities Management Styles */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.capabilities-table th:nth-child(1) { width: 25%; }
.capabilities-table th:nth-child(2) { width: 70%; }
.capabilities-table th:nth-child(3) { width: 5%; text-align: center; }

.capabilities-badges-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    padding: 4px;
    min-height: 40px;
}

.capabilities-badges-cell .topic-badge {
    margin: 0;
}

.capabilities-badges-cell .topic-badge.implicit-capability {
    opacity: 0.5;
    background: #e0e0e0;
    border-color: #ccc;
    color: #666;
}

.capability-input-container {
    position: relative;
    flex: 1 1 auto;
    min-width: 200px;
    max-width: 100%;
}

.capability-autocomplete {
    width: 100%;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 3px 3px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #f0f0f0;
}

.cell-center {
    text-align: center;
}

/* Exclusions Styles */
.exclusions-container {
    padding: 20px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.exclusions-header {
    margin-bottom: 30px;
}

.exclusions-header h2 {
    color: #333;
    margin-bottom: 20px;
}

.exclusions-actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.add-exclusion-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.exclusion-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    max-width: 500px;
}

.bulk-add-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bulk-exclusion-input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    font-family: monospace;
    min-height: 100px;
    resize: vertical;
    max-width: 800px;
}

.exclusion-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.exclusion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.exclusion-text {
    flex: 1;
    font-family: monospace;
    font-size: 14px;
    color: #333;
    word-break: break-all;
}

.exclusion-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #2c5aa0;
    font-size: 14px;
    word-break: break-all;
}

.exclusion-link:hover {
    text-decoration: underline;
}

.exclusion-type {
    font-weight: 600;
    font-family: monospace;
}

.exclusion-link-text {
    font-family: monospace;
    color: #2c5aa0;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    margin-top: 20px;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-btn {
    padding: 8px 16px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    min-width: 90px;
    transition: background 0.2s;
}

.pagination-btn:hover:not(:disabled) {
    background: #1e3a6f;
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Latest Group Tabs */
.latest-tabs-container {
    margin-top: 20px;
}

.latest-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #2c5aa0;
}

.latest-tab-button {
    padding: 12px 24px;
    border: none;
    background: #e8e8e8;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    margin-right: 4px;
    position: relative;
    bottom: -2px;
    border: 2px solid transparent;
    border-bottom: none;
}

.latest-tab-button:hover {
    background: #d8d8d8;
    color: #333;
}

.latest-tab-button.active {
    background: #fff;
    color: #2c5aa0;
    border-color: #2c5aa0;
    border-bottom: 2px solid #fff;
    z-index: 1;
}

.latest-tab-count {
    font-weight: 700;
    margin-left: 4px;
}

.latest-tab-content {
    padding: 20px 0;
}

/* Generated Links */
.generated-links {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.generated-links h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 2px solid #2c5aa0;
    padding-bottom: 8px;
}

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

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.link-item:last-child {
    margin-bottom: 0;
}

.link-title {
    font-weight: 500;
    color: #333;
}

.link-urls {
    display: flex;
    gap: 10px;
}

.link-main,
.link-archive {
    padding: 6px 14px;
    border-radius: 3px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.link-main {
    background: #2c5aa0;
    color: white;
}

.link-main:hover {
    background: #1e3a6f;
}

.link-archive {
    background: #e8e8e8;
    color: #555;
    border: 1px solid #ccc;
}

.link-archive:hover {
    background: #d8d8d8;
    color: #333;
}
