:root {
    --top-navbar-navbar-height: 50px;
    --changed-value-background-color: hsla(230, 80%, 80%, 0.5);
}

body {
    font-family: "Roboto", serif !important;
}

#top-navbar {
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;

    height: var(--top-navbar-navbar-height);
}

#top-navbar .navbar-nav {
    flex-direction: row;
}

.navbar {
    margin-bottom: 0px;
}

.marcade-navbar-links {
    display: flex;
    flex-grow: 1;
    justify-content: center;
}

#sidebar-toggle {
    background-color: var(--btn-primary-background-color);
}

#sidebar {
    overflow: auto !important;
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    flex-wrap: nowrap !important;
    padding: 0px;
    position: static;
    top: auto;
    left: auto;
    height: auto;
    width: 250px;
    background: var(--sidebar-background-color);
    color: var(--sidebar-color);
    transition: all 1s ease-in-out;
    overflow-x: hidden;
}

/* Without this here, the d-flex above takes precedence due 
 to specificity
*/
#sidebar.d-none {
    display: none !important;
}

#sidebar nav>a {
    margin-left: 1rem;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

#sidebar nav a.active {
    background-color: var(--sidebar-a-background) !important;
}

#sidebar a {
    font-family: "Roboto", serif;
    color: var(--sidebar-color);
}

#sidebar .sidebar-header {
    margin-top: 0;
    padding: 20px;
    padding-top: 20px;
    background: var(--sidebar-header-background);
}

#sidebar .sidebar-header a:hover {
    color: #fff;
}

#sidebar a[aria-expanded="true"] {
    color: #fff;
    background: var(--sidebar-a-background);
}

#sidebar ul p {
    color: #fff;
    padding: 10px;
}

#sidebar ul li a {
    padding: 10px;
    font-size: 1.1em;
    display: block;
    border-radius: 0px !important;
}

#sidebar ul li a :hover {
    color: var(--sidebar-a-hover-color);
    background: #fff;
}

#sidebar ul li.active>a {
    color: #fff;
    background-color: var(--sidebar-a-background) !important;
}

.marcade-main-body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.marcade-table-model-select {
    th {
        background-color: var(--app-simulation-title-color);
    }
}

.marcade-centered-content {
    display: flex;
    flex-direction: column;
    padding: 20vw;
    margin-left: 10vw;
    margin-right: 10vw;
    flex-grow: 1;
    flex-shrink: 0;
    overflow-y: auto;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    border-radius: 0.5rem;
}

.infoRemainingBudget {
    transition: background-color 0.3s;
    border-radius: 0.2rem;
    padding: 0.2rem;
    padding-left: 0.4rem;
}

.infoRemainingBudget:has(> span.changed),
.infoRemainingDuration:has(> span.changed) {
    background-color: var(--changed-value-background-color) !important;
}

[x-cloak] {
    display: none !important;
}

.infoSpendingToggle {
    text-align: left;
}

/* Sits to the left of .infoBox, centred on the same line. The right offset is
   .infoBox's own offset plus its width at each breakpoint
   (base_authenticated_user.css; Bootstrap's border-box sizing puts the padding
   and border inside that width). */
.infoSpending {
    position: fixed;
    top: 50%;
    right: calc(1% + 10em + 0.5rem);
    transform: translateY(-50%);
    z-index: 1000;
    max-width: min(28rem, 70vw);
    max-height: 90vh;
    overflow: auto;
    padding: 1em;
    border: 1px solid lightgray;
    border-radius: 2px;
    background: #f8f9fa;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 1440px) {
    .infoSpending {
        right: calc(1% + 11vw + 0.5rem);
    }
}

.infoSpendingGrid {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 1.5em;
    row-gap: 0.3em;
}

.infoSpendingGrid.withTime {
    grid-template-columns: auto auto auto;
}

.infoSpendingGrid > .currency,
.infoSpendingGrid > .duration,
.infoSpendingRow > .currency,
.infoSpendingRow > .duration {
    text-align: right;
    white-space: nowrap;
}

.infoSpendingRow {
    display: contents;
}

.infoSpendingPage > * {
    font-style: italic;
}

.infoSpendingTotal {
    border-top: 1px solid #e7e7e7;
    padding-top: 0.3em;
    font-weight: bold;
}

.marcade-next-stage-links {
    display: flex;
    justify-content: center;
}

.marcade-next-stage-links>* {
    margin: 0.1rem;
}

#main-area {
    /* body */
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

#sidebar-wrapper>div.wrapper {
    width: auto;
}

#content-area {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: auto;
    scroll-behavior: smooth;
    position: static;
    left: auto;
    top: auto;
    -webkit-transform: none;
    transform: none;
    width: auto;
    right: auto;
    min-height: 0;
}

#content.active {
    width: auto;
}

#content-text {
    padding-left: 5%;
    padding-right: 5%;
    text-align: justify;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

#content-text.with-infobox {
    padding-right: 15%;
}

@media (max-width: 768px) {
    #content {
        width: auto;
    }

    #content.active {
        width: auto;
    }
}

#footer {
    padding-top: 0rem;
    padding-bottom: 0rem;
}

#content .marcade-change-password,
#content .marcade-login {
    justify-content: center;
    display: flex;
    flex-direction: column;
    height: 80vh;
}

#content .marcade-change-password>div,
#content .marcade-login>div {
    margin-left: 25%;
    margin-right: 25%;
}

.jumbotron,
#content .marcade-change-password>div,
#content .marcade-login>div {
    padding: 3rem;
    margin-bottom: 1.5rem;
    border-radius: var(--bs-border-radius-lg);
    background-color: #e9ecef;
}

.bs4-close-span {
    display: none;
}

#advisor-chat-input {
    padding: 1rem;
}

#advisor-hiring .changed {
    background-color: var(--changed-value-background-color) !important;
}

#advisor-hiring tr.consultant-information.active>td {
    background-color: hsl(var(--app-theme-color-h),
            var(--app-theme-color-s),
            calc(var(--app-theme-color-l) + 20%));
}

#advisor-hiring tr.consultant-information.active a,
#advisor-message-list .budget-warning a {
    color: hsl(226, 70%, 45%);
    font-weight: bold;
}

#advisor-hiring td:has(> .hourly-rate),
#advisor-hiring td:has(> .remaining-time),
#advisor-hiring td:has(> .total-cost) {
    text-align: center;
}

#advisor-message-list {
    display: flex;
    flex-direction: column;
    padding: 15px;
}

#advisor-message-list.no-messages {
    flex-grow: 1;
    flex-shrink: 0;
    overflow-y: auto;
    justify-content: center;
    align-items: center;
}

#advisor-message-list.no-messages .messages-placeholder {
    align-items: center;
    padding: 3rem;
    border-radius: 0.5rem;
    background-color: hsl(50, 50%, 70%);
}

#advisor-message-list.no-messages .messages-placeholder em {
    display: inline;
}

#advisor-message-list .message {
    max-width: 75%;
    padding: 10px 15px;
    border-radius: 15px;
    margin-bottom: 10px;
}

#advisor-message-list .message.sent {
    /* color will be set by the view per user */
    align-self: flex-end;
}

#advisor-message-list .message.received {
    background-color: hsl(210, 15%, 90%);
    align-self: flex-start;
}

#advisor-message-list .message.diagnostic {
    max-width: 100%;
    background-color: hsl(57, 80%, 80%);
}

#advisor-message-list .message .sender-name {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
}

#advisor-message-list .message .timestamp {
    font-size: 0.8em;
    color: hsla(0, 10%, 10%, 0.6);
    bottom: 5px;
    right: 10px;
}


/* The take-over page and the signed-out modal: a plain, on-theme panel rather
   than an error page — these are shown to a participant who has done nothing
   wrong. */
.marcade-signed-out-icon {
    color: var(--app-title-color);
}

.marcade-session-takeover {
    max-width: 40rem;
}

.marcade-session-takeover .btn {
    white-space: normal;
}

/* The session diagnostics table. Ruled in the app's own colour rather than a
   fixed one: the page is reached from a session, so it should not look like it
   belongs to a different case study than the one around it. */
.marcade-session-diagnostics {
    padding: 2rem;

    --diagnostics-rule-color: hsl(var(--app-theme-color-h),
            var(--app-theme-color-s),
            calc(var(--app-theme-color-l) - 10%));

    --diagnostics-group-background: hsl(var(--app-theme-color-h),
            var(--app-theme-color-s),
            calc(var(--app-theme-color-l) + 20%));
}

.marcade-session-diagnostics .marcade-session-facts caption {
    caption-side: top;
    color: var(--app-title-color);
}

.marcade-session-diagnostics .tabulator {
    background-color: #fff;
    border: 1px solid var(--diagnostics-rule-color);
}

.marcade-session-diagnostics .tabulator .tabulator-header,
.marcade-session-diagnostics .tabulator .tabulator-header .tabulator-col {
    background-color: var(--app-theme-color);
    color: var(--sidebar-color);
}

/* The rows are wide enough that an unruled table is hard to read across. */
.marcade-session-diagnostics .tabulator .tabulator-header .tabulator-col,
.marcade-session-diagnostics .tabulator .tabulator-row .tabulator-cell {
    border-right: 1px solid var(--diagnostics-rule-color);
}

.marcade-session-diagnostics .tabulator .tabulator-row.tabulator-group {
    background-color: var(--diagnostics-group-background);
    border-bottom: 1px solid var(--diagnostics-rule-color);
}
