/* Faith & Ethics Benchmark - Web Interface Styles */

:root {
    --primary-color: #002E5D;  /* BYU Blue */
    --secondary-color: #0062B8;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-gray: #f8f9fa;
    --medium-gray: #e9ecef;
    --dark-gray: #6c757d;
    --text-color: #212529;
    --border-radius: 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.logo:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links li {
    display: flex;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 0.8;
}

/* Main content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--dark-gray);
    font-size: 1.1rem;
}

/* Consortium Header Section */
.consortium-section {
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.consortium-title {
    color: var(--dark-gray);
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.authors-section {
    padding: 1.25rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.authors {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.affiliations {
    font-size: 0.85rem;
    color: var(--dark-gray);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.affiliations-notes {
    font-size: 0.8rem;
    color: var(--dark-gray);
    font-style: italic;
    margin-bottom: 0;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1.5rem;
}

.action-card {
    background: white;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.action-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.action-card h5 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.action-card p {
    color: var(--dark-gray);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.action-card a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.action-card a:hover {
    color: var(--primary-color);
}

/* Stats Grid (Dashboard) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.stat-card h3 {
    font-size: 0.9rem;
    color: var(--dark-gray);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Dashboard sections */
.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section h3 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    font-size: 0.9rem; /* Slightly smaller font */
}

.data-table thead {
    background-color: var(--primary-color);
    color: white;
}

.data-table th,
.data-table td {
    padding: 8px 10px; /* Reduced from 12px 15px */
    text-align: left;
    border-bottom: 1px solid var(--medium-gray);
}

/* Column-specific styling - using nth-child only for consistency */

/* Column 1: Bank - truncate single line */
.data-table td:nth-child(1) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 2: Faith Community header - allow natural width */
.data-table th:nth-child(2) {
    white-space: normal;
    word-wrap: break-word;
}

/* Column 2: Faith Community data - simple word wrap */
.data-table td:nth-child(2) {
    max-width: 150px;
    white-space: normal;
    word-wrap: break-word;
}

/* Column 3: Question ID - truncate single line */
.data-table td:nth-child(3) {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 4: Category - truncate single line */
.data-table td:nth-child(4) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 5: Model - truncate single line */
.data-table td:nth-child(5) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 6: Score - centered, fixed width */
.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 60px;
    text-align: center;
}

/* Column 9: Status - centered, fixed width */
.data-table th:nth-child(9),
.data-table td:nth-child(9) {
    width: 70px;
    text-align: center;
}

/* Column 10: Eval Date - truncate single line */
.data-table td:nth-child(10) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Column 11: Actions - centered, fixed width */
.data-table th:nth-child(11),
.data-table td:nth-child(11) {
    width: 120px;
    text-align: center;
}

.data-table tbody tr:hover {
    background-color: var(--light-gray);
}

.data-table tbody tr.job-running {
    background-color: #fff3cd;
}

.data-table tbody tr.highlight {
    background-color: #ffffcc;
    animation: highlight-fade 3s ease-in-out;
}

@keyframes highlight-fade {
    0% { background-color: #ffff00; }
    100% { background-color: #ffffcc; }
}

.question-text {
    max-width: 500px;
}

/* Score styling */
.score-1 { color: var(--danger-color); font-weight: 600; }
.score-2 { color: #fd7e14; font-weight: 600; }
.score-3 { color: var(--warning-color); font-weight: 600; }
.score-4 { color: #20c997; font-weight: 600; }
.score-5 { color: var(--success-color); font-weight: 600; }

.score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    background-color: var(--light-gray);
}

.score-badge.score-5 { background-color: var(--success-color); color: white; }
.score-badge.score-4 { background-color: #20c997; color: white; }
.score-badge.score-3 { background-color: var(--warning-color); color: black; }
.score-badge.score-2 { background-color: #fd7e14; color: white; }
.score-badge.score-1 { background-color: var(--danger-color); color: white; }

/* Status badges */
.status-pending { color: var(--dark-gray); }
.status-running {
    color: var(--secondary-color);
    font-weight: 600;
}
.status-completed {
    color: var(--success-color);
    font-weight: 600;
}
.status-failed {
    color: var(--danger-color);
    font-weight: 600;
}
.status-cancelled {
    color: var(--warning-color);
    font-weight: 600;
}

/* Evaluation status badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.status-badge.status-success {
    background-color: var(--success-color);
    color: white;
}

.status-badge.status-failed {
    background-color: var(--danger-color);
    color: white;
}

.status-badge.status-warning {
    background-color: var(--warning-color);
    color: black;
}

/* Status code badges (HTTP-style) */
.status-code-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
}

.status-code-badge.status-ok {
    background-color: var(--success-color);
    color: white;
}

.status-code-badge.status-warning {
    background-color: var(--warning-color);
    color: black;
}

.status-code-badge.status-error {
    background-color: var(--danger-color);
    color: white;
}

/* Prompt pills (small version for tables) */
.prompt-pill-small {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 16px;
    color: white;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    min-width: 200px;
}

.filters button {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.filters button:hover {
    background-color: var(--secondary-color);
}

/* Buttons */
button, .button {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

button:hover {
    opacity: 0.9;
}

.primary-button {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 12px 24px;
}

.secondary-button {
    background-color: var(--medium-gray);
    color: var(--text-color);
}

.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Form sections */
.form-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.form-section select {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.selected-questions, .selected-answers {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.selected-questions h4, .selected-answers h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

#selected-list {
    max-height: 300px;
    overflow-y: auto;
}

#selected-list ul {
    list-style: none;
    padding: 0;
}

#selected-list li {
    padding: 4px 0;
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.placeholder {
    color: var(--dark-gray);
    font-style: italic;
}

/* Job status */
.job-status {
    background: var(--light-gray);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--secondary-color);
    margin-top: 2rem;
}

.job-status h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.success {
    color: var(--success-color);
    font-weight: 600;
}

.error {
    color: var(--danger-color);
    font-weight: 600;
}

.info {
    color: var(--dark-gray);
    font-style: italic;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.modal-large {
    max-width: 1200px;
}

.close {
    color: var(--dark-gray);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-color);
}

.detail-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--medium-gray);
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.question-full {
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.answer-text, .rationale-text {
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    white-space: pre-wrap;
    line-height: 1.6;
}

.rubric-section {
    margin-top: 1rem;
}

.rubric-section h5 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.rubric-section pre {
    background: var(--light-gray);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    white-space: pre-wrap;
    line-height: 1.5;
}

.all-questions-section, .answers-section {
    margin-top: 2rem;
}

/* Result files list (in job details) */
.result-files-list {
    list-style: none;
    padding: 0;
    background: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.result-files-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--medium-gray);
}

.result-files-list li:last-child {
    border-bottom: none;
}

.result-files-list a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.result-files-list a:hover {
    text-decoration: underline;
}

/* Admin page */
.admin-link {
    color: var(--warning-color) !important;
}

.warning-banner {
    background-color: #fff3cd;
    border: 2px solid var(--warning-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 2rem;
    color: #856404;
}

.admin-section {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.admin-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.admin-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.admin-action:last-child {
    margin-bottom: 0;
}

.warning-action {
    border-color: var(--warning-color);
    background-color: #fff9e6;
}

.danger-action {
    border-color: var(--danger-color);
    background-color: #ffe6e6;
}

.action-info {
    flex: 1;
    margin-right: 2rem;
}

.action-info h4 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.action-info p {
    margin: 0;
    color: var(--dark-gray);
    font-size: 0.95rem;
}

.danger-button {
    background-color: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.danger-button:hover {
    background-color: #c82333;
}

.danger-button-extreme {
    background-color: #8B0000;
    padding: 12px 24px;
    font-weight: 600;
}

.danger-button-extreme:hover {
    background-color: #660000;
}

.warning-text {
    color: var(--danger-color);
    padding: 1rem;
    background-color: #ffe6e6;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

.danger-text {
    color: white;
    background-color: var(--danger-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    text-align: center;
}

.schema-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schema-item {
    padding: 1rem;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    background-color: var(--light-gray);
    transition: all 0.2s;
}

.schema-item.clickable {
    cursor: pointer;
}

.schema-item.clickable:hover {
    background-color: #e8f4f8;
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.schema-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.schema-path {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.schema-description {
    color: var(--dark-gray);
    font-size: 0.95rem;
    margin: 0;
}

.status-message {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 9999;
    font-weight: 500;
}

.status-info {
    background-color: var(--secondary-color);
    color: white;
}

.status-success {
    background-color: var(--success-color);
    color: white;
}

.status-error {
    background-color: var(--danger-color);
    color: white;
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

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

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    padding-top: 1.5rem;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 0;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
    }

    .filters select {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1rem;
    }
}

/* Builder Page - Stepper */
.stepper {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    opacity: 0.5;
}

.step::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 50%;
    height: 2px;
    background-color: var(--medium-gray);
    z-index: -1;
}

.step:first-child::before {
    display: none;
}

.step.active,
.step.completed {
    opacity: 1;
}

.step.completed .step-number {
    background-color: var(--success-color);
    color: white;
}

.step.completed::before {
    background-color: var(--success-color);
}

.step.active .step-number {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 4px rgba(0, 46, 93, 0.2);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--medium-gray);
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-label {
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-color);
}

/* Builder Page - Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 46, 93, 0.1);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: var(--dark-gray);
    font-size: 0.85rem;
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Builder Page - Questions List */
.questions-summary {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.questions-summary h4 {
    margin-bottom: 1rem;
}

#category-summary {
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.question-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    border: 1px solid var(--medium-gray);
}

.question-item-content {
    flex: 1;
}

.small-button {
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    background-color: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.small-button:hover {
    opacity: 0.9;
}

/* Builder Page - Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

#generation-log {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 1rem;
}

/* Builder Page - Detail Section */
.detail-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
}

.detail-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Sortable table headers */
.data-table th[data-sort] {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.data-table th[data-sort]:hover {
    background-color: var(--secondary-color);
}

.data-table th.sorted-asc,
.data-table th.sorted-desc {
    background-color: var(--secondary-color);
}

.sort-indicator {
    font-size: 0.85em;
    margin-left: 0.25rem;
    display: inline-block;
    min-width: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Collapsible sections */
.collapsible-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    margin: 1rem 0;
    user-select: none;
    transition: background-color 0.2s;
}

.collapsible-header:hover {
    background-color: var(--medium-gray);
}

.collapsible-icon {
    margin-right: 0.5rem;
    font-size: 0.9em;
    transition: transform 0.2s;
}

.collapsible-icon.open {
    transform: rotate(90deg);
}

.collapsible-content {
    display: none;
    margin: 0.5rem 0 1rem 0;
    padding: 1rem;
    background-color: #f5f5f5;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

.collapsible-content.open {
    display: block;
}

.json-content {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Answer tables for job results */
.answer-table-container {
    margin-bottom: 2rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.answer-table-header {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.answer-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.answer-table th {
    background-color: var(--light-gray);
    padding: 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--medium-gray);
    font-weight: 600;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.question-column {
    min-width: 250px;
    max-width: 400px;
}

.question-cell {
    padding: 0.75rem;
    border-bottom: 1px solid var(--medium-gray);
    vertical-align: top;
    white-space: normal;
    word-wrap: break-word;
    background-color: #f5f5f5;  /* Light gray background */
}

.question-cell em {
    font-style: italic;
    color: var(--dark-gray);
}

.answer-cell {
    padding: 0.75rem;
    border-bottom: 1px solid var(--medium-gray);
    border-left: 1px solid var(--medium-gray);
    vertical-align: top;
    max-width: 400px;
    cursor: pointer;
    position: relative;
}

.answer-cell:hover {
    /* Darken slightly on hover without overriding score color */
    filter: brightness(0.95);
}

.answer-cell-content {
    /* Truncate to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

.answer-cell::after {
    content: '👁️';
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 0.9em;
}

.answer-cell:hover::after {
    opacity: 0.6;
}

/* Error cell styling for failed answer generation */
.error-cell {
    background-color: #ffebee !important;
    color: #c62828;
    font-weight: 600;
    text-align: center;
}

.error-cell:hover {
    filter: brightness(0.95);
}

.error-cell .answer-cell-content {
    font-size: 0.9em;
    letter-spacing: 0.05em;
}

.answer-table tbody tr:hover {
    background-color: var(--light-gray);
}

.loading-tables {
    text-align: center;
    padding: 2rem;
    color: var(--dark-gray);
    font-style: italic;
}

.error-tables {
    padding: 1rem;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: var(--border-radius);
    color: #856404;
    margin-bottom: 1rem;
}

/* Modal for full answer view */
.answer-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.answer-modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 0;
    width: 80%;
    max-width: 800px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.answer-modal-header {
    padding: 1.5rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.answer-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.answer-modal-close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: opacity 0.2s;
}

.answer-modal-close:hover {
    opacity: 0.7;
}

.answer-modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.answer-modal-question {
    font-style: italic;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.answer-modal-answer {
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Question modal specific styles */
.question-modal-content {
    max-width: 1200px;
}

.model-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
}

.model-selector-single {
    padding: 1rem;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
    text-align: center;
}

.model-info-display {
    padding: 0.75rem 1rem;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--medium-gray);
    font-size: 0.9rem;
}

.model-nav-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.2s;
}

.model-nav-btn:hover {
    background-color: #001f3f;
}

.model-name-display {
    font-weight: 600;
    color: var(--text-color);
    min-width: 300px;
    text-align: center;
}

.model-counter {
    color: var(--dark-gray);
    font-size: 0.9em;
}

.question-detail-row-1 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--medium-gray);
}

.question-detail-row-2 {
    margin-top: 1rem;
}

.question-detail-col h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.question-detail-row-2 h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.detail-content {
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #fafafa;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--medium-gray);
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    .question-detail-row-1 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .question-modal-content {
        width: 95%;
        margin: 2% auto;
    }
}


/* User Profile Navigation */
.user-profile-nav {
    position: relative;
}

.user-avatar-container {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-nav {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s;
}

.user-avatar-nav:hover {
    border-color: var(--primary-color);
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    border: 2px solid #e2e8f0;
    transition: background 0.2s;
}

.admin-gear-icon {
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s;
}

.admin-gear-icon:hover {
    opacity: 0.8;
}

.user-avatar-placeholder:hover {
    background: var(--primary-dark);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-dropdown-info {
    flex: 1;
    min-width: 0;
}

.user-dropdown-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-email {
    font-size: 13px;
    color: #718096;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.user-dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0;
}


.user-dropdown-logout {
    display: block;
    padding: 12px 16px;
    color: #e53e3e !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
}

.user-dropdown-logout:hover {
    background: #fff5f5;
    color: #c53030 !important;
}

/* ========================================
   Login Page Styles
   ======================================== */

.login-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f0f4f8;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    margin-top: 0;
    margin-bottom: 24px;
    color: #202124;
    font-size: 24px;
    font-weight: 500;
}

/* Professional Google Button Styles */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 0 12px;
    height: 48px;
    font-family: "Google Sans", arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.btn-google:hover {
    background-color: #f7fafe;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3);
}

.btn-google:active {
    background-color: #f1f3f4;
}

.google-icon {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}

/* Multi-provider OAuth Button Styles */
.oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-oauth {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 0 12px;
    height: 48px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, box-shadow .2s;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.btn-oauth:hover {
    background-color: #f7fafe;
    border-color: #d2e3fc;
    box-shadow: 0 1px 2px rgba(60,64,67,0.3);
}

.btn-oauth:active {
    background-color: #f1f3f4;
}

.oauth-icon {
    margin-right: 12px;
    width: 20px;
    height: 20px;
}

/* Login Form Styles */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: #5f6368;
    font-size: 14px;
}

.divider::before, 
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dadce0;
}

.divider::before { 
    margin-right: 10px; 
}

.divider::after { 
    margin-left: 10px; 
}

.login-box input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.login-box input[type="password"]:focus {
    border-color: #1a73e8;
    outline: none;
}

.btn-submit {
    width: 100%;
    padding: 10px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.btn-submit:hover {
    background: #1557b0;
}

.login-box .error {
    color: #d93025;
    background: #fce8e6;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

/* ============================================================================
   User Management Styles
   ============================================================================ */

.users-table-container {
    margin-top: 1rem;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.users-table th,
.users-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--light-gray);
    font-weight: 600;
    color: var(--dark-gray);
}

.users-table tr:hover {
    background: #f8f9fa;
}

.users-table .actions-cell {
    white-space: nowrap;
}

.users-table .actions-cell button {
    margin-right: 0.5rem;
}

.users-table .actions-cell button:last-child {
    margin-right: 0;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-admin {
    background: var(--primary-color);
    color: white;
}

.empty-text {
    color: var(--dark-gray);
    font-style: italic;
    margin: 0;
}

.loading-text {
    color: var(--dark-gray);
    margin: 0;
}

.error-text {
    color: var(--danger-color);
    margin: 0;
}

/* Small button variant */
.secondary-button.small,
.danger-button.small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Admin action with vertical layout for user management */
.admin-action.invite-action {
    display: block;
}

.admin-action.invite-action .action-info {
    margin-right: 0;
}

.invite-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    margin-top: 0.75rem;
}

.invite-email-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid #9ca3af;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: white;
    resize: vertical;
    font-family: inherit;
    min-height: 2.5rem;
}

.invite-email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 46, 93, 0.1);
}

@media (max-width: 768px) {
    .admin-action {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-action .invite-form {
        width: 100%;
        min-width: auto;
        margin-top: 1rem;
    }

    .action-info {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .users-table {
        font-size: 0.8rem;
    }

    .users-table th,
    .users-table td {
        padding: 0.5rem;
    }
}