/*****************************
    CUSTOM RULES OVERWRITE BASE
******************************/

@font-face {
    font-family: Acumin;
    font-weight: bold;
    src: url("Acumin-BdPro.otf") format("opentype");
}

:root {
    --app-primary-text-color: #2c3e50;
    --app-link-color: #067ea4;
    --app-link-hover-color: #0fa0ce;
    --app-border-muted: #d6d6d6;
}

html {
    font-size: 16px;
}

.custom-container-xxxl {
    max-width: 3000px;
}

hr {
    margin: 0.3rem 0;
}

.banner {
    height: 5.5rem;
    padding: 0 2rem 0;
    background-color: white;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.banner Img {
    position: relative;
    height: 3rem;
    width: auto;
    margin-left: 2%;
}

.flex-container {
    display: flex;
}

.flex-grow {
    flex-grow: 1;
}

.gap-1em {
    gap: 1em;
}

.row-gap-1em {
    row-gap: 1em;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--app-primary-text-color);
}

.tooltip-inner {
    color: #fff;
    background-color: var(--app-primary-text-color);
}

#page-header {
    background-color: #369;
    color: white;
}

#page-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#page-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/*****************************
    LEFT COLUMN
******************************/
#left-column {
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 5.5rem);
    background-color: #f3f3f3;
    padding-bottom: 0.7rem;
    color: var(--app-primary-text-color);
    gap: 1.5rem;
}

/***************************** Redirect section *****************************/
#sidebar-handle-wrapper {
    display: flex;
    background-color: #d5d8dcc4;
    padding: 0.25rem 0.1rem;
    align-items: center;

}

#redirect-project-selection {
  padding: 0rem 0.75rem;
}

#redirect-project-selection .back-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--app-link-color);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  transition: background-color 0.15s ease, transform 0.05s ease;
}

#redirect-project-selection .back-link:hover {
    color: var(--app-link-hover-color);

}

#redirect-project-selection .back-link:active {
    transform: translateY(1px);
}

#redirect-project-selection .back-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.25);
}

/* Icon as a small, high-contrast pill */
#redirect-project-selection .back-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 9999px;
    align-items: center;
    justify-content: center;
    background-color: var(--app-primary-text-color);
    color: #fff;
    font-size: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

/* Ensure link inherits our color and sizing */
#redirect-project-selection a {
    color: inherit;
    font-size: 100%;
}

/* Hide the bar when the sidebar is collapsed (keeps the clean gutter look) */
#left-column.sidebar-col.collapsed #redirect-project-selection {
    display: none !important;
}

/***************************** Project title section *****************************/
.accordion-button:focus {
    box-shadow: none;
}

#project-table-title {
    padding: 0.5rem;
}

#card-container {
    padding: 2rem 0rem 0rem;
    display: flex;
    gap: 1rem;
    flex-direction: column;
}

#project-card {
    font-family: "Helvetica Neue", sans-serif;
    padding: 0rem 0rem 1rem;
    display: flex;
    flex-direction: column;
}

#project-title {
    font-size: 130%;
    font-weight: bold;
    line-height: 1.3;
    margin: 0 1rem;
}

#accordion-left-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#project-details {
    /* opacity: 0.8; */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-details-stats {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.5rem;
    align-items: baseline;
}

/***************************** Accordions *****************************/
.accordion-item {
    display: flex;
    flex-direction: column;
    font-size: 100%;
    border: none;
}

.accordion-button {
    padding: 0.5rem 1rem;
    background-color: #d5d8dcc4;
    color: var(--app-primary-text-color) !important;
    font-weight: bold;
}

.accordion-button:hover {
    background-color: #d5d8dcc4;
}

.accordion-item {
    padding: 0rem;
    background-color: transparent;
}

.accordion-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--app-primary-text-color);
}

.accordion .collapse,
.accordion .collapsing {
    transition: height 20ms ease;
    /* faster transition */
}


/***************************** Plot control accordion *****************************/
#control-card div.slider {
    margin-bottom: 0.8rem;
    margin-top: 0.8rem;
}

.control-card-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

#calibration-options label:has(input[disabled=""]) {
    opacity: 0.5;
}

#gaussian-filter-slider {
    padding: 0px 10px 20px !important;
}

.rc-slider-handle {
    border: solid 2px var(--app-primary-text-color);
    background-color: var(--app-primary-text-color);
}

.rc-slider-handle:hover {
    border-color: #ecf0f1;
}

.rc-slider-handle:active {
    border-color: #ecf0f1;
    box-shadow: 0 0 5px #95a5a6;
}

.rc-slider-track {
    background-color: #95a5a6;
}

.rc-slider-dot-active {
    border-color: #ced4da;
}

.rc-slider-handle-click-focused:focus {
    border-color: #95a5a6;
}


/***************************** Selection accordion *****************************/
#selection-card {
    border: none;
}

#selection-tools {
    gap: 0.2rem;
    display: flex;
    flex-direction: column;
}

#selection-import-tools {
    display: flex;
    flex-direction: row;
    gap: 0rem 0.5rem;
}

#selection-card-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem 0rem;
}

#selection-list-container {
    background-color: white;
}

.protein-list {
    display: flex;
    flex-direction: column;
    border-radius: 0;
    gap: 0rem 0rem;
}

.list-group-item {
    border: none;
}

.list-group-item+.list-group-item {
    border: none;
    border-top: 1px solid var(--bs-accordion-border-color);
}

.protein-item {
    display: flex;
    align-items: center;
    padding: 0px;
    cursor: default;
    /* item container itself is not clickable */
    background-color: transparent;
    margin: 0 !important;

}

.protein-item.active {
    background-color: rgba(54, 255, 67, 0.2);
}

.protein-actions {
    display: flex;
    gap: 0rem 0.1rem;
    margin: 0rem 0.1rem;
    border: none;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.protein-actions button {
    border: none;
}

.protein-actions .selectable-btn {
    font-size: 0.9rem;
    flex: 1;
    text-align: left;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-picker-close-btn-wrapper {
    display: flex;
    align-items: center;
}

.protein-actions .icon-btn{
    padding: 0rem 0.5rem;
    font-weight: 700;
}

.protein-actions .color-picker {
    padding: 0rem;
    width: 16px;
    height: 16px;
    background-color: transparent;
    border: none;
    border-radius: 1px;

}

/* Bubble up hovering effects when internal buttons or inputs are hovered */
.protein-item:has(.protein-actions button:hover),
.protein-item:has(.protein-actions .color-picker:hover) {
    color: var(--bs-btn-color);
    background-color: #f3f3f3;
}

.protein-item.active:has(.protein-actions button:hover),
.protein-item.active:has(.protein-actions .color-picker:hover) {
    background-color: rgba(54, 255, 67, 0.25);
}
/*****************************
    RIGHT COLUMN
******************************/
#right-column {
    background-color: white;
    padding: 0.1rem 1rem 0.1rem;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.4rem;
    min-height: 0;
}

.table-row {
    height: 63px;
    vertical-align: middle;
    font-size: 12pt;
}

.draglayer {
    cursor: pointer !important;
}

.hidden {
    display: none;
}


/*****************************
    TABS
******************************/
.custom-tabs-container {
    width: 100%;
}

.custom-tabs-content {
    background-color: white;
}

.custom-tab {
    color: white !important;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    border-top: 1px solid lightgrey !important;
    background-color: #7b8a8b !important;
    padding: 0.6rem !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.custom-tab:hover {
    background-color: inherit;
}

.custom-tab-selected {
    color: black !important;
    background-color: #f8f9fa !important;
    border-top: 3px solid #e36209 !important;
}

#ridge-tabs {
    margin-top: 2em;
}

/*****************************
    TAB HEADERS
******************************/
.tab-content .header {
    border-left: 1px solid var(--app-border-muted);
    border-right: 1px solid var(--app-border-muted);
}

.tab-content .header h3 {
    font-size: 120%;
    margin: 0;
    letter-spacing: 0;
}

/*****************************
    TAB CONTENTS
******************************/
#peptide-plot-wrapper {
    border-bottom: 1px solid #999;
    border-left: 1px solid var(--app-border-muted);
    border-right: 1px solid var(--app-border-muted);
}

.tab-content .header h3 {
    font-size: 120%;
    margin: 0;
    letter-spacing: 0;
}

/*****************************
    DATA TABLES
******************************/
table th.dash-filter input:not([type="radio"]):not([type="checkbox"]) {
    /* This should depend on the actual column
       alignment, but doesn't */
    text-align: left !important;
    padding-left: 0.7em !important;
}

.dash-spreadsheet a {
    text-decoration: none;
}

.dash-spreadsheet-container {
    overflow-y: hidden !important;
}

/* prevents tiny scroll bars in markdown cells  */
.dash-cell-value.cell-markdown p:last-child {
    margin-bottom: 0;
}

#protein-table,
#correlation-table,
#ppi-table,
#peaks-table {
    border: none;
    height: 100% !important;
    width: 100%;
}

#project-table {
    border: none;
    height: auto !important;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

#page-content>div {
    flex-grow: 1;
}

/* Styling of the background text when no strip (empty
 plot: */
text.annotation-text {
    font-size: 1.8rem !important;
}

/* Styling of the background text when no active protein (ag grid): */
.ag-react-container {
    font-size: 1.8rem;
}

/* dcc.Loading component with transparent background */
.loader-wrapper>div {
    visibility: visible !important;
}

#correlation-table-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #95a5a6;
}

#project-table-tools {
    padding: 0.7em 0;
}

#project-table-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

#project-table-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 792px;
}

#protein-table-wrapper,
#correlation-table-wrapper,
#ppi-table-wrapper,
#peaks-table-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
}

#protein-table-event-listener {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

#protein-table-wrapper > :not(#protein-table-tools),
#correlation-table-wrapper > *,
#ppi-table-wrapper > *,
#peaks-table-wrapper > * {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

/* Compactness of the AG-Grid */
.ag-theme-alpine.compact {
    --ag-grid-size: 5px;
    --ag-row-height: 25px;
    border: 0px;
}

.ag-theme-alpine.big {
    --ag-row-height: 40px;
    --ag-font-size: 1rem;
    border: none !important;
}

.ag-theme-alpine .ag-cell:focus,
.ag-theme-alpine .ag-cell:focus-within {
    outline: none !important;
    border: 1px solid transparent !important;
}

.ag-theme-alpine .active-row {
    background-color: rgba(54, 255, 67, 0.2);
}

/*****************************
    RIDGE SHIFT DETAILS TAB
******************************/
.btn-xs,
.btn-primary,
.ag-standard-button {
    font-weight: bold;
}

.btn-group-sm>.btn-xs {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
}

.notification {
    background-color: lightyellow;
    border: 1px solid orange;
    border-radius: 7px;
    padding: 0.8em 1em;
    margin-top: 10px;
}

/*****************************
    TAB TOOLBAR
******************************/
.tab-toolbar {
    border-left: 1px solid var(--app-border-muted);
    border-right: 1px solid var(--app-border-muted);
    padding: 0.5rem 0.7em 0.5em;
    display: flex;
    flex-direction: row;
    gap: 0.5em;
    align-items: center;
    flex-wrap: wrap;
}

.tab-toolbar-title {
    color: var(--app-primary-text-color);
}

#current-strip {
    font-weight: bold;
}

.tab-toolbar-divider {
    margin: 0 0.5em;
    background-color: #dde2eb;
    width: 2px;
    height: 1.5em;
}

.tab-toolbar-filter {
    width: auto;
}

.justify-end {
    justify-content: flex-end;
}

.tab-toolbar-buttongroup-wrapper {
    flex: 1;
    display: flex;
}

.export-btn-wrapper {
    flex-grow: 1;
    display: flex;
    justify-content: end;
}

#selection-only-toggle {
    font-size: 0.875rem;
}

#selection-only-toggle .form-check {
    min-height: 0;
}

#selection-only-toggle .form-check-label {
    color: var(--app-primary-text-color);
}

#tabset-tools-container {
    flex-direction: column;
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
}

.modal-title {
    color: var(--app-primary-text-color);
}

.modal-body {
    color: var(--app-primary-text-color);
    display: flex;
    flex-direction: row;
}

.modal-filename {
    flex: 3;
}

.modal-format {
    flex: 1;
}

.modal-footer {
    display: flex;
    flex-direction: row;
}

#tabset-tools-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100% !important;
    min-height: 0;
}

#tabset-tools-content > div:not([hidden]) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#tab-protein-list-content,
#tabset-tools-content .tab-content,
#correlation-table-loader-wrapper,
#ppi-table-loader-wrapper {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#clipboard-import-data {
    height: 150px;
    font-size: 1rem;
    padding-right: 2.5rem;

}

#clear-clipboard-textarea {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    z-index: 2;
}

/******************************
    LINKS
******************************/
a {
    color: var(--app-link-color);
    text-decoration: underline;
    cursor: pointer;
}

a:hover {
    color: var(--app-link-hover-color);
}

/******************************
    ALERTS
******************************/
.alert-info {
    color: var(--bs-info-text-emphasis);
    background-color: var(--bs-info-bg-subtle);
}

.alert-warning {
    color: var(--bs-warning-text-emphasis);
    background-color: var(--bs-warning-bg-subtle);
}

.alert-danger {
    color: var(--bs-danger-text-emphasis);
    background-color: var(--bs-danger-bg-subtle);
}

.alert .alert-link {
    color: var(--bs-alert-link-color);
}

.alert .btn-close {
    filter: invert(1);
}

#import-error-alert {
    display: flex;
    flex-direction: column;
}

/******************************
    HEADER
******************************/
#app-navbar {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
}

#app-navbar-title {
    display: flex;
    flex-direction: row;
    font-weight: bold;
}

/******************************
    FOOTER
******************************/
#app-footer {
    display: flex;
    flex-direction: row;
    gap: 0.3rem 1rem;
    flex-wrap: nowrap;
    font-size: 95%;
    font-weight: bold;
    color: var(--app-primary-text-color);
    padding: 0.3em 1em 0.3em;
    overflow-x: auto;
}

#app-footer a {
    text-decoration: none;
}

#app-footer-institute {
    flex: 0 0 auto;
    white-space: nowrap;
}

#app-footer-middle-section {
    flex: 1;
}

#app-footer-right-section {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.3rem 1rem;
}

/******************************
    PROFILE PLOT
******************************/
/* To have readable legends in dark mode*/
g.infolayer>g.legend>rect.bg {
    fill-opacity: 0.1 !important;
    fill: #929292 !important;
}

/* Remove default hyperlink color to btn */
#btn-download-csv>svg{
    color: #ada69c;
}

#btn-download-csv:hover>svg {
    color: var(--app-primary-text-color);
}

/* Default: hide modebar + disable interaction until JS enables it */
#protein-profile-plot .modebar,
#protein-profile-plot .modebar-container { display: none; }

#protein-profile-plot .plotly { pointer-events: none; }

/******************************
    MEDIA QUERIES
******************************/

@media (min-width: 1201px) {
  #protein-table-wrapper,
  #correlation-table-wrapper,
  #ppi-table-wrapper,
  #peaks-table-wrapper {
    height: auto !important;
    width: 100%;
  }
}

@media (max-width: 1200px) {
    #selection-card .accordion-body {
        padding: 0.5rem 0.2rem;
    }
}

@media (max-width: 768px) {
    #sidebar-handle-bar {
        position: static;
        top: auto;
        justify-content: flex-start;
        /* small padding so the button isn't flush to the edge */
        padding: 6px 8px; 
    }

    #selection-card .accordion-body {
        padding: var(--bs-accordion-body-padding-y) var(--bs-accordion-body-padding-x);
    }
    /* Ensure left column doesn’t reserve unwanted height in collapsed state */
    #left-column, #right-column {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    #right-column,
    #tabset-tools-container,
    #tabset-tools-content,
    #tabset-tools-content > div:not([hidden]),
    #tab-protein-list-content,
    #tabset-tools-content .tab-content,
    #correlation-table-loader-wrapper,
    #ppi-table-loader-wrapper {
        flex: 0 0 auto !important;
        min-height: auto !important;
        height: auto !important;
    }

    #protein-table-wrapper,
    #correlation-table-wrapper,
    #ppi-table-wrapper,
    #peaks-table-wrapper,
    #protein-table-event-listener {
        flex: 0 0 auto !important;
        min-height: clamp(320px, 50vh, 640px) !important;
        height: clamp(320px, 50vh, 640px) !important;
    }

    /* Remove side padding on the left column for a cleaner look */
    #left-column {
        padding-left: 0 !important;
        padding-right: 0 !important;
        min-height: 0; /* you already set this — keep it */
        box-sizing: border-box;
    }
    .accordion-body {
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0 0.3rem;
    }

    .export-btn-wrapper {
        display: flex;
        justify-content: end;
    }

    .protein-list {
        flex-direction: row;
        flex-wrap: wrap;
        /* allow wrapping to multiple lines if needed */
        gap: 0.2rem 0.5rem;
    }

    .protein-actions .selectable-btn {
        width: 140px
    }

    #selection-card-options {
        width: 100%;
    }

    .protein-list .list-group-item {
        margin: 2px; /* small gap between items */
    }
    g.infolayer>g.annotation>g.annotation-text-g>g.cursor-pointer>text.annotation-text {
        font-size: 1rem !important;

    }
    #redirect-project-selection { padding: 0.4rem 0.6rem; }
    #redirect-project-selection .back-link { padding: 0.3rem 0.4rem; }
    #app-footer {
        font-size: 80%;
    }
}

/******************************
    SIDE BAR TOGGLE
******************************/

/* Make the sidebar handle bigger and more visible */
#sidebar-handle-bar {
    flex: 1;
}

#sidebar-handle {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 1rem;                 /* chevrons scale with button */
    background-color: #7b8a8b !important; /* dark */
    color: #ffffff !important;            /* white icon */
    border: none !important;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    /* box-shadow: 0 2px 6px rgba(0,0,0,0.25); */
    cursor: pointer;
    transition: background-color .2s ease, transform .1s ease;
}

#sidebar-handle:hover {
    background-color: #495057 !important;
    transform: scale(1.05);
}

/* Sticky handle positioning as before */
:root { --navbar-height: 56px; }
#sidebar-handle-bar {
    /* position: sticky; */
    top: calc(var(--navbar-height) + 8px);
    z-index: 1040;
    display: flex;
    justify-content: flex-end;
}
