/*#region Variables */

:root {
    --height-top-bar: 56px;
    --dialog-max-height: 100vh;
    --dialog-vertical-spacing: 1rem;
    --table-max-height: 100vh;
    --table-vertical-spacing: 244px;
    --live-screen-status-panel-min-width: 425px;
    --live-screen-status-panel-max-width: 520px;
}

/*#endregion */

html {
    /*Root Font size that is used for rem units*/
    font-size: 16px !important;
    height: 100%;
}

/*#region Mudblazor Overrides*/
.mud-toolbar {
    max-height: 150px;
}

.mud-popover {
    justify-content: center;
}

.right-menu-drawer .mud-drawer-content {
    overflow-y: auto !important;
}

.right-menu-footer {
    padding: 16px 12px 20px;
}
/*#endregion*/

/*#region Dashboard widget tabs */
@media (max-width: 599.98px) {
    .dashboard-widget-tabs > .mud-tabs-tabbar .mud-tabs-tabbar-inner {
        min-height: 36px;
    }

    .dashboard-widget-tabs > .mud-tabs-tabbar .mud-tab {
        min-height: 36px;
        padding-top: 2px;
        padding-bottom: 2px;
    }

    .dashboard-widget-tabs > .mud-tabs-tabbar .mud-tabs-scroll-button .mud-icon-button {
        padding-top: 6px;
        padding-bottom: 6px;
    }
}
/*#endregion */

/*#region MudAlert */
.mud-alert {
    font-weight: 500;
    text-align: center;
}
/*#endregion */


/*#region index pages*/
.index-page {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0px;
}
/*#endregion*/

.fullscreen {
    width: 100vw;
    height: 100vh;
}

.overlay {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    right: 0;
}

.center-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/*#region Loader/Progress*/

.progress {
    width: 100%;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #e9ecef;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
}

.progress-bar {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    background-color: #33363D;
    transition: width .6s ease;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);
    background-size: 1rem 1rem;
}

.progress-bar-animated {
    -webkit-animation: progress-bar-stripes 1s linear infinite;
    animation: progress-bar-stripes 1s linear infinite;
}

.loading-progress-bar {
    width: var(--blazor-load-percentage, 10%);
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading...");
}

@keyframes progress-bar-stripes {
    from {
        background-position: 1rem 0;
    }

    to {
        background-position: 0 0;
    }
}

.polar-bear-startup-loader {
    display: block;
    width: min(240px, 80vw);
    height: auto;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.polar-bear-loader {
    display: block;
    align-self: center;
    width: 144px;
    max-width: 100%;
    height: auto;
}

.polar-bear-loader-small {
    width: 72px;
}

.polar-bear-loader-large {
    width: 240px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg)
    }

    100% {
        transform: rotate(360deg)
    }
}

/*#endregion */

/*#region Button Loader */
.button-loader {
    /* Hide the existing text */
    text-indent: 900%;
    white-space: nowrap;
    overflow: hidden;
}

    .button-loader::before {
        /* NOTE: ::after is used by mudbutton */
        content: "";
        position: absolute;
        top: calc(50% - 0.5em);
        left: calc(50% - 0.5em);
        width: 1em;
        height: 1em;
        border: 0.2em solid currentColor;
        border-top-color: #000000;
        border-radius: 50%;
        box-sizing: border-box;
        animation: spin 1500ms linear infinite;
    }

/*#endregion */

/*#region Device Dashboard */
.live-screen-status-panel {
    max-width: 100%;
}
/*#endregion */

/*#region Validation Summary */
.validation-errors {
    list-style: inside;
}

    .validation-errors .validation-message {
        color: var(--mud-palette-error) !important;
    }
/*#endregion */

.noselect {
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Old versions of Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome, Edge, Opera and Firefox */
}

/*#region Media Queries */
/*Applied on any size bigger then mobile*/
@media(min-width: 600px) {
    :root {
        --height-top-bar: 64px;
    }

    .gateway-devices-table .mud-toolbar {
        height: 55px !important;
        margin-bottom: -5px;
    }
}

@media(min-width: 1280px) {
    .live-screen-status-panel {
        min-width: var(--live-screen-status-panel-min-width);
        max-width: var(--live-screen-status-panel-max-width);
    }
}

@media(min-width: 1920px) {
    .live-screen-status-panel {
        max-width: calc(var(--live-screen-status-panel-max-width) + 200px);
    }
}

@media(min-width: 2560px) {
    .live-screen-status-panel {
        max-width: calc(var(--live-screen-status-panel-max-width) + 400px);
    }
}

/* typical phone screen resolution */
@media only screen and (max-width : 667px) {
    .xs-width-full {
        width: 100% !important;
    }

    .hide-on-mobile,
    .mud-tooltip.mud-tooltip-default {
        display: none !important;
    }

    .device-alert-enabled-td {
        padding-right: 8px !important;
    }

    .device-alerts-table .mud-table-cell {
        line-height: 2.6 !important;
    }
}
/*#endregion */

/*#region Login */
/*#remove blue background with input autocomplete */
input:-webkit-autofill,
input:-webkit-autofill:focus {
    transition: background-color 600000s 0s, color 600000s 0s;
}

input[data-autocompleted] {
    background-color: transparent !important;
}
/*#endregion */

/*#region Live Reports */
/*#applied on mobile */
@media(max-width:523px) {
    .full-width-on-mobile {
        width: 100%;
    }
}

@media (max-width: 600px) {
    #live-reports-table .mud-table-cell {
        text-align: end !important;
    }

    .dataset-alert .mud-alert-position {
        justify-content: center;
    }

    .date-info {
        text-align: center;
        gap: 0 !important;
    }
}

#live-reports-dataSets-table .mud-table-cell:first-of-type {
    padding-left: 8px !important;
}

.live-reports-parameters-div .input-width,
.select-list-div .input-width {
    width: 50% !important;
}

.widget-gauge-div .input-width {
    width: 33.3% !important;
}

.widget-gauge-div .mud-input-control {
    margin-top: 0 !important;
}

@media (max-width: 960px) {
    .live-reports-parameters-div,
    .select-list-div,
    .widget-gauge-div {
        flex-direction: column !important;
    }

    #live-reports-dataSets-table .mud-table-cell {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .live-reports-parameters-div .input-width,
    .select-list-div .input-width,
    .widget-gauge-div .input-width {
        width: 100% !important;
    }

    .widget-graph-items-table tr .mud-table-cell {
        display: block !important;
        text-align: center !important;
    }
}
/*#endregion */

/*#region Live Reports Date Range Picker */
/*#override MudDateRangePicker styles for custom look and feel */
.date-range-picker .mud-button-date {
    font-size: 1rem !important;
    font-weight: bold !important;
    letter-spacing: inherit !important;
    padding-left: 0 !important;
}

.date-range-picker .mud-picker-datepicker-toolbar {
    align-items: center !important;
    flex-direction: row !important;
}

.date-range-picker .mud-button-year {
    font-weight: bold !important;
    letter-spacing: inherit !important;
}

.date-range-picker-div {
    max-height: 500px;
    overflow-y: auto;
    margin-top: -7px
}

.date-picker-grid {
    width: 310px;
}

.date-range-picker .mud-picker-toolbar {
    height: 40px !important;
}

.date-range-picker .mud-picker-calendar-container {
    margin: 0 auto !important;
}

.date-range-picker .mud-picker-calendar-content {
    grid-column-gap: 0px !important;
}

.date-range-button {
    width: 50%;
}

.live-report-input .mud-input-root-outlined,
.select-list-input .mud-input-root-outlined {
    padding: 14px !important;
}

.date-range-input .mud-input-root-outlined {
    display: flex !important;
    align-items: center !important;
    padding: 10px 0 9px 0 !important;
}

.last-grid-item {
    align-self: center !important;
}

@media (max-width: 674px) {
    .date-range-picker .mud-picker-calendar-content, .date-picker-grid {
        grid-template-columns: 1fr !important;
    }

        .date-picker-grid .mud-grid-item {
            width: 300px;
        }

    .last-grid-item {
        padding-bottom: 40px !important;
    }

    .date-picker-grid .mud-select {
        margin-top: -680px;
    }

    .date-range-picker .mud-picker-calendar-container:first-of-type {
        padding-top: 80px;
    }

    .first-grid-item {
        padding: 0 !important;
    }
}
/*#endregion */

/*#region Gateway Setup - Find Gateway page */
.gateway-arrow-img {
    display: block;
    position: absolute;
    vertical-align: middle;
}

@keyframes pulseIn {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@-webkit-keyframes pulseIn {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.gateway-arrow-img {
    translate: 215px -160px;
    animation: 1500ms pulseIn 0ms ease-in-out infinite;
    -webkit-animation: 1500ms pulseIn 0ms ease-in-out infinite
}

.gateway-img {
    display: block;
}

.gateway-mobile-img {
    display: none;
}

@media (max-width: 599px) {
    .gateway-img {
        display: none;
    }

    .gateway-mobile-img {
        display: block;
    }

    .gateway-arrow-img {
        translate: 175px -135px;
    }
}
/*#endregion */

/*#region Device - Alerts page */
.title-bold {
    font-weight: bold;
}

.mud-tab-active {
    background-color: var(--mud-palette-dark-hover);
}

.device-alert-header {
    background-color: var(--mud-palette-dark-hover);
    height: 45px;
    box-shadow: 0px 0px 4px #999;
    align-items: center;
    margin-top: 1px;
}

.sub-header-text {
    font-size: 0.9rem;
    line-height: 1.1rem;
    font-style: italic;
}
/*#endregion */

/*#region Live button group */

.live-button-group .mud-button-icon-size-medium > *:first-child {
    font-size: 22px !important;
}

@media only screen and (max-width : 667px) {
    .live-button-group .mud-button-icon-size-medium > *:first-child {
        font-size: 30px !important;
    }
}
/*#endregion */


.panel-header {
    font-weight: bold;
}

.html-code-editor {
    box-sizing: border-box;
    width: 100%;
    min-height: 240px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
}

.html-code-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
}

.html-code-editor-panel,
.html-code-preview-panel {
    min-width: 0;
}

.html-code-preview {
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-wrap: break-word;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: #fff;
    padding: 16px;
}

.ace-chrome .ace_comment {
    color: #22863a !important;
    font-style: italic;
}

.ace-chrome .ace_entity.ace_name.ace_tag,
.ace-chrome .ace_meta.ace_tag {
    color: #d73a49 !important;
}

.ace-chrome .ace_entity.ace_other.ace_attribute-name {
    color: #6f42c1 !important;
}

.ace-chrome .ace_string {
    color: #032f62 !important;
}

@media (max-width: 900px) {
    .html-code-editor-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

.ace_marker-layer .html-syntax-error {
    position: absolute;
    z-index: 5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='4' viewBox='0 0 8 4'%3E%3Cpath d='M0 3L2 1L4 3L6 1L8 3' fill='none' stroke='%23f44747' stroke-width='1'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: left bottom;
}

.html-code-editor .ace_gutter_annotation {
    cursor: pointer;
}

.html-diagnostic-popup {
    position: fixed;
    z-index: 2000;
    box-sizing: border-box;
    width: max-content;
    max-width: min(360px, calc(100vw - 16px));
    max-height: min(280px, calc(100vh - 16px));
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 4px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
    font: 13px/1.4 Arial, sans-serif;
}

.html-diagnostic-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.html-diagnostic-popup-header button {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
}

.html-diagnostic-popup ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

.html-diagnostic-popup li + li {
    margin-top: 4px;
}

.html-diagnostic-error strong {
    color: #c62828;
}

.html-diagnostic-warning strong {
    color: #a36400;
}

.html-code-panel-heading {
    display: flex;
    align-items: center;
    height: 32px;
}

.html-code-editor-tabs {
    display: flex;
    gap: 4px;
}

.html-code-editor-tabs button {
    padding: 4px 16px;
    color: var(--mud-palette-text-primary);
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.html-code-editor-tabs button[aria-selected="true"] {
    color: var(--mud-palette-primary);
    border-bottom-color: var(--mud-palette-primary);
}

.html-code-editor-tabs button:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.ace_marker-layer .css-color-swatch {
    position: absolute;
    box-sizing: border-box;
    border: 1px solid #777;
    border-radius: 2px;
    pointer-events: none;
}

/* Shared tile styles: emitted once for all tile instances. */
.isDisabled {
    color: currentColor;
    cursor: not-allowed;
    opacity: 0.5;
}

.lifted-effect {
    padding: initial;
    border-radius: 20px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    min-height: auto;
}

    .lifted-effect.tile-hover-enabled:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 10px;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

.tile-bottom-left-chip {
    height: 22px;
    font-size: 11px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.tile-content-root {
    position: relative;
}

.tile-bottom-left-overlay {
    position: absolute;
    left: -9px;
    bottom: -9px;
    z-index: 2;
}

.tile-bottom-right-overlay {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.tile-top-right-overlay {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
}
