/* ===== Dash styles ===== */
.DateInput_input, .DateInput_input_1 input {
    height: 36px !important;
}

.row + .row {
    margin-top: 5px;
}

a[role="tab"].active, .nav-link.active {
    font-weight: bold;
}

.header .nav-link {
    color: white !important;
}

.dash-spreadsheet-menu {
    float: right;
}

.dash-spreadsheet-menu > div {
    padding: 0;
}

div.Select-control {
    border-radius: inherit;
    height: 38px;
}

div.dash-dropdown {
    height: 38px;
}

.input-group-text {
    color: white;
}

.nav-link {
    color: black !important;
}

.card-header .form-label {
    margin-bottom: 0;
}

.content-flex, .data-card, .tab-content, .tab-content > .active, .tab-pane > div {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.dark, .company-name, .footer, .header, .input-group-text, .separator {
    background-color: rgb(33, 37, 41);
    color: white;
}

.form-switch {
    margin-bottom: 0;
    padding-left: 2.1em;
}

.form-switch > input {
    height: 100%;
    margin-top: 0;
    width: 63px !important;
}

/* Make sure dash table cell values keep their alignment when selected */
input.input-active.focused.dash-cell-value {
    text-align: inherit !important;
}

input.input-active.unfocused.dash-cell-value {
    text-align: inherit !important;
}

/* ===== AG Grid styling for the default style (ag-theme-alpine) ===== */
.center-aligned-header .ag-header-cell-label {
    justify-content: center;
}

.center-aligned-group-header .ag-header-group-cell-label {
    justify-content: center;

}

.ag-header-group-cell-label.ag-sticky-label {
    flex: auto !important;
}

.ag-theme-alpine .ag-header-group-cell {
    border-right: 1px solid #ddd !important;
    border-left: 1px solid #ddd !important;
    background-color: #e1effe
}

.ag-theme-alpine .ag-header-cell {
    border-right: 1px solid #ddd !important;
    border-left: 1px solid #ddd !important;
    background-color: #f0f8ff
}

.auction-grid .ag-header-cell,
.auction-grid .ag-header-group-cell {
    background-color: #6b0023 !important;
    color: white !important;
}

.ag-theme-alpine .ag-cell {
    border-right: 1px dashed #ddd !important;
    border-left: 1px dashed #ddd !important
}

.ag-theme-alpine .ag-header-cell-resize {
    position: absolute;
    top: 0;
    right: -2px;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    z-index: 1;
}

.ag-theme-alpine.compact {
    --ag-grid-size: 4px;
}

/* ===== Custom styles ===== */
button.export {
    background-color: #198754;
    border: 0;
    border-radius: 0.25rem;
    color: white;
}

button.export:hover {
    background-color: #157347;
    border-color: #146c43;
}

button.export:after {
    content: url("../images/file-excel.svg");
    display: inline-block;
    height: 100%;
    width: 15px;
}

html {
    font-size: 14px;
}

mark {
    color: inherit;
    background-color: inherit;
}

.company-name {
    color: rgb(156, 30, 48) !important;
    font-weight: bold;
}

.content-frame {
    height: 80vh;
    width: 100%;
}

/* The tab is a flex column so that the frame takes everything the controls above it leave. Every level from the tab
   pane down has to take part, see .content-flex above: a single block in between and the frame collapses to the 150px
   an iframe defaults to. */
.dashboard-tab {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.dashboard-frame-wrapper {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    /* A flex item defaults to not shrinking below its content, which would push the page into scrolling instead */
    min-height: 0;
    /* The embedded dashboard brings its own white background, the border is what sets it apart from the page */
    border: 1px solid #dee2e6;
    border-radius: 6px;
    /* Keeps the corners of the frame and the spinner inside the rounded border */
    overflow: hidden;
}

/* The frame is a block so that the baseline gap under an inline element does not add a stray scrollbar */
.dashboard-frame-wrapper > .content-frame {
    display: block;
    height: 100%;
}

/* Covers the frame while the browser fetches the dashboard, which happens long after the dash callback returned */
.dashboard-frame-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.dashboard-frame-spinner-text {
    color: rgb(33, 37, 41);
    font-size: 0.9rem;
}

.content-wrapper {
    max-height: 100%;
    padding-left: 5px;
    padding-right: 5px;
    overflow-y: auto;
}

.data-container {
    height: 100%;
}

.epc-button {
    background-color: #9C301E;
    border-color: #9C301E;
}

.epc-button:hover {
    background-color: #6e2216;
    border-color: #6e2216;
}

.epc-button:active {
    background-color: #6e2216 !important;
    border-color: #6e2216 !important;
    transform: scale(98%);
}

.epc-font-color {
    color: #9C301E;
}

.epc-form-label {
    font-weight: bold;
}

.epc-form-label:after {
    content: ":";
}

.footer {
    margin-top: 15px;
    padding-left: 5px;
    padding-right: 5px;
}

.header {
    margin-bottom: 15px;
}

.hidden-card {
    display: none
}

.loader-wrapper > div {
    visibility: visible !important;
}

.card-body .mantine-LoadingOverlay-root {
    z-index: 500 !important;
}

.logical-container {
    display: contents !important;
}

.login-header {
    color: #9C301E;
    font-size: 38px;
    font-weight: bold !important;
}

.image-container a {
    display: flex;
    justify-content: center;
}

.image-container img {
    max-height: 100vh;
    height: auto;
    width: auto;
}

.main {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100%;
    position: relative;
}

.menu-button {
    margin: 0 !important;
}

.menu-row {
    margin-top: 1rem;
}

.opaque-80 {
    opacity: 0.8;
}

.separator {
    background-color: inherit;
    color: inherit;
}

.show-hide {
    display: none;
}

.status-failed {
    background-color: #f6cdae;
}

.status-running {
    background-color: #d8d8d8;
}

.status-success {
    background-color: #d6e5bc;
}

.tile-button {
    height: 100%;
    width: 100%;
    min-height: 70px;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.tile-menu .tile-row {
    margin-bottom: 0.75rem;
}

.tile-menu .col {
    min-height: 75px;
    display: flex;
}

.tile-menu .col a {
    width: 100%;
    display: flex;
}


.title {
    font-size: 22px;
}

.upper-right-container {
    position: absolute;
    right: 15px;
    top: 10px;
    min-width: 250px;
    width: fit-content;
}

.upper-right-element {
    position: absolute;
    right: 40px;
    top: 53px;
    width: fit-content;
    z-index: 11
}

.version {
    text-align: right;
}


/* ===== MS login button styles ===== */
.ms-login-button {
    background: #2f2f2f url("../images/ms-symbollockup_signin_dark.svg") center no-repeat;
    border-color: #2f2f2f;
    padding-left: 12px;
    padding-right: 12px;
    /*width: 200px;*/
    height: 43px;
}

.ms-login-button:hover {
    background: #3f3f3f url("../images/ms-symbollockup_signin_dark.svg") center no-repeat;
    border-color: #3f3f3f;
}

.ms-login-button:active {
    background-color: #3f3f3f !important;
    border-color: #3f3f3f !important;
}

.power-dashboard-tab-button {
    padding: 6px 16px;
    height: auto;
    font-weight: normal;
    text-decoration: underline;
    cursor: pointer;
    margin-right: 12px;
    display: inline-block;
    border-radius: 4px 4px 0 0;
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    line-height: 1.4;
    text-decoration: none;
}

.power-dashboard-tab-button.active-tab {
    font-weight: bold;
    color: #0056b3;
    text-decoration: none;
    border-bottom: 2px solid #0056b3;
    background-color: rgba(0, 86, 179, 0.1);
    border-radius: 4px 4px 0 0;
    padding: 6px 16px;
    box-shadow: 0 2px 6px rgba(0, 86, 179, 0.3);
    cursor: default;
}

.power-dashboard-tab-button:not(.active-tab):hover {
    background-color: rgba(0, 86, 179, 0.12);
    border-bottom: 2px solid rgba(0, 86, 179, 0.4);
    box-shadow: 0 1px 3px rgba(0, 86, 179, 0.15);
    text-decoration: none;
}

.graph-title {
    color: #0056b3;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
}

.no-data-message {
    color: red;
    font-weight: bold;
    padding: 20px;
    text-align: center;
}

.graph-dropdown {
    width: 300px;
    font-size: 12px;
}

.date-range-message {
    width: fit-content;
    font-size: 2.5rem;
    padding: 8px 12px;
    background-color: #FFF4E6;
    border: 1.5px solid #FFD8A8;
    margin-left: auto;
    margin-bottom: 0.5rem;
}

._dash-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: transparent;
    width: 0;
    height: 0;
    text-align: center;
    z-index: 9999;
}

._dash-loading::after {
    content: '';
    display: inline-block;
    width: 4rem;
    height: 4rem;
    color: rgb(156, 30, 48) !important;
    vertical-align: text-bottom;
    border: 0.4em solid #e3e3e3;
    border-top: 0.4em solid currentColor;
    border-radius: 50%;
    -webkit-animation: spinner-border 1s linear infinite;
    animation: spinner-border 1s linear infinite;
    margin: 0;
}

.evolution-graph-dropdown {
    width: 125px;
    font-size: 12px;
}

.evolution-graph-block {
    flex: 1;
}

.power-dashboard-tab[data-active] {
    color: #9C301E;
    background-color: #f5e6e3;
}

.coef-container {
    display: flex;
    gap: 30px;
    margin-bottom: 15px;
}

.coef-box {
    display: flex;
    flex-direction: column;
    width: 175px;
}

.coef-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #444;
}

.coef-input {
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
}

/* dcc.Input puts className on a fixed-height (34px, border-box) wrapper around the real <input>: padding there
   shrinks the input below the text height, which Safari clips (Chromium lets the text overflow). */
.coef-input.dash-input-container {
    padding: 0;
}

.coef-input .dash-input-element {
    padding: 0 8px;
}

/* A value derived from the other input mode (fuel spreads): read-only, visibly greyed out */
.coef-input:has(.dash-input-element:disabled) {
    background-color: #f1f3f5;
    color: #868e96;
    cursor: not-allowed;
}

.coef-mode-box {
    width: auto;
}

/* Label followed by a small info (i) tooltip explaining how the value is derived */
.coef-label-with-info {
    display: flex;
    align-items: center;
    gap: 2px;
}

.coef-box:has(.coef-label-with-info) {
    width: 195px;  /* room for the icon next to the longest label */
}

.coef-label-with-info .coef-info {
    top: 0;
    color: #868e96;
}

.coef-hint {
    font-size: 12px;
    color: #868e96;
    margin: -8px 0 15px;
}

.power-snd-rotated .ag-header-cell-label,
.power-snd-rotated .ag-header-group-cell-label {
    align-items: flex-end;
    padding-bottom: 4px;
}

.power-snd-rotated .ag-header-cell-label .ag-header-cell-text,
.power-snd-rotated .ag-header-group-cell-label .ag-header-group-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.power-snd-rotated .ag-header-group-cell.horizontal-group-header .ag-header-group-text {
    writing-mode: horizontal-tb;
    transform: none;
}
.power-snd-rotated .ag-header-group-cell.horizontal-group-header .ag-header-group-cell-label {
    align-items: center;
    justify-content: center;
}

.ag-theme-quartz {
    --ag-column-border: 1px solid #b0b0b0;
    --ag-header-column-border: 1px solid #b0b0b0;
}

.ag-theme-quartz.compact {
    --ag-grid-size: 4px;
}

.power-snd-rotated .ag-cell.snd-near-zero {
    color: #bdbdbd !important;
}

.power-snd-rotated .ag-cell.snd-neg {
    color: #d32f2f !important;
}

.power-snd-rotated .ag-cell.snd-above-market {
    background-color: #c8e6c9 !important;
}

.power-snd-rotated .ag-cell.snd-below-market {
    background-color: #ffcdd2 !important;
}

.power-snd-rotated .ag-cell.snd-pos-bg {
    background-color: #c8e6c9 !important;
}

.power-snd-rotated .ag-cell.snd-neg-bg {
    background-color: #ffcdd2 !important;
}

.weather-anomaly-grid .ag-row-hover .ag-cell {
    filter: brightness(0.92);
}

.weather-anomaly-grid .ag-header-cell,
.weather-anomaly-grid .ag-header-group-cell {
    padding-left: 3px;
    padding-right: 3px;
}

/* A relative offset, not a margin: the icon is the flex item on a card that lists symbols but sits inside a
   tooltip wrapper on one that does not, and an offset moves both alike because it leaves the layout alone. */
.info-icon {
    position: relative;
    top: -2px;
}

.accordion-header-row {
    position: relative;
    display: flex;
    align-items: center;
}

.accordion-header-row > .mantine-Accordion-control {
    flex: 1 1 auto;
}

.symbols-info-panel {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s linear 0.25s, opacity 0.15s linear 0.1s;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 760px;
    max-width: 90vw;
    margin-top: -12px;
    padding: 24px 12px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    text-align: left;
    cursor: default;
}

.accordion-header-row:has(.symbols-info-icon:hover) .symbols-info-panel,
.symbols-info-panel:hover {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
    transition-duration: 0s;
}

/* ===== Symbol Catalog ===== */
/* The selected version in its place among the versions of a version drop down: a disabled copy of the option on top
   in the Selected group, see get_version_options in web/pages/symbol_catalog/tabs/data_loader.py. It's highlighted, not
   dimmed like a disabled option, and without the check icon, which only the option on top has. */
.mantine-Select-option[value^="__selected__:"] {
    opacity: 1;
    cursor: default;
    background-color: var(--mantine-primary-color-light);
    color: var(--mantine-primary-color-light-color);
}
