:root {
    --bg-dark: #1e1e1e;
    --bg-darker: #141414;
    --bg-darkest: #000000;
    --text-light: #e0e0e0;
    --text-dim: #a0a0a0;
    --text-error: #ff3300;
    --text-disabled: #888888;
    --accent: #4a76fc;
    --accent-link: #83a2ff;
    --input-bg: #2a2a2a;
    --border-color: #3a3a3a;
    --app-grey-yellow: #c2a26b;
    --app-green: #4caf50;
    --app-yellow: #ffa000;
    --app-red: #f44336;

  }

body, input, select, textarea, button {
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 0px 0px;
    margin: 0px;
}

body,h1,h2,h3,h4,h5,h6,div,span,p,img,ul { font-family: Arial, Helvetica, sans-serif; }
a {color: var(--accent-link)}
.root-container {
    margin: 0px 8px;
}

/* Response container with scrollable content */
#response-output-ad-hoc,
#response-output-batch {
    max-height: none;
    overflow: visible;
    padding: 15px;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    word-wrap: break-word;
}

.container { border: 1px solid var(--border-color);}

.container, .sidebar {
    background-color: var(--bg-darker);
}

.container-tabbed-ui {
    background-color: var(--bg-darker);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

#app-top-bar-OLD-7-Nov-2024 {
    max-height: 60px;
    overflow: hidden; /* This will hide any content that overflows the 50px height */
    /*display: flex; /* Optional: Helps to align child elements within the 50px height */
    align-items: center; /* Centers items vertically if they are flex items */
}

#app-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-height: 60px;
    padding: 5px;
    background-color: var(--bg-darker);
    position: relative;
    z-index: 100;
}

#app-top-bar a {
    text-decoration: none;
}

#corpus-filter-container {
    margin-top: 0px;
    padding-top: 0px;
}

.container-standard-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    width: 100%;
    box-sizing: border-box;
}

/* Redesign of the process selection wrapper */
.process-selection-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
}

.process-selection-wrapper .config-row {
    display: flex;
    align-items: flex-end;
}

.process-selection-wrapper .config-row:first-child .form-group {
    margin-right: 10px;
}

.process-selection-wrapper .config-row:first-child .btn {
    height: 38px;
}

#version-history-btn {
    height: 38px;
}


.container-standard-fields-block {
    display: block;
    padding: 10px;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    width: 100%;
    box-sizing: border-box;
}

.container-standard-fields .form-group {
    display: flex;
    margin-right: 10px;
}

.container-standard-fields .form-group label {
    margin-bottom: 5px;
    width: auto;
}

.container-standard-fields .form-group input,
.container-standard-fields .form-group select,
.container-standard-fields .form-group textarea {
    width: 100%;
}

/* If you want to maintain a specific width for certain inputs, you can add a class */
.container-standard-fields .form-group .narrow-input {
    width: 100px;
}

.container-standard-fields .form-group .medium-input {
    width: 200px;
}

.container-standard-fields .form-group .wide-input {
    width: 100%;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.categories-container {
    flex: 1 1 100%;
}

.resource-types-container {
    flex: 1 1 100%;
}

@media (min-width: 768px) {
    .categories-container {
        flex: 1 1 auto;
    }
}

.categories-container,
.advanced-container {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

.categories-container > label,
.advanced-container > label,
.resource-types-container > label,
.additional-options > label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    display: block;
}

.div-clickable {
    text-decoration: underline;
}

.div-clickable:hover {
    cursor: pointer;
}

.btn {
    padding: 10px 15px;
    background-color: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
  }
  
.btn:hover {
    background-color: #5a8fc7 !important;
}

.btn:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    text-decoration: none;
    cursor: pointer;
}

.error-message {
    color: var(--text-error);
    margin-bottom: 10px;
}

.hidden {
    display: none!important;
}

.popup-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 32px 36px;
    border-radius: 12px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 560px;
    min-width: 440px;
    overflow: hidden;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

#popup-message-header {
    font-weight: 600;
    font-size: 20px;
    color: #000 !important;
    margin: 0 0 16px 0;
    padding-left: 42px;
    padding-right: 40px;
    position: relative;
    text-align: left;
}

#popup-message-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#popup-message-content {
    color: #000 !important;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-line;
    text-align: left;
    padding-left: 42px;
}

.popup-message-body {
    padding: 0;
}

/* Success popup */
.popup-message.success .popup-message-header::before {
    content: '✓';
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    line-height: 32px;
    font-size: 20px;
    font-weight: bold;
}

.popup-message.success {
    border-top: 4px solid #10b981;
}

/* Error popup */
.popup-message.error .popup-message-header::before {
    content: '✕';
    background: none;
    color: #ef4444;
    display: inline-block;
    text-align: center;
    line-height: 32px;
    font-size: 24px;
    font-weight: bold;
}

.popup-message.error {
    border-top: 4px solid #ef4444;
}

/* Warning popup */
.popup-message.warning .popup-message-header::before {
    content: '⚠';
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    line-height: 32px;
    font-size: 20px;
    font-weight: bold;
}

.popup-message.warning {
    border-top: 4px solid #f59e0b;
}

/* Info popup */
.popup-message.info .popup-message-header::before {
    content: 'i';
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    line-height: 32px;
    font-size: 20px;
    font-weight: bold;
}

.popup-message.info {
    border-top: 4px solid #3b82f6;
}

/* Partial Success popup */
.popup-message.partial .popup-message-header::before {
    content: '⚠';
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 50%;
    display: inline-block;
    text-align: center;
    line-height: 32px;
    font-size: 20px;
    font-weight: bold;
}

.popup-message.partial {
    border-top: 4px solid #f59e0b;
}

.popup-message .close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.popup-message .close-btn:hover {
    background-color: #e5e7eb;
    color: #1f2937;
    border-color: #9ca3af;
}
/* Response container and info-popup */

.response-container {
    position: relative;
    border: 1px solid var(--border-color);
    padding: 10px;
    margin-top: 10px;
    min-height: 50px;
}

.response-icons {
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    z-index: 10;
}

.info-icon, .job-info-icon {
    position: absolute;
    left: 5px;
    cursor: pointer;
    font-size: 18px;
}

.copy-icon {
    position: absolute;
    right: 5px;
    cursor: pointer;
    font-size: 18px;
}

#response-output-ad-hoc,
#response-output-batch {
    margin-top: 30px; /* Add some top margin to make room for the icons */
}

#response-output-ad-hoc {
    margin-right: 20px;
    margin-left: 20px;
}
    
  .popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
  }

  .popup:not(.hidden) {
    display: block;
  }

  
  .popup-content {
    background-color: var(--bg-darker);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 600px;
  }
  
  .close-popup {
    color: var(--text-dim);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
  }
  
  .close-popup:hover {
    color: var(--text-light);
  }

  /* Modal popup */

.modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}
.modal-content {
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 300px;
    background-color: var(--bg-darker);
}

.modal-content h2 {
    font-size: 20px;
}

.modal-content input {
    width: calc(100% - 20px)!important;
    margin: 10px 0;
    padding: 10px;
}

.modal-content button {
    width:100%!important;
    margin: 10px 0;
    padding: 10px;
    background-color: var(--accent);
    color: var(--text-light);
    border: none;
    cursor: pointer;
}

.large-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.large-modal-content {
    background-color: #1e1e1e;
    border-radius: 5px;
    max-width: 1024px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

@media (max-width: 768px) {
    .large-modal-content {
        width: calc(100% - 50px);
        margin: 25px;
    }
}

.large-modal-content .form-group {
    width: 100%;
}

.large-modal-content .form-group,
.large-modal-content input,
.large-modal-content textarea {
    margin-bottom: 15px;
    width: 100%;
}

.large-modal-content input,
.large-modal-content select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    background-color: #2e2e2e;
    color: #ffffff;
    border: 1px solid #444;
}

.large-modal-content textarea {
    width: 100%;
    min-height: 200px;
    max-height: calc(100vh - 300px);
    resize: vertical;
}

.large-modal-content button {
    background-color: #e67e22; /* Orange color */
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 3px;
    width: auto;
    min-width: 120px;
    margin-right: 10px;
    margin-top: 10px;
}

.large-modal-content button:hover {
    background-color: #d35400; /* Darker orange on hover */
}

.large-modal-content .close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #ffffff;
}

.collapsible-label {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.collapsible-label span {
    margin-right: 5px;
}

.collapsible-label i {
    transition: transform 0.3s ease;
}

.collapsible-label.active i {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.collapsible-content.show {
    max-height: 1000px; /* Adjust this value based on your content */
}

.menu-bar {
    float: right;
    position: relative;
    top: -35px;
}

.menu-bar a.menu-item {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.menu-bar .menu-item:hover {
    text-decoration: underline;
}

.menu-bar .menu-item.active {
    background-color: var(--accent);
    padding: 2px 5px;
    border-radius: 3px;
}

.menu-item {
    cursor: pointer;
}
.menu-item:hover {
    background-color: rgb(239, 239, 239);
}

.status-indicator {
    background-color: var(--bg-darker);
    color: var(--text-dim);
    border: 1px solid var(--border-color);
    font-size: 14px;
    padding: 2px 4px;
    color: rgb(104, 104, 104);
}
.status-not-started {
    color: var(--text-dim);
    border-color: var(--border-color);
}

.status-getting-ready {
    color: var(--text-dim);
    border-color: var(--border-color);
}

.status-ready {
    color: var(--app-grey-yellow);
    border-color: var(--app-grey-yellow);
}

.status-completed { 
    color: var(--app-green);
    border-color: var(--app-green);
}

.status-started, 
.status-running,
.status-processing { 
    color: var(--app-yellow);
    border-color: var(--app-yellow);
}

.status-failed, 
.status-not-found, 
.status-error { 
    color: var(--app-red);
    border-color: var(--app-red);
}

.status-indicator.status-error::after {
    content: '*';
    margin-left: 2px;
}

/*
.status-completed { color: rgb(0, 129, 0); }
.status-started { color: rgb(199, 129, 0); }
.status-failed { color: rgb(250, 0, 0);}
.status-not-found { color: rgb(250, 0, 0);}
.status-error { color: rgb(250, 0, 0);}
*/
.container-tabbed-ui { border: 1px solid var(--border-color); }
.container-tabbed-ui textarea { width: 100%; font-family: Arial, Helvetica, sans-serif; }
.container-tabbed-ui .btn { margin-top: 10px; margin-bottom: 10px; }
.container-tabbed-ui textarea {
    width: calc(100% - 20px)!important;
    margin-bottom: 10px;
    margin-top: 5px;
    padding: 10px;
}
.tabs-holder { display: flex;}
.mini-header { width: 100%; font-size: 16px; font-weight: bold; margin-block-start: 0em;}
.tab-label { font-size: 12px; font-weight: bold; margin-block-start: 0em;}

.advanced-container {
    flex: 1 1 100%;
}

.additional-options {
    margin-top: 10px;
}

.additional-options .checkbox-wrapper {
    margin-bottom: 5px;
}

/* Container for checkboxes */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px; /* Adds space between checkbox wrappers */
}


/* Checkbox wrapper styles */
.checkbox-wrapper {
    display: inline-flex;
    align-items: center;
}

/* Styles for the label */
.checkbox-wrapper label {
    cursor: pointer;
    line-height: 18px; /* Matches the height of the checkbox */
    display: inline-block;
    vertical-align: top; /* Aligns top of label with top of checkbox */
    padding-top: 1px; /* Fine-tune vertical alignment */
    position: relative;
    top: 3px;
    left: -2px;
    margin-bottom: 5px;
    margin-right: 0px;
}


/* Base styles for checkboxes */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--accent);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    background-color: var(--bg-dark);
    position: relative;
    margin: 0;
    margin-right: 6px; /* Adds space between checkbox and label */
}

/* Checked state */
input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Checkmark */
input[type="checkbox"]:checked::after {
    content: '\2714';
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--bg-dark);
}

/* Disabled state */
input[type="checkbox"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Checked and disabled state */
input[type="checkbox"]:checked:disabled {
    background-color: var(--accent);
    border-color: var(--accent);
    opacity: 0.8;
}

/* Ensure the checkmark is visible when disabled */
input[type="checkbox"]:checked:disabled::after {
    opacity: 1;
}

.selected-tab { 
    background-color: var(--bg-dark) !important;
    color: var(--text-light);
}
.tab { 
    background-color: var(--bg-darker);
    color: var(--text-dim);
    padding: 10px 15px;
    transition: background-color 0.3s ease;
}
.tab:hover { 
    cursor: pointer;
}
.tab-content-wrapper {
    background-color: var(--bg-dark);
    padding: 10px;
}

.form-group {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    margin-right: 10px;
    flex: 0 1 auto;
}

.form-group label {
    color: var(--text-dim);
}

#batch-wrapper .form-group {
    margin-top: 15px;
}

#batch-wrapper .form-group label {
    margin-bottom: 5px;
}

input[type="text"], input[type="number"], input[type="password"], textarea, select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

textarea:disabled {
    color: var(--text-disabled);
}

button, .btn {
    background-color: var(--accent);
    color: var(--text-light);
}

.form-label {
    color: var(--text-dim);
}

/* Ad-hoc questions form */
#response-output {
    width: 100%;
    border: 1px solid var(--border-color);
}


/* Batch questions form */


/* Job table */

.page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    margin: 0px 8px;   
    padding: 5px;
}

.corpus-results {
    display: flex;
    flex-direction: column;
}

.document-info {
    background-color: var(--bg-light);
    padding: 10px 8px;
    margin: 0;  /* Remove margin */
    border-radius: 0;  /* Remove border radius */
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 75;
}

.document-info .filename {
    font-size: 18px;
    font-weight: bold;
}

.document-container {
    position: relative;
    flex: 1;
    overflow: auto;
    margin: 0;  /* Remove margin */
    padding: 0;  /* Remove padding */
    border-radius: 0;  /* Remove border radius */
}

/* Specific table styling for CSV view */
.csv-table {
    width: 100%;
    border-collapse: collapse;
}

.csv-table th {
    position: sticky;
    top: 0;
    background: var(--primary);
    z-index: 10;
}

.csv-table th, .csv-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
}


.table-container {
    flex: 1;
    min-height: 0; /* This is important for Firefox */
    display: flex;
    flex-direction: column;
    position: relative;
}

.table-responsive {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    overflow: auto;
}

/* HTML content container */
.html-content {
    position:absolute;
    padding: 0px;
    max-width: 100%;
    overflow: auto;
}

#container-table {
    min-width: 100%;
}

.job-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.job-table th, .job-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.job-table th {
    background-color: var(--bg-dark);
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.job-table tr:nth-child(even) {
    background-color: var(--bg-dark);
}

.job-table .job-id, .job-table .shard {
    white-space: nowrap;
}

.job-table .question, .job-table .answer, .filters {
    max-width: 300px;
    min-width: 200px;
}

.job-table .guidance, .job-table .extra-instruction {
    max-width: 200px;
    min-width: 100px;
}

.job-table .start-datetime, .job-table .completed-datetime {
    white-space: nowrap;
    text-align: right;
}

.job-table .large-text {
    position: relative;
    padding-right: 70px; /* Make room for the expand button */
    word-wrap: break-word;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.job-table .large-text.expanded {
    white-space: normal;
    overflow: visible;
    max-height: none;
}

.job-table .preview-text {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expand-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--accent-link);
    background-color: var(--bg-dark);
    padding: 2px 5px;
    border-radius: 3px;
}

.expand-btn:hover {
    text-decoration: underline;
    background-color: var(--accent-link);
}

.job-table .large-text.expanded .preview-text {
    white-space: normal;
    overflow: visible;
}

/* User creation fields */

#auth-form-fields {
    display: flex;
    flex-direction: column;
    max-width: 450px; /* Increased width for better input fields */
    margin-left: 20px;  /* Center the form on the page */
}

.form-group-register {
    display: flex;
    flex-direction: row; /* Row alignment for label and input */
    align-items: center;
    margin-bottom: 15px;
}

.form-group-register label {
    width: 150px; /* Fixed width for all labels */
    text-align: left;
    padding-right: 10px;
    font-size: 12px;
    color: var(--text-light); /* Match label color to theme */
}

.form-group-register input {
    flex-grow: 1; /* Let input fill the remaining space */
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
}

.form-group-register.button-group {
    justify-content: flex-end; /* Right-align the button */
}

#auth-form-fields button {
    background-color: var(--accent);
    color: var(--text-light);
    margin-top: 20px; /* Added some space above the button */
    padding: 10px;
    border: none;
    cursor: pointer;
    max-width: 200px;
    width: 100%; /* Button takes full form width */
}

#password-requirements {
    font-size: 0.9em;
    color: var(--text-light);
    text-align: left; /* Align text to the left for readability */
    margin-top: 10px;
    margin-left: 20px; /* Align with form */
}

/* Dashboard layout */

.dashboard-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    padding: 10px;
}

.dashboard-section {
    flex: 1;
    margin: 10px;
    min-width: 250px; /* Adjust as needed */
}

.token-info {
    display: flex;
    flex-direction: column;
}

.token-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th, .data-table td {
    border: 1px solid black;
    padding: 8px;
    text-align: left;
}

canvas {
    width: 100%;
    height: 300px; /* Adjust as needed */
}

/* Score tab */

#score-selectors-container {
    margin-top: 30px;
}

.score-container {
    margin-bottom: 90px;
}

.field-container {
    margin-top: 20px;
}

.field-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.field-label {
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
}

.field-value {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    min-height: 20px;
}

#job-info-content .field-value {
    padding: 20px;
}

/* Grid containers for compact fields */
/* Grid containers for all compact fields */
.compact-fields-grid,
.metrics-grid,
.technical-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

/* Style for all compact field rows */
.info-field,
.metric,
.tech-field {
    display: flex;
    align-items: center;
    background: var(--bg-dark);
    padding: 8px 12px;
    border-radius: 4px;
    min-height: 32px;
}

/* Unified label styling */
.info-label,
.metric-label,
.tech-label {
    color: var(--text-dim);
    flex: 0 0 auto;
    margin-right: 10px;
    min-width: 140px;
}

/* Unified value styling */
.info-value,
.metric-value,
.tech-value {
    color: var(--text-light);
}

/* Large text fields remain block-level */
.large-text-field {
    margin-bottom: 20px;
}

.large-text-field .field-label {
    color: var(--text-dim);
    margin-bottom: 8px;
}

.large-text-field .field-value {
    background: var(--bg-dark);
    padding: 15px;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compact-fields-grid,
    .metrics-grid,
    .technical-grid {
        grid-template-columns: 1fr;
    }
}

#scoring-container {
    margin: 0 auto;
}

.report-filter-component {
    width: auto!important;
    min-width: 0;
    max-width: none;
    white-space: nowrap;
    margin: 10px 4px;
}

/* Edit popup */

.edit-popup {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--bg-darker);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 350px;
}

.edit-popup textarea {
    width: calc(100% - 20px); /* Subtracting the right padding */
    height: 100px;
    margin-bottom: 10px;
    padding-right: 10px; /* Add right padding */
}

.edit-popup button {
    margin-right: 10px;
}

/* system info panel */

#system-info-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    padding: 5px 10px;
    font-size: 11px;
    z-index: 1000;
    width: auto;
    max-width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

#system-info-panel > div {
    margin-left: 15px;
    white-space: nowrap;
}

#system-info-panel .refresh-button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    margin-right: 15px;
}

#system-info-panel .refresh-button:hover {
    color: var(--text-light);
}

@media (max-width: 500px) {
    #system-info-panel {
        font-size: 10px;
        flex-direction: column;
        align-items: flex-start;
    }

    #system-info-panel > div {
        margin-left: 0;
        margin-top: 5px;
    }

    #system-info-panel .refresh-button {
        margin-right: 0;
        margin-bottom: 5px;
    }
}


/* Responsive styles for mobile devices */
@media screen and (max-width: 768px) {
    body {
        padding: 0;
    }

    .container, .sidebar, .container-tabbed-ui {
        width: 100%;
        margin: 0;
        padding: 10px;
        box-sizing: border-box;
    }

    .form-group {
        width: 100%;
    }

    textarea, input[type="text"], input[type="password"], select {
        width: 100%;
        box-sizing: border-box;
    }

    .btn {
        max-width: 200px;
        /* width: 100%; */
        margin-bottom: 10px;
    }

    .job-table {
        font-size: 14px;
    }

    .job-table th, .job-table td {
        padding: 8px;
    }

    .job-table .question, .job-table .answer, .filters {
        max-width: 200px;
    }

    .job-table .guidance, .job-table .extra-instruction {
        max-width: 150px;
    }

    #auth-form-fields {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
    }

    .form-group-register {
        flex-direction: column;
        align-items: flex-start;
    }

    .form-group-register label {
        width: 100%;
        margin-bottom: 5px;
    }

    .dashboard-row {
        flex-direction: column;
    }

    .dashboard-section {
        width: 100%;
        margin: 10px 0;
    }

    canvas {
        height: 200px;
    }

    .popup-message {
        width: 90%;
        max-width: none;
    }

    .edit-popup {
        width: 90%;
    }
}

/* Additional adjustments for very small screens */
@media screen and (max-width: 480px) {
    .tab-label {
        font-size: 10px;
    }

    .job-table {
        font-size: 12px;
    }

    .job-table th, .job-table td {
        padding: 6px;
    }

    .job-table .question, .job-table .answer, .filters {
        max-width: 150px;
    }

    .job-table .guidance, .job-table .extra-instruction {
        max-width: 100px;
    }
}

/* filter toggle */

.filter-header-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
}

.header-cell {
    flex: 0 0 auto;  /* Don't grow or shrink, size to content */
}

.header-cell-spacer {
    flex: 1;  /* Take up all available space between the cells */
}

.mini-header {
    margin: 0;
    padding: 0;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.model-toggle-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-label {
    color: #888;
    font-size: 14px;
}

.model-label.plus {
    color: #888;
}

/* The switch - the box around the slider */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.qa-sync-button {
    margin-left: 8px;
    cursor: pointer;
    color: var(--text-dim);
    border: none;
    background: none;
    padding: 0;
}

.qa-sync-button:hover {
    color: #333;
}

.qa-sync-button.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2c2c2c;
    transition: .4s;
    border: 1px solid #444;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 3px;
    background-color: #888;
    transition: .4s;
}

input:checked + .slider {
    background-color: #1a1a1a;
    border-color: var(--accent-link);
}

input:checked + .slider:before {
    background-color: var(--accent-link);
    transform: translateX(26px);
}

/* Rounded sliders */
.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* When toggle is checked, highlight the "Plus" text */
.switch input:checked ~ .model-label.plus {
    color: #2196F3;
}


/* tooltip CSS */

/* Tooltip styles (hover) */
.info-icon {
    cursor: pointer;
    position: relative;
    margin-left: 0px;
    font-size: 14px;
}

/* Modal styles (click) */
.tooltip-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 20px;
    text-align: center;
}

.tooltip-modal .close-tooltip {
    cursor: pointer;
    display: block;
    text-align: right;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.tooltip-modal-content {
    padding: 0px;
    color: var(--text-light);
}

/* Tooltip styles (hover) */
/* Tooltip styles (hover) */
.tooltip {
    position: absolute;
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px;
    z-index: 1000; /* Ensure it's above other elements */
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none; /* Allow mouse events to pass through */
    box-sizing: border-box; /* Ensure padding is included in width */
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%; /* Position arrow at the bottom of the tooltip */
    left: 50%; /* Center the arrow horizontally */
    transform: translateX(-50%); /* Adjust for arrow width */
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent; /* Arrow pointing down */
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .tooltip {
        max-width: 200px; /* Smaller tooltips on very small screens */
        font-size: 14px;
    }

    .tooltip::after {
        border-width: 4px;
    }
}

/* Modal backdrop to darken the rest of the page */
.modal-backdrop {
    position: fixed;
    z-index: 999; /* Below modal */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-backdrop.hidden {
    display: none;
    opacity: 0;
}



/* Add these to your existing styles.css */

.cqa-info-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px;
}

.info-section {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-lighter);
    border-radius: 8px;
}

.info-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-accent);
    font-size: 1.2em;
}

.info-section p {
    margin: 8px 0;
    line-height: 1.4;
}

.info-section strong {
    color: var(--text-emphasis);
}

#cqa-plus-info-section p{
    margin-bottom: 25px;
}

/* Make the popup wider for CQA Plus content */
#job-info-popup .popup-content {
    min-width: 80%;
    margin: 5% auto;
    max-height: 90vh;
    overflow-y: auto;
}

/* Style the close button */
#job-info-popup .close-popup {
    position: sticky;
    top: 0;
    background: var(--bg-darker);
    padding: 10px;
    text-align: right;
    z-index: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .info-section {
        padding: 10px;
    }
    
    #job-info-popup .popup-content {
        width: 95vw;
        margin: 10px;
    }
}

.answer-metadata {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
}

.answer-metadata p {
    margin: 5px 0;
    display: inline-block;
    margin-right: 15px;
}

.completeness {
    color: var(--text-accent);
}

.risk {
    padding: 2px 8px;
    border-radius: 4px;
}

.risk.high-risk {
    background-color: rgba(255, 0, 0, 0.1);
    color: #d32f2f;
}

.risk.low-risk {
    background-color: rgba(76, 175, 80, 0.1);
    color: #388e3c;
}

/* Headless UI menu */

.nav-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
    padding-right: 0px;
}

.menu-button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    text-decoration: none;
}

.menu-button:hover {
    color: var(--accent-link);
}

.menu-button i {
    transition: transform 0.2s ease;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    width: max-content;
    min-width: 120px;  /* Ensure it's not too narrow */
    max-width: 250px;  /* Prevent excessive width */
    z-index: 101;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--bg-dark);
    color: var(--accent-link);
}

.headlessui-menu {
    position: relative;
}

.profile-icon {
    display: none;
}

/* CSV Upload Area */

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    background-color: var(--bg-darker);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.upload-area:hover {
    border-color: var(--accent);
    background-color: var(--bg-dark);
}

.upload-area.drag-over {
    border-color: var(--accent);
    background-color: var(--bg-dark);
}

.upload-content {
    pointer-events: none;
}

.upload-icon {
    font-size: 24px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.upload-text {
    color: var(--text-dim);
    font-size: 14px;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Add to styles.css */

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.refresh-btn {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn:hover {
    background-color: #5a8fc7 !important;
}

.refresh-btn i {
    font-size: 0.9em;
}

.loading-row td {
    padding: 2rem !important;
    text-align: center;
}

.loading-row i {
    font-size: 1.5rem;
    color: var(--primary);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

/* Animation for refresh icon */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fa-spin {
    animation: spin 1s linear infinite;
}


/* Tab-specific layout classes */
.tab-page-wrapper {
    display: flex;
    flex-direction: column;
    height: auto;
    padding: 10px;
    overflow: visible;
}

.corpus-controls {
    margin-bottom: 20px;
}

.tab-results-section {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tab-table-wrapper {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    background-color: var(--bg-darker);
    overflow: auto;
}

.tab-table-content {
    width: 100%;
    overflow: auto;
}

/* Override any problematic inherited styles */
.tab-content-wrapper {
    position: static;
    height: auto;
    overflow: visible;
}

#corpus-wrapper {
    position: static;
    height: auto;
    overflow: visible;
}

/* Ensure the job table behaves within tabs */
.tab-table-wrapper .job-table {
    width: 100%;
    margin: 0;
}

.tab-table-wrapper .job-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bg-darker);
}

.corpus-links .action-link {
    display: inline-block;
    padding: 2px 4px;
    color: var(--accent-link);
    text-decoration: none;
}

.corpus-links .action-link:hover {
    color: var(--accent);
}

.corpus-links .fa-eye,
.corpus-links .fa-download {
    font-size: 14px;
}

.multiline {
    white-space: pre-wrap;
}

.corpus-doc-links {
    margin-left: 8px;
    white-space: nowrap;
}

.corpus-doc-links .action-link {
    display: inline-block;
    padding: 2px 4px;
    color: var(--accent-link);
}

.corpus-doc-links .action-link:hover {
    color: var(--accent);
}

.corpus-doc-links .fa-eye,
.corpus-doc-links .fa-download {
    font-size: 14px;
}

/* Remove any inherited margins/padding from link containers */
.job-info-value.multiline .corpus-doc-links a {
    margin: 0;
    padding: 0 4px;
}

#config-selector .btn {
    margin-top: 15px;
    flex-shrink: 0;
}

#docchain-form-container {
    width: 100%;
    box-sizing: border-box;
}

.docchain-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--bg-darker);
    width: 100%;
    box-sizing: border-box;
}

.docchain-form .form-group {
    display: flex;
    flex-direction: column;
}

/* Add these to your styles.css */
.docchain-form .form-group input[type="text"],
.docchain-form .form-group select {
  width: 200px; /* Fixed width for parameter inputs */
  max-width: 100%; /* Ensures responsiveness */
}

.docchain-form .form-group textarea {
  width: 100%; /* Full width for larger text inputs */
  min-height: 100px;
  resize: vertical;
}

/* Buttons */
.docchain-form .btn {
    padding: 12px 20px;
    background-color: var(--accent);
    color: var(--text-light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    align-self: flex-start; /* Align button to the start */
}

.docchain-form .btn:hover {
    background-color: darken(var(--accent), 10%);
}

.docchain-form .btn:disabled {
    background-color: var(--bg-darker);
    color: var(--text-dim);
    cursor: not-allowed;
    border: 1px solid var(--border-color);
}

/* Style for disabled state */
.docchain-form .form-group input:disabled,
.docchain-form .form-group select:disabled,
.docchain-form .form-group textarea:disabled {
    background-color: var(--bg-darker);  /* Using your existing background color */
    color: var(--text-dim);      /* Using your existing dimmed text color */
    cursor: not-allowed;
    border-color: var(--border-color);
    opacity: 0.9;                /* Slightly reduce opacity but keep text readable */
}

/* Add specific styles for file input disabled state */
.docchain-form .form-group input[type="file"]:disabled {
    background-color: var(--bg-darker);
    color: var(--text-dim);
}

/* Style for file list when disabled */
.docchain-form .form-group input[type="file"]:disabled + .file-list {
    opacity: 0.7;
}


.docchain-form .form-group label {
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-dim);
}

.docchain-form .form-group textarea,
.docchain-form .form-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    background-color: var(--input-bg);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    resize: vertical;
    box-sizing: border-box;
    font-size: 14px;
}


.docchain-form .form-group #file-list li {
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
}


.docchain-form #file-list {
    list-style-type: none;
    padding: 0
}



/* Evaluation Response Container */
.docchain-response-container {
    position: relative;
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    background-color: var(--bg-darker);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Response Icons */
.docchain-response-container .response-icons {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* Copy Icon */
.docchain-response-container .copy-icon {
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s ease;
}

.docchain-response-container .copy-icon:hover {
    color: var(--accent-link);
}

/* Response Output */
.docchain-response-output h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-light);
}

.docchain-response-output p {
    margin: 0;
    line-height: 1.5;
    color: var(--text-light);
}

/* Evaluation Results Styles */
.results-header {
    margin: 30px 0 20px;
    padding: 0 20px;
}

.docchain-section {
    margin-bottom: 30px;
    padding: 0 20px;
}

.external-parameters-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.parameter-input {
    margin-bottom: 0.5rem;
}

.parameter-input label {
    display: block;
    margin-bottom: 0.25rem;
}

.section-header {
    margin-bottom: 20px;
}

/* Generated Documents Styles */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.document-container {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.document-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.document-links {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

/* Other Results Styles */
.other-results-container .docchain-response-container {
    margin-bottom: 20px;
}

.other-results-container .docchain-response-container:last-child {
    margin-bottom: 0;
}

/* Process def graph editor and visualisation */

.step-details-form .form-group input, .step-details-form .form-group select, .step-details-form .form-group textarea {
    width: 100%;
    box-sizing: border-box;
    background-color: var(--input-bg);
}

#visualization-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#visualization-content-OLD {
    display: flex;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    margin-top: 20px;
    height: 500px;
}

#visualization-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}


#process-def-graph-OLD {
    flex: 1;
    background-color: var(--bg-dark);
    min-height: 500px;
}

#process-def-graph {
    position: relative;
    flex: 1;
    min-width: 0;
}

.add-step-button {
    position: absolute;
    z-index: 1000;
    /* Add any additional button styling here */
}

#step-details {
    flex: 1;
    padding: 20px;
    background-color: var(--bg-darker);
    color: var(--text-light);
    overflow-y: auto;
    height: auto !important;
}

#step-details h3 {
    width: 100%;
    color: var(--accent);
    margin-top: 0;
}

#step-details p {
    margin-bottom: 10px;
}

#step-details strong {
    color: var(--text-dim);
}

#step-details .llm-config {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zoom-controls button {
    background-color: var(--accent);
    color: var(--text-light);
    border: none;
    padding: 5px 10px;
    margin-right: 5px;
    cursor: pointer;
    font-size: 16px;
}

.zoom-controls button:hover {
    background-color: var(--accent-link);
}

.config-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.config-row .btn {
    margin-top: auto; /* This will push the button to the bottom of its container */
    height: 38px; /* Adjust this value to match the height of your dropdown */
}

#process-subheader {
    margin-top: 10px;
    margin-bottom: 0; 
    flex-basis: 100%; /* Ensure it takes up full width */
    color: var(--text-light);
}

.config-row .form-group {
    flex: 1;
    margin-right: 10px;
}

.config-row .form-group:last-child {
    margin-right: 0;
}

#output-documents, #document-sections {
    flex: 1;
    margin-right: 10px;
}

#document-sections {
    margin-right: 0;
}

.list-table {
    min-height: 100px;
    border: 1px solid var(--border-color);
    padding: 10px;
    margin-bottom: 10px;
}

.list-table:empty::after {
    content: "No items";
    display: flex;
    justify-content: center;
    align-items: center;
    height: 50px;
    color: var(--text-dim);
}

.process-status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.status-icon {
    margin-right: 5px;
}

.status-done {
    color: var(--app-green);
}

.status-not-done {
    color: var(--app-red);
}

.status-na {
    color: var(--text-dim);
}

/* tooltip CSS */

/* Tooltip styles (hover) */
.info-icon {
    cursor: pointer;
    position: relative;
    margin-left: 5px;
}

/* Modal styles (click) */
.tooltip-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 20px;
    text-align: center;
}

.tooltip-modal .close-tooltip {
    cursor: pointer;
    display: block;
    text-align: right;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.tooltip-modal-content {
    padding: 20px;
    color: var(--text-light);
}

/* Tooltip styles (hover) */
/* Tooltip styles (hover) */
.tooltip {
    position: absolute;
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px;
    z-index: 1000; /* Ensure it's above other elements */
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none; /* Allow mouse events to pass through */
    box-sizing: border-box; /* Ensure padding is included in width */
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%; /* Position arrow at the bottom of the tooltip */
    left: 50%; /* Center the arrow horizontally */
    transform: translateX(-50%); /* Adjust for arrow width */
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent; /* Arrow pointing down */
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .tooltip {
        max-width: 200px; /* Smaller tooltips on very small screens */
        font-size: 14px;
    }

    .tooltip::after {
        border-width: 4px;
    }
}

/* Modal backdrop to darken the rest of the page */
.modal-backdrop {
    position: fixed;
    z-index: 999; /* Below modal */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-backdrop.hidden {
    display: none;
    opacity: 0;
}
/* Filter modal specific styles */
#corpus-filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content-filter {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent double scrollbars */
}

.modal-content-filter .modal-header {
    padding: 1.5rem;
    margin: 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content-filter .modal-header h3 {
    margin: 0;
    flex: 1;
}

.modal-content-filter .modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-content-filter .modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

#corpus-filter-container {
    padding: 0;
}

.question-request-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.question-request-section h4 {
    margin: 0;
}

.question-request-text {
    color: var(--text-light);
    white-space: pre-wrap;
    margin: 0;
    line-height: 1.5;
}

.filter-trigger {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--accent);
    font-size: 0.9em;
    font-weight: normal;
    transition: background-color 0.2s;
}

.filter-trigger:hover {
    background-color: var(--bg-darkest);
}

/* Hide Other Settings */
.modal-content-filter .additional-options {
    display: none;
}

/* Improved scrollbar styling */
.modal-content-filter .modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-content-filter .modal-body::-webkit-scrollbar-track {
    background: var(--bg-darkest);
}

.modal-content-filter .modal-body::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.modal-content-filter .modal-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-content-filter .modal-footer-content .btn {
    min-width: 100px;
}

.modal-content-filter .modal-footer-content .btn.primary {
    background-color: var(--accent);
}

.modal-content-filter .modal-footer-content .btn.secondary {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
}

.modal-content-filter .modal-footer-content .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-content-filter .button-group {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-content-filter .status-wrapper {
    color: var(--text-dim);
    flex: 1;
}

.status-and-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.modal-content-filter .status-indicator {
    background-color: var(--bg-darker);
    color: var(--text-dim);
    border: 1px solid var(--border-color);
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
}