/* dashboard viewer */

@font-face {
    font-family: Dosis;
    src: url('Dosis-SemiBold.ttf');
}

@font-face {
    font-family: Titillium Web;
    src: url('TitilliumWeb-SemiBold.ttf');
}

:root {
    --head-color: #6a696b;
    --head-bg-color: #F1F1F2;
    --section-color: #f2f3f3;
    --section-bg-color: #1995AD;
    --menu-color: #9ca3b0;
    --menu-bg-color: #111828;
    --menu-color-clickable: #5ab5c3;
    --menu-bg-color-active: #384357;
    --tree-color: #9ca3b0;
}

body {
    margin: 0;
    font-family: 'Dosis', sans-serif;
    font-size: 14px;
    background: white;
}

/* header */

.dashboard-header {
    height: 40px;
    background: var(--head-bg-color);
    color: var(--head-color);
    padding: 0 1em;
    display: flex;
    align-items: center;
}

.dashboard-header h1 {
    margin: 0;
    font-family: 'Titillium Web', sans-serif;
    font-size: 22px;
}

/* body layout */

.dashboard-body {
    display: flex;
    min-height: calc(100vh - 40px);
}

/* tree navigation */

.dashboard-tree {
    background: var(--menu-bg-color);
    color: var(--menu-color);
    padding: 10px;
    padding-top: 15px;
    overflow-y: auto;
    white-space: nowrap;
}

/* toggle to hide/show the navigation menu, sits in the header bar */
.menu-toggle {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.3em;
    line-height: 1;
    padding: 2px 8px;
    margin-right: 0.5em;
    border-radius: 4px;
    opacity: 0.7;
}

.menu-toggle:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

.dashboard-tree ul {
    list-style: none;
    margin: 0;
    padding: 0.25em 0 0.25em 1em;
}

.dashboard-tree > ul {
    padding-left: 0;
}

.dashboard-tree li {
    position: relative;
    padding: 0.25em 1em 0.25em 0;
}

.dashboard-tree li::before {
    content: "";
    position: absolute;
    width: 1px;
    background: var(--tree-color);
    top: 0;
    bottom: 0;
    left: -10px;
}

.dashboard-tree li:last-child::before {
    height: 15px;
}

.dashboard-tree li::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 1px;
    background: var(--tree-color);
    top: 14px;
    left: -10px;
}

.dashboard-tree > ul > li::before,
.dashboard-tree > ul > li::after {
    display: none;
}

.tree-group {
    margin: 0;
    padding: 0;
}

.tree-link {
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: var(--menu-color-clickable);
    padding: 2px 5px;
}

.tree-link:hover {
    color: white;
    background: var(--menu-bg-color-active);
}

li.clickable.active .tree-link {
    color: white;
    background: var(--menu-bg-color-active);
}

/* content area */

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 40px);
}

/* section header */

.section-header {
    position: sticky;
    top: 0;
    z-index: 10;
    height: 40px;
    background: var(--section-bg-color);
    color: var(--section-color);
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 0 1em;
    gap: 1em;
}

.section-name {
    margin: 0;
    font-size: 20px;
}

/* form */

.section-form {
    display: flex;
    align-items: center;
    gap: 0.5em;
    justify-content: flex-end;
}

.form-field {
    display: flex;
    align-items: center;
    gap: 0.25em;
}

.form-field span {
    white-space: nowrap;
}

.form-field input,
.form-field select {
    color: dimgrey;
}

.form-submit {
    cursor: pointer;
}

/* figures */

.section-figures {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 13px;
}

.graph-and-links {
    position: relative;
    margin: 14px;
    box-shadow: rgba(0, 0, 0, 0.35) 2px 3px 6px;
    overflow-x: auto;
}

/* html figures (tables, model statistics) flow text into the bottom-left
   corner where the info button floats; reserve room so they don't overlap */
.graph-and-links .html-figure {
    padding-bottom: 2.4em;
}

.info-button {
    position: absolute;
    bottom: 0.5em;
    left: 0.5em;
    z-index: 10;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0.15em 0.4em;
}

.info-button:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.2em;
}

.graph-and-links .seriesinfo {
    position: absolute;
    bottom: 3em;
    left: 0.5em;
    z-index: 9;
    background: white;
    box-shadow: rgba(0, 0, 0, 0.2) 0 0.1em 0.5em;
    padding: 0.6em 1em;
    max-width: 45em;
    max-height: 30em;
    overflow-y: auto;
    overflow-x: hidden;
    text-align: left;
    word-break: break-all;
}

dash-plot {
    display: block;
}
