/* Styles of the rba2html pages (tables: see also rba2html postprocess.py) */

/* -- headings -- */

h2 {
    font-size: 25px;
}

/* -- page contents (not the banner and the menus): text a bit smaller than in the page template (16px) -- */

main {
    font-size: 14.5px;
}

main h4 {
    font-size: 17px;
}

/* -- links in the page contents (not in the banner and menus): dark purple -- */

main a, main a:visited, main a:hover, main a:focus {
    color: rgb(95, 0, 150);
}

/* -- model name in the banner -- */

#nav .main-nav h3.white-text {
    color: #f7bbff;
}

/* -- table pages: button "?" that shows the description of the table; unit of the table -- */

.rba-description-toggle {
    display: inline-block;
    width: 22px;
    height: 22px;
    margin-left: 6px;
    padding: 0;
    border: 1px solid #aaa;
    border-radius: 50%;
    background: #f4f4f4;
    color: #555;
    font-size: 14px;
    font-weight: bold;
    line-height: 20px;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

.rba-description-toggle:hover, .rba-description-toggle[aria-expanded="true"] {
    background: #e4d4ec;
    border-color: rgb(95, 0, 150);
    color: rgb(95, 0, 150);
}

.rba-table-description p {
    max-width: 1200px;
}

.rba-table-unit {
    color: #555;
}

/* -- "Model overview" page: organism picture and model description; below, model information (left) and
   clickable model scheme (right; side by side on wide screens, one below the other on narrow screens) -- */

.rba-overview {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 40px;
    font-size: 14.5px;
}

.rba-overview-intro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
    margin-bottom: 12px;
}

.rba-overview-organism {
    width: 120px;
    height: 120px;
    flex: none;
}

.rba-model-description {
    flex: 1 1 400px;
    max-width: 1000px;
    text-align: left;
}

.rba-overview-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 48px;
}

.rba-overview-info {
    flex: 1 1 420px;
    max-width: 680px;
}

.rba-overview-scheme {
    flex: 1 1 400px;
    max-width: 500px;
}



.rba-overview h4 {
    margin-top: 14px;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.rba-scheme-hint {
    color: #777;
    margin-bottom: 4px;
}

.rba-scheme-panel {
    margin: 0 0 6px 0;
}

.rba-scheme-panel figcaption {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
}

.rba-scheme {
    display: block;
    width: 100%;
    height: auto;
}

/* parts of the scheme that link to tables: underlined labels and thicker outlines when the mouse pointer rests on them */
.rba-scheme-link {
    cursor: pointer;
}

.rba-scheme-link:hover text,
.rba-scheme-link:focus text {
    text-decoration: underline;
}

.rba-scheme-link:hover .rba-shape,
.rba-scheme-link:hover rect,
.rba-scheme-link:hover circle,
.rba-scheme-link:hover ellipse,
.rba-scheme-link:hover path {
    stroke-width: 3;
}

/* -- table pages: search field, then buttons (in one line, on the left) -- */

.rba-table-tools .dataTables_filter {
    float: left;
    text-align: left;
    margin: 0 16px 8px 0;
}

.rba-table-tools .dataTables_filter input {
    margin-left: 6px;
}

.rba-table-tools .dt-buttons {
    float: left;
    margin-bottom: 8px;
}

/* -- compact tables -- */

#example {
    font-size: 12px;
    width: auto;
}

#example > thead > tr > th,
#example > tbody > tr > td {
    padding: 3px 5px;
    max-width: 22em;
    overflow-wrap: anywhere;
}

/* column names: line breaks only between words ('Is<wbr>Cell<wbr>Target') */
#example > thead > tr > th {
    overflow-wrap: normal;
}

/* sort arrows of the column headers: less space */
#example > thead > tr > th.sorting,
#example > thead > tr > th.sorting_asc,
#example > thead > tr > th.sorting_desc {
    padding-right: 18px;
}

/* -- collapsed long lists and texts (<details class="rba-collapsed">) -- */

.rba-collapsed > summary {
    display: block;
    cursor: pointer;
    list-style: none;
}

.rba-collapsed > summary::-webkit-details-marker {
    display: none;
}

.rba-toggle {
    color: #c84fd0;
    white-space: nowrap;
    font-size: 90%;
}

.rba-collapsed > summary:hover .rba-toggle,
.rba-collapsed > summary:focus .rba-toggle {
    text-decoration: underline;
}

.rba-collapsed .rba-less,
.rba-collapsed[open] .rba-more,
.rba-collapsed[open] .rba-preview {
    display: none;
}

.rba-collapsed[open] .rba-less {
    display: inline;
}

.rba-collapsed[open] > summary {
    margin-bottom: 2px;
}

/* -- menu bar: always on top of the page -- */

header#comp {
    position: sticky;
    top: 0;
    z-index: 999;
}

/* the menu bar keeps its place and height when the page is scrolled (main.js adds the class fixed-nav);
   otherwise, the page becomes shorter while scrolling, which makes pages that are slightly higher than
   the browser window flicker */
#nav.fixed-nav {
    position: relative;
    padding: 10px 0px;
}

/* menu entries stay white on the coloured menu bar when the page is scrolled */
@media only screen and (min-width: 768px) {
    #nav.fixed-nav .main-nav>li>a {
        color: #fff;
    }
}

/* -- "Quick guide" page -- */

.rba-howto {
    max-width: 860px;
    margin: 0 auto;
    padding: 30px 16px 40px;
    font-size: 14.5px;
}

.rba-howto h2 {
    margin-bottom: 12px;
}

.rba-howto h4 {
    margin-top: 32px;
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ddd;
}

.rba-howto ul {
    padding-left: 20px;
    list-style: disc;
}

.rba-howto li {
    margin-bottom: 6px;
}

.rba-howto-table {
    width: 100%;
    border-collapse: collapse;
}

.rba-howto-table th,
.rba-howto-table td {
    padding: 8px 10px;
    border-top: 1px solid #eee;
    vertical-align: top;
}

.rba-howto-table th {
    width: 190px;
    font-weight: bold;
    white-space: nowrap;
}

.rba-howto-table .btn {
    cursor: default;
}

.rba-howto-figure {
    display: block;
    max-width: 100%;
    width: 720px;
    margin: 16px auto;
}

.rba-howto-logos img {
    margin-right: 30px;
}

/* menu entries: less space between them, so that all menus fit in one line on typical screens */
@media only screen and (min-width: 768px) {
    #nav .main-nav > li {
        padding: 0px 9px;
    }
}

/* model information on the "Model overview" page (font size as before); long values (e.g. web addresses) wrap on
   narrow screens */
.rba-overview-info table {
    font-size: 13.5px !important;
}

.rba-overview-info table td {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
}

.rba-overview-info td {
    overflow-wrap: anywhere;
}

/* -- menus with model parameters and simulation results: light tan (different from the white menus) -- */

.rba-extra-menu {
    color: #f3dfbd;
}

/* -- narrow screens (e.g. phones): the banner shows logos, title and menus (the page template would move title and
   menus into a side panel, which needs a menu button); menus open on click (js/main.js) -- */

@media only screen and (max-width: 767px) {
    #nav .navbar-header table,
    #nav .navbar-header tbody,
    #nav .navbar-header tr,
    #nav .navbar-header td {
        display: block;
    }
    #nav .main-nav {
        position: static;
        -webkit-transform: none;
        -ms-transform: none;
        transform: none;
        width: auto;
        max-width: none;
        height: auto;
        margin: 0 0 6px 0;
        overflow: visible;
        background: transparent;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    #nav .main-nav h3 {
        font-size: 18px;
        margin: 4px 0 4px 0 !important;
    }
    #nav .main-nav > li {
        display: inline-block;
        float: none;
        position: relative;
        border-top: none;
        padding: 0 10px 0 0;
    }
    #nav .main-nav > li > a {
        display: inline-block;
        padding: 3px 0;
        font-size: 14px;
        color: #fff;
        background: transparent;
    }
    #nav .main-nav .has-dropdown > a:after {
        display: none;
    }
    #nav .main-nav > .has-dropdown > .dropdown {
        position: absolute;
        left: 0;
        top: 100%;
        z-index: 1000;
        min-width: 220px;
        padding: 4px 0;
        background: #1C1D21;
    }
    #nav .main-nav .dropdown li {
        display: block;
        border-top: none;
    }
    #nav .main-nav .dropdown li a {
        display: block;
        padding: 6px 12px;
        font-size: 14px;
    }
}

.rba-model-description p:last-child {
    margin-bottom: 0;
}

/* -- page buttons below long tables ("Previous 1 2 3 ... Next"): pink (like the "show all" texts) -- */

.pagination > li > a, .pagination > li > span,
.pagination > li > a:hover, .pagination > li > a:focus {
    color: #c84fd0;
}

.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus,
.pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
    background-color: #f1d3f3;
    border-color: #ddb0e0;
    color: #8f2f96;
}

.pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus {
    color: #bbb;
}

/* -- menus: an open drop-down menu lies above all other menu points (also when the menu points of the banner
   fill two lines, e.g. on phones held horizontally) -- */

#nav .main-nav > li.has-dropdown:hover,
#nav .main-nav > li.has-dropdown.open-drop {
    z-index: 1001;
}

#nav .main-nav .dropdown {
    z-index: 1000;
}

/* menu points of the banner in two lines (medium-wide screens, e.g. phones held horizontally): less space between
   the lines */
@media only screen and (min-width: 768px) and (max-width: 1199px) {
    #nav .main-nav > li > a {
        padding-top: 9px;
        padding-bottom: 9px;
    }
}

/* -- narrow screens (e.g. phones held vertically): larger fonts; on the "Model overview" page, the model scheme
   lies below the model information (full width) -- */

@media only screen and (max-width: 767px) {
    main,
    .rba-overview,
    .rba-howto {
        font-size: 17px;
    }
    main h4 {
        font-size: 19px;
    }
    h2 {
        font-size: 26px;
    }
    #example {
        font-size: 15px;
    }
    /* table columns not narrower than about 8 characters; wide tables scroll sideways */
    .dataTables_wrapper {
        overflow-x: auto;
    }
    #example > thead > tr > th,
    #example > tbody > tr > td {
        min-width: 8em;
    }
    .rba-overview-info table {
        font-size: 16px !important;
    }
    .rba-scheme-panel figcaption {
        font-size: 16px;
    }
    .rba-overview-info,
    .rba-overview-scheme {
        flex: 1 1 100%;
        max-width: none;
    }
    .rba-overview-organism {
        width: 96px;
        height: 96px;
    }
    #nav .main-nav h3 {
        font-size: 21px;
    }
    #nav .main-nav > li > a,
    #nav .main-nav .dropdown li a {
        font-size: 16px;
    }
    .rba-description-toggle {
        width: 26px;
        height: 26px;
        line-height: 24px;
        font-size: 16px;
    }
}

/* -- proteomap page -- */

.rba-proteomap-controls { margin: 6px 0 4px 0; }
.rba-proteomap-run {
    margin: 2px 4px 2px 0;
    padding: 2px 10px;
    border: 1px solid #ddb0e0;
    border-radius: 4px;
    background: #fff;
    color: #c84fd0;
}
.rba-proteomap-run:hover { background: #faf0fb; }
.rba-proteomap-run.rba-proteomap-current { background: #f1d3f3; color: #8f2f96; }
#rba-proteomap-label-box { margin-left: 20px; font-weight: normal; }
.rba-proteomap-info { color: #666; }
.rba-proteomap-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.rba-proteomap-map { flex: 1 1 600px; max-width: 1000px; }
.rba-proteomap-map svg, .rba-proteomap-map img { width: 100%; height: auto; }
.rba-proteomap-legend { flex: 0 1 340px; font-size: 13px; }
.rba-proteomap-legend-item { margin: 2px 0; }
.rba-proteomap-swatch {
    display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: middle;
    border: 1px solid #fff; outline: 1px solid #ccc;
}
.rba-proteomap-tooltip {
    display: none; position: absolute; z-index: 2000; max-width: 380px; padding: 6px 8px;
    background: rgba(255, 255, 255, 0.96); border: 1px solid #bbb; border-radius: 4px;
    font-size: 13px; pointer-events: none; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* -- flux map page (Escher) -- */

.rba-fluxmap-map { position: relative; width: 100%; height: 75vh; min-height: 420px; border: 1px solid #ddd; }
.rba-fluxmap-option { margin-left: 20px; font-weight: normal; }
.rba-fluxmap-table { width: auto; max-width: 1400px; font-size: 13px; }
.rba-fluxmap h3 { margin-top: 24px; font-size: 18px; }
