/* Add your styling here */
:root {
    --brand-color: #62C1BF;
}
body {
    font-family: 'Poppins', Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background-color: #F4F6F8;
}

h1, h2 {
    text-align: center;
}

td, tr {
    text-align: center;
}

/* Change active link background and text color */
.nav-link.active {
    background-color: var(--brand-color) !important;  /* Teal background */
    color: white !important;               /* White text */
}

/* Sidebar section heading */
.nav-heading {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* Display for current project name in sidebar */
.sidebar-current-project {
    color: var(--brand-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Prevent sidebar links from wrapping */
.nav-link.text-nowrap {
    white-space: nowrap;
}

/* Custom color for btn-secondary buttons */
.btn-secondary {
    background-color: var(--brand-color) !important;
    border-color: var(--brand-color) !important;
}



.main-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.side-container {
    flex: 0 0 220px; /* Fixed width for the sidebar */
}

.card-container {
    display: flex;
    flex-direction: column;
    width: 80%;
    gap: 2rem;
    padding: 20px;
    max-height: 85vh;
    overflow-y: auto;
}

.form-container {
    display: grid;
    width: 100%;
    min-width: 800px;
    justify-content: center;
}

.add-project-container {
    min-width: 0;
    overflow-x: hidden;
}

.container-wrapper {
    flex:1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: hidden;
}

.analysis-container, .report-container, .overview-container, .card-container {
    padding: 20px;
    width: 90%;
    min-width: 920px;
}

.overview-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.tab-content-custom {
    max-height: calc(75vh - 170px); /* Adjust 120px based on your header, footer, and any padding */
    min-height: 220px;
    overflow-y: auto;
}

.multi-upload-container {
    flex-grow: 1; 
    display: flex; 
    justify-content: center; 
    min-width: 920px;
    margin-left: 20px;
    margin-right: 20px;
}

.add-project-btn {
    position: fixed;
    bottom: 5%;
    justify-content: center;
    margin-left: 25px;
}

.test-ec2 {
    position: fixed;
    bottom: 5%;
    justify-content: center;
    margin-left: 300px;
    width: 200px;
    height: 40px;
}

/* Analysis table container height and scroll */
.analysis-table-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding-bottom: 2rem;
    max-height: calc(100vh - 200px);
}

.analysis-table-container .table-responsive {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Subjects table container height and scroll */
.subjects-table-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    padding-bottom: 2rem;
}

.subjects-table-container .table-responsive {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#subjects-container .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#subjects-container .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.batch-controls {
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.batch-controls .batch-actions button {
    min-width: 150px;
}

.subject-select-cell,
.checkbox-column {
    width: 60px;
}

.subject-selected {
    background-color: rgba(98, 193, 191, 0.15);
}

.analysis-selected {
    background-color: rgba(98, 193, 191, 0.15);
}

.subject-select-checkbox {
    cursor: pointer;
}

.analysis-select-checkbox {
    cursor: pointer;
}

.rerun-modality-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.rerun-modality-status {
    display: inline-flex;
    align-items: center;
    min-width: 20px;
    justify-content: center;
}

.rerun-status-icon {
    font-size: 1rem;
}

.logs-dropdown .logs-dropdown-btn {
    border-color: #212529;
    color: #212529;
    background-color: #ffffff;
}

.logs-dropdown .logs-dropdown-btn:hover,
.logs-dropdown .logs-dropdown-btn:focus,
.logs-dropdown .logs-dropdown-btn:active,
.logs-dropdown.show .logs-dropdown-btn,
.logs-dropdown .logs-dropdown-btn.show {
    border-color: #212529;
    color: #ffffff;
    background-color: #212529;
}

.logs-dropdown .dropdown-menu .dropdown-item {
    color: #212529;
}

.logs-dropdown .dropdown-menu .dropdown-item:hover,
.logs-dropdown .dropdown-menu .dropdown-item:focus,
.logs-dropdown .dropdown-menu .dropdown-item:active {
    color: #ffffff;
    background-color: #212529;
}

/* Keep Add Stats button visible */
.add-stats-btn {
    position: fixed;
    bottom: 20px;
    left: 250px;
}

/* Wider stats modal */
#statsModal .modal-dialog {
    max-width: 1300px;
}
#statsModal .modal-content {
    padding: 20px;
}

/* Wider heatmap modal */
#heatmapModal .modal-dialog {
    max-width: 1200px;
}

/* Prevent overflowing lists in the stats modal */
#statsModal .list-group {
    max-height: calc(75vh - 220px);
    overflow-y: auto;
}

.data-overview-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    padding: 20px;
    overflow-y: auto;
}

.data-overview-nav-container {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    align-items: center;
    margin-bottom: 20px;
    max-width: 1200px;
}

.qa-container {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    /* max-height: 50vh; */
}

.obs-container {
    display: flex;
    justify-content: space-between;
    gap: 1em;
}

.half-card {
    min-width: 400px; 
    max-width: 600px; 
    width: 50%;
}

.nav-card {
    /* width: 100%; */
    display: flex;
    gap: 1em;
    align-items: center;
}

/* Style for the subject dropdown to limit visible items and enable scrolling */
.subject-dropdown .dropdown-menu {
    max-height: 400px; /* Adjust this value as needed */
    overflow-y: auto; /* Enables vertical scrolling */
    overflow-x: hidden; /* Hides horizontal scrollbar */
}

/* Similar style for project dropdowns */
.project-dropdown .dropdown-menu,
.group-dropdown .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.stats-dropdown .dropdown-menu {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.first-column {
    text-align: left;
}

.table-responsive {
    max-height: 50%;
    overflow-x: auto;
}

.table-responsive tbody tr:first-child {
    margin-top: 20px; /* Adjust this value based on the height of your table's header */
}

/* Card style tables */
.card .table-responsive {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}
.card .table {
    margin-bottom: 0;
}

#seed-table-container .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#seed-table-container .card-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#seed-table-container .table-responsive {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

#seed-results {
    flex: 1;
    min-height: 0;
}

.vertical-text-ccw {
    max-width: 2rem;
    transform: rotate(-90deg);
    transform-origin: center; /* Adjusts the rotation point */
    white-space: nowrap; /* Keeps the text on a single line */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.graph-img-container {
    height: 100%; 
    box-sizing: border-box;
}

.graph-metric-container {
    display: flex; 
    justify-content: flex-start;
    align-items: center; 
    height: 300px; 
}

/* Modal styling */
.modal-dialog-centered {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loader styling */

.loader {
    margin: 0 auto 20px; /* Add bottom margin to space out from paragraph */
    width: 60px;
    height: 50px;
    display: flex;              /* Keep bars on a single line */
    justify-content: center;
    gap: 2px;
    font-size: 0;               /* Remove whitespace between inline elements */
}

.loader > div {
    height: 100%;
    width: 8px;
    display: inline-block;
    -webkit-animation: delay 0.8s infinite ease-in-out;
    animation: delay 0.8s infinite ease-in-out;
}

.loader .bar1 { background-color: #754fa0; }
.loader .bar2 {
    background-color: #09b7bf;
    -webkit-animation-delay: -0.7s;
    animation-delay: -0.7s;
}
.loader .bar3 {
    background-color: #90d36b;
    -webkit-animation-delay: -0.6s;
    animation-delay: -0.6s;
}
.loader .bar4 {
    background-color: #f2d40d;
    -webkit-animation-delay: -0.5s;
    animation-delay: -0.5s;
}
.loader .bar5 {
    background-color: #fcb12b;
    -webkit-animation-delay: -0.4s;
    animation-delay: -0.4s;
}
.loader .bar6 {
    background-color: #ed1b72;
    -webkit-animation-delay: -0.3s;
    animation-delay: -0.3s;
}

@-webkit-keyframes delay {
    0%, 40%, 100% { -webkit-transform: scaleY(0.05) }  
    20% { -webkit-transform: scaleY(1.0) }
}

@keyframes delay {
    0%, 40%, 100% {
        transform: scaleY(0.05);
        -webkit-transform: scaleY(0.05);
    }
    20% {
        transform: scaleY(1.0);
        -webkit-transform: scaleY(1.0);
    }
}

/* Ensure modal-body is a flex column for proper alignment */
.modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
/* Keep ellipsis width constant */
#dots {
    display: inline-block;
    width: 1.5em;
    text-align: left;
}
/* End modifications */

#seed-tab-pane:focus {
    outline: none;
}

#seedTable .selected-row {
    background-color: #0c94ee;
}

.table thead th {
    position: sticky;
    top: 0;
    background-color: #212529; /* Match your table's background color */
    z-index: 1; /* Ensure the header is above other content */
}

.rounded-table thead th:first-child {
    border-top-left-radius: 0.5rem;
}

.rounded-table thead th:last-child {
    border-top-right-radius: 0.5rem;
}

#seedTable td, #seedTable th {
    white-space: nowrap; /* Or 'normal' if you want the content to wrap */
    overflow: hidden;
    text-overflow: ellipsis;
}

#upload-container {
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    height: 100vh;
    min-width: 600px;
}

#qa-metrics-flex {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

#img-metrics-flex {
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    height: 85%;
}

#project-description, #edit-project-description {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    box-sizing: border-box;
}

#upload-data {
    margin-top: 50px;
}

#upload-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1em;
}

#pdescription {
    height: 120px;
    min-width: 22.4rem;
    font-size: 9.6pt;
    text-align: top;
    resize: none;
}

#details-container {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    padding-bottom: 20px;
    width: 100%;
}

#groups {
    height: 15vh;
    width: 350px;
    font-size: 12pt;
    text-align: top;
    resize: none;
}

#groups-container {
    display: flex;
    align-items: stretch;
    gap: 20px;
    overflow-x: auto;
    width: 100%;
    height: 30vh;
    min-height: 280px;
}

.group-col {
    flex: 1;
    min-width: 250px;
}

#subjects-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 0;
}

#drop-area {
    display: flex;
    flex-direction: column;
    height: 20vh;
    min-height: 200px;
    margin: 1em;
    justify-content: center;
    align-items: center;
    border: 2px dashed #ccc;
    padding: 20px;
    transition: border 0.3s ease-in-out;
}

#drop-area.dragged-over {
    border: 2px dashed #68B;
}

#progressBarContainer {
    width: 100%;
    height: 20px;
    background-color: #f1f1f1;
    border-radius: 5px;
    margin-top: 10px;
    overflow: hidden;
}

#progressBar {
    height: 100%;
    width: 0;
    background-color: #4caf50;
    border-radius: 5px;
    text-align: center;
    line-height: 20px;
    color: white;
}

#uploadStatusTable {
    width: 100%;
    border-collapse: collapse;
}

#uploadStatusTable, #uploadStatusTable th, #uploadStatusTable td {
    border: 1px solid black;
    text-align: left;
    padding: 5px;
    width: fit-content;
}

#uploadStatusTable tr:nth-child(even) {
    background-color: #f2f2f2;
}

#uploadStatusTable tr:first-child td {
    font-weight: bold;
}

#uploadStatusTable td:last-child {
    text-align: center;
    color: green;
    width: min-content;
}

/* Adjust the width of the first two columns (Subject ID and Group) */
#uploadStatusTable td:nth-child(1), #uploadStatusTable th:nth-child(1),
#uploadStatusTable td:nth-child(2), #uploadStatusTable th:nth-child(2) {
    width: 18%; /* Adjust the width as needed to double the current width */
}

#uploadStatusTable td:nth-child(3), #uploadStatusTable th:nth-child(3) {
    width: 10%;
}

/* Ensure the progress bar cell occupies the remaining space */
#uploadStatusTable td:nth-child(4) {
    width: auto; /* Allows this cell to grow and fill the available space */
}

/* Custom font size for the table */
#statsTable {
    font-size: 0.8rem;  /* Reduced font size */
    width: 100%;
}

/* Custom background color for the table header */
#statsTable thead th {
    background-color: #1e3b84;  /* Dark background */
    color: white;  /* White text */
}

/* Custom font size for the table */
#summaryTable {
    font-size: 0.8rem;  /* Reduced font size */
    width: 100%;
}

/* Custom background color for the table header */
#summaryTable thead th {
    background-color: #1e3b84;  /* Dark background */
    color: white;  /* White text */
}

/* Scrollable volumes stats table */
.volume-stats-table-container {
    max-height: 100%;  /* Set a fixed height for the table's body */
    overflow-y: auto;   /* Allow vertical scrolling for the table */
}

#designMatrixModal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensure it sits on top of other content */
}

#designMatrixModal > div {
    background: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    width: 30%; /* Set the width of the modal */
}

#heatmap {
    width: 100%; /* Make heatmap take full width of its parent */
    height: auto; /* Adjust height as necessary */
}

/* Add responsive styling */
@media (max-width: 1100px) {
    .card-container {
        grid-template-columns: repeat(auto-fill, minmax(80%, 100%));
    }
}

.list-item{cursor:pointer;padding:2px;border-bottom:1px solid #ddd;}
.perm-row{margin-bottom:4px;}
.perm-row > div{display:flex;align-items:center;}

/* Add Project modal sizing */
#addProjectModal .modal-dialog {
    max-width: 736px;
}
#addProjectModal .modal-content {
    padding: 20px;
}
#addProjectModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}
#addProjectModal .container-fluid {
    width: 704px;
    max-width: 100%;
    margin: 0 auto;
}

#project-description {
    font-size: 0.8rem;
}

#project-description .form-control,
#project-description .form-select,
#project-description .btn,
#project-description .form-label,
#project-description .accordion-button {
    font-size: 0.8rem;
}

#flashSearchModal .flash-modal-dialog {
    max-width: 375px;
}

#flashSearchModal .flash-modal-content {
    background-color: #f2f2f2;
}

#revisionReasonModal .flash-modal-dialog {
    max-width: 375px;
}

#revisionReasonModal .flash-modal-content {
    background-color: #f2f2f2;
}

/* Ensure toast backgrounds are fully opaque */
.toast {
    --bs-toast-bg: rgba(var(--bs-warning-rgb), 1);
    --bs-toast-header-bg: rgba(var(--bs-body-bg-rgb), 1);
}

/* Tables within cards with rounded corners */
.rounded-table .table {
    border-radius: 0.5rem;
    overflow: hidden;
}

/* Match table padding with search bar spacing */
.rounded-table .card-body {
    padding: 1rem;
    position: relative;
}

.excel-download {
    cursor: pointer;
    font-size: 1.2rem;
}

.excel-download::before {
  vertical-align: text-top !important;
}

.excel-download-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.5rem;
}

/* Container for DataTables search bar */
.search-container {
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.search-container .dataTables_filter {
    margin: 0;
}
.search-container input[type="search"] {
    margin-left: 0.5rem;
}
.search-container select {
    max-width: 180px;
}
.search-container select:not(:first-child) {
    margin-left: 0.5rem;
}

/* Fallback avatar when no image is present */
.avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #6c757d;
    color: #fff;
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
    border-radius: 50%;
    text-transform: uppercase;
}

/* Project cards redesign */
.projects-page .species-section {
    margin-bottom: 2rem;
}

.projects-page .species-header {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.projects-page .species-header::before {
    content: "";
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    background-repeat: no-repeat;
    background-size: contain;
}
.projects-page .species-header[data-spec="rats"]::before {
    background-image: url(/mouse_3120791.png);
}

.projects-page .species-header[data-spec="mice"]::before {
    background-image: url(/mouse_2729591.png);
}

.projects-page .species-header[data-spec="humans"]::before {
    background-image: url(/user_659958.png);
}

.projects-page .species-header[data-spec="ex-vivo"]::before {
    background-image: url(/test-tube_163145.png);
}

.projects-page .species-header[data-spec="ex-vivo-gd"]::before {
    background-image: url(/test-tube_163145.png);
}

.projects-page .species-header[data-spec="ex-vivo-rat"]::before {
    background-image: url(/test-tube_163145.png);
}

.projects-page .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    justify-items: center;
}

.projects-page .card:not(.vcpu-card) {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 280px;
    height: 200px;
}

.projects-page .card-header {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    height: 60px;
}

.projects-page .card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    flex: 1;
}

.projects-page .badge {
    padding: 0.25em 0.75em;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.projects-page .badge-new { background: #e3f2fd; color: #0d47a1; }
.projects-page .badge-pre { background: #fff3e0; color: #e65100; }
.projects-page .badge-analysis { background: #f3e5f5; color: #4a148c; }
.projects-page .badge-results { background: #e8f5e9; color: #1b5e20; }

/* Status badge used in group overview run button */
.run-status-badge {
    padding: 0.25em 0.75em;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    vertical-align: middle;
}
.run-status-badge.run-start { background: #fff3e0; color: #e65100; }
.run-status-badge.run-active { background: #f3e5f5; color: #4a148c; }
.run-status-badge.run-done { background: #e8f5e9; color: #1b5e20; }
.run-status-badge.run-error { background: #f8d7da; color: #721c24; }
.run-status-badge.run-starting { background: #fff3e0; color: #e65100; }
.run-status-badge.run-running { background: #f3e5f5; color: #4a148c; }
.run-status-badge.run-terminating { background: #fff8e1; color: #ff6f00; }
.run-status-badge.run-finished { background: #e8f5e9; color: #1b5e20; }

.projects-page .card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* gap: 0.5rem; */
}

.projects-page .card-body .keywords {
    white-space: nowrap;
    overflow-x: auto;
    margin: 0;
}

.projects-page .avatars {
    display: flex;
    margin-bottom: 0.5rem;
}

.projects-page .date-created {
    font-size: 0.85rem;
    color: #666;
}

.projects-page .date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.projects-page .modality-avatars {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.projects-page .modality-avatars .modality-avatar {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    margin-left: -12px;
    border: 2px solid #fff;
}

.projects-page .modality-avatars .modality-avatar:first-child {
    margin-left: 0;
}

.projects-page .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    border: 2px solid #fff;
    margin-left: -8px;
}
.projects-page .admin-ring {
    box-shadow: 0 0 0 2px var(--bs-primary);
}
.projects-page .avatar:first-child { margin-left: 0; }

.projects-page .card-footer {
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #eee;
    height: 40px;
}

.projects-page .btn-outline {
    padding: 0.5rem 1rem;
    border: 1px solid #007bff;
    color: #007bff;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.projects-page .btn-outline:hover {
    background: #e7f1ff;
}

/* Metric cards (e.g. vCPU usage) */
.metric-card {
    background-color: #212529;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    width: 120px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* vCPU gauge card in sidebar */
.vcpu-card {
    box-shadow: none;
    height: auto;
}
.vcpu-card .card-body {
    position: relative;
    padding: 0.5rem;
}
.vcpu-card canvas {
    display: block;
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}
.vcpu-card .vcpu-card-footer {
    background: transparent;
    border-top: none;
    padding: 0.25rem 0;
    margin-top: auto;
    /* width: 100%; */
    text-align: center;
}
#vcpuTitle {
    color: #fff;
    font-size: 0.75rem;
}
#vcpuLabel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    width: 100%;
}
#vcpuLabel .vcpu-used {
    font-size: 1rem;
    font-weight: 600;
}
#vcpuLabel .vcpu-total {
    font-size: 0.6rem;
    opacity: 0.8;
}

/* --- NBS figures layout --- */
.nbs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.nbs-figure {
    position: relative;
    overflow: hidden;
}

.nbs-figure img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    display: block;
}

.nbs-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    pointer-events: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    z-index: 1;
}

.diff-wrapper {
    position: relative;
}

.cluster-summary-icon {
    position: absolute;
    top: 3px;
    left: 10px;
    color: white;
    cursor: pointer;
    z-index: 1;
}

.connectogram-icon {
    position: absolute;
    top: 30px;
    left: 10px;
    color: gray;
    cursor: pointer;
    z-index: 1;
    font-size: 1.5em;
}

#resetBtn {
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

#saveBtn {
    margin-top: 6px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

#chart { width: 900px; height: 900px; margin: 0 auto; }
/* svg { width: 100%; height: 100%; } */
.arc { cursor: pointer; stroke: #fff; stroke-width: 1px; }
.label { font-size: 10px; text-anchor: middle; pointer-events: none; fill: #000; }
.link { fill: none; stroke-opacity: 0.7; stroke-width: 1.5px; cursor: pointer; }
path.tring { stroke: #fff; stroke-width: 0.5px; }
#connectogram-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 160px;
    z-index: 10;
}
#connectogram-legend {
    background: rgba(255,255,255,0.9);
    border: 1px solid #888;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
}
.legend-colorbar {
    width: 100%;
    height: 10px;
    display: block;
    margin: 2px 0;
}
.legend-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
}
#tooltip {
    position: absolute;
    padding: 6px 10px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #888;
    border-radius: 4px;
    pointer-events: none;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}

/* Rounded corners for result images */
#group1-img-container img,
#group2-img-container img,
#stats-img-container img,
#group1-falff-container img,
#group2-falff-container img,
#stats-falff-container img,
#group1-cbf-container img,
#group2-cbf-container img,
#stats-cbf-container img,
#group1-morph-container img,
#group2-morph-container img,
#stats-morph-container img,
#group1-fa-container img,
#group2-fa-container img,
#stats-fa-container img,
#group1-md-container img,
#group2-md-container img,
#stats-md-container img,
#group1-t1-container img,
#group2-t1-container img,
#stats-t1-container img {
    border-radius: 10px;
}

/* Bar chart containers */
.bar-chart-wrapper {
    position: relative;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-y: auto;
    min-height: 300px;
    flex: 1;
    padding: 10px;
    box-sizing: border-box;
    /* Grow to fill remaining tab height without overflowing */
    height: auto;
}

.bar-chart-wrapper .tableIcon {
    position: absolute;
    top: 15px;
    left: 10px;
    color: var(--brand-color);
    cursor: pointer;
    z-index: 1;
}

/* Result images containers */
[id$="-images-container"] {
    display: flex;
    align-items: flex-start;
    min-height: 250px;
    overflow-y: auto;
}

/* Tab panes that hold plots and figures */
.result-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
}

/* Classification view */
.class-content-inner {
    display: flex;
    gap: 40px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    width: 1000px;
    max-width: 100%;
    margin: 0 auto;
}
.classification-title {
    margin: 0 0 10px;
    font-size: 22px;
    color: #222;
}
.class-content-inner svg {
    width: 600px;
    height: 600px;
    flex-shrink: 0;
}
.center-label-line1 {
    font-size: 44px;
    font-weight: bold;
    fill: #666;
    text-anchor: middle;
    pointer-events: none;
}
.center-label-line2 {
    font-size: 36px;
    fill: #222;
    text-anchor: middle;
    pointer-events: none;
}
.description {
    font-size: 14px;
    margin-bottom: 10px;
    color: #444;
    text-align: center;
}
.class-content-inner table {
    border-collapse: collapse;
    width: 260px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    font-size: 14px;
    flex-shrink: 0;
}
.class-content-inner th,
.class-content-inner td {
    padding: 8px 12px;
    text-align: left;
}
.class-content-inner th {
    background-color: #4a5568;
    color: #fff;
}
.class-content-inner tr:nth-child(even) {
    background-color: #f7fafc;
}
.class-content-inner tr:hover {
    background-color: #e2e8f0;
    cursor: pointer;
}
.classification-disclaimer {
    margin-top: auto;
    max-width: 800px;
    font-size: 13px;
    color: #666;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
#classificationSection {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    overflow: hidden;
}
.pagination#class-pagination .page-link {
    color: #000;
}
.pagination#class-pagination .page-item.active .page-link {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
}
.color-box {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: middle;
    opacity: 0.75;
}

.fmri-nifti-modal {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    width: clamp(360px, 45vw, 640px);
    max-height: min(640px, 80vh);
    display: none;
    z-index: 1100;
}

.fmri-nifti-modal.is-visible {
    display: flex;
}

.fmri-nifti-modal__dialog {
    width: 100%;
    height: 100%;
    background: #050b18;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 18px 48px rgba(8, 15, 40, 0.55);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.fmri-nifti-modal__toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
    width: 100%;
}

.fmri-nifti-modal__toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.fmri-nifti-modal__drag-handle {
    flex: 1;
    min-width: 120px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    cursor: grab;
    transition: background 0.2s ease;
}

.fmri-nifti-modal__drag-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 -6px 0 rgba(255, 255, 255, 0.2), 0 6px 0 rgba(255, 255, 255, 0.2);
}

.fmri-nifti-modal__drag-handle:active {
    cursor: grabbing;
    background: rgba(255, 255, 255, 0.2);
}

.fmri-nifti-modal__canvas {
    flex: 1;
    background: #000;
    border-radius: 0.85rem;
    overflow: hidden;
    min-height: 320px;
    aspect-ratio: 1 / 1;
}

#fmri-nifti-viewer {
    width: 100%;
    height: 100%;
    display: block;
}

.fmri-nifti-modal__close {
    align-self: flex-end;
    filter: invert(1);
}

.fmri-nifti-modal__toggle {
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.3rem 0.95rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: background 0.2s ease, color 0.2s ease;
}

.fmri-nifti-modal__toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.fmri-nifti-modal__toggle[aria-pressed="true"] {
    background: #fff;
    color: #050b18;
}

@media (max-width: 768px) {
    .fmri-nifti-modal {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        width: auto;
        max-width: unset;
    }

    .fmri-nifti-modal__drag-handle {
        min-width: 80px;
    }
}

.modal-content.bg-white {
    background: #ffffff;
}

#subjectLogsModal .modal-body {
    background: #f8f9fa;
}

.mono {
    font-family: ui-monospace, Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 12px;
}


/* Animación suave para el colapso */
#projectMenuCollapse {
    transition: all 0.3s ease;
}

#sidebar-project-name {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    /* Creamos la flecha con el pseudo-elemento */
    #sidebar-project-name::after {
        content: "";
        width: 0; 
        height: 0; 
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid var(--brand-color); /* Color de la flecha */
        transition: transform 0.3s ease;
        margin-left: 10px;
        display: none;
    }

    /* Cuando el menú está abierto, rotamos el after */
    #sidebar-project-name.menu-open::after {
        transform: rotate(180deg);
    }

    /* Eliminamos tu antigua regla que causaba el conflicto */
    @media (max-height: 770px) {
        #sidebar-project-name::after {
            display: inline-block; /* Aseguramos que se vea siempre */
        }
        #projectMenuCollapse.collapse:not(.show) {
            /* Eliminamos el display:none !important para que Bootstrap funcione */
        }
    }

    @media (min-height: 771px) {
        #sidebar-project-name::after {
            display: none; 
        }
        #projectMenuCollapse.collapse {
            display: block !important; 
        }
    }
.rotate-180 {
    transform: rotate(180deg);
}

#manageUsers-container{
    width: 90% ;
}
