/*
 * COMMON
 */

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    /*background-color: #eeeeee;*/
    color: #536272;
    text-align: center;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'Roboto Condensed', sans-serif !important;

    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    -webkit-tap-highlight-color: transparent;
}


/* ------------------------------------------------ */
/* Compensate for message box below header in views */
/* ------------------------------------------------ */

/* Add margin to s-container only when messages are present */
body:has(#messages_section .message-box-container) .s-container {
    margin-top: 7rem !important;
}

/* Add margin to #dashboard_content only when messages are present */
body:has(#messages_section .message-box-container) #dashboard_content {
    margin-top: 3rem !important;
}

/* Add margin to .tools-content-configurator only when messages are present */
body:has(#messages_section .message-box-container) .tools_content-configurator {
    margin-top: 3rem !important;
}

/* Add margin to container.my-5 spacer (without a s-container successor) when messages are present */
body:has(#messages_section .message-box-container) .container.my-5:not(:has(+ .s-container)) {
    margin-top: 8rem !important;
}

/* Exceptions: s-container that already has pt-5 or mt-5 classes or has spacer children*/
body:has(#messages_section .message-box-container) .s-container.pt-5 {
    margin-top: 5rem !important;
}
body:has(#messages_section .message-box-container) .s-container.mt-5 {
    margin-top: 6rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(> .container-fluid.pt-3:first-child) {
    margin-top: 5rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(> .container-fluid.pt-4:first-child) {
    margin-top: 6rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(> .container-fluid.p-4:first-child) {
    margin-top: 4rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(> .container-fluid.pt-5:first-child) {
    margin-top: 2rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(> .container-fluid.mt-5:first-child) {
    margin-top: 5rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(> .container-fluid.mt-5:nth-child(2)) {
    margin-top: 2rem !important;
}
body:has(#messages_section .message-box-container) .s-container:not(.mt-5):has(> .container-fluid.p-2:first-child) {
    margin-top: 4rem !important;
}
body:has(#messages_section .message-box-container) .s-container:has(.row.filter .col-md-12.pb-3) {
    margin-top: 5rem !important;
}

/* Remove spacer before s-container */
body:has(#messages_section .message-box-container) .container.my-1:has(~ .s-container) {
    display: none !important;
    margin: 0 !important;
}

/* End compensation */


input {
    font-size: 1em;
    padding: 0.4em 0.3em 0.5em;
    margin: 0.25em 0;

    -moz-user-select: text; /* Firefox */
    user-select: text; /* Standard */
}

.hidden {
    display: none !important;
}

.tools_select {
    position: relative;
    font-size: 0.8em;
    width: 50%;
    text-overflow: ellipsis;
    float: right;
}

div.sticky {
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    background-color: green;
    border: 2px solid #4CAF50;
}


/* The spinner */

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.spinner,
.spinner:before {
    width: 20px;
    height: 20px;
    box-sizing: border-box;
}

.spinner:before {
    content: '';
    display: block;
    border-radius: 50%;
    border: 2px solid #ccc;
    border-top-color: #333;
    animation: spinner .6s linear infinite;
}

.spinner-absolute {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
}

/* Animations */

.spinner-add,
.spinner-remove {
    animation-fill-mode: both;
    animation-duration: .4s;
}

.spinner-add {
    animation-name: spinner-add;
}

@keyframes spinner-add {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.spinner-remove {
    animation-name: spinner-remove;
}

@keyframes spinner-remove {
    to {
        transform: scale(0);
    }
}

.filter {
    top: 3em;
    position: relative;
}

#dashboard_content {
    position: relative !important;
}

.formattedvalue {
    overflow: auto;
}

.tools_content {
    position: absolute;
    top: 18em;
    left: 0;
    width: calc(100% - 2em);
    padding: 1em;
    height: calc(100% - 16em);
    overflow-x: hidden;
    overflow-y: auto;
}

.dash-scroll-content {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 65vh;
}

.search-scroll-area {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 20vh;
}

.vehicle-scroll-area {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 80vh;
}

.xpress-scroll-area {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 80vh;
}

.inactive {
    color: #434343;
    opacity: 0.2;
}

/* DASHBOARD SESSIONS */

.fa-circle-o-notch {
    color: #aa0000;
}

.fa-spin {
    color: #00aaaa;
}

.v_vehicle_key {
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: calc(100% - 6em);
    overflow: hidden;
}

@media (max-width: 820px) {
    .s-container {
        padding-top: 10rem;
    }
}

@media (max-width: 576px) {
    .s-container {
        padding-top: 10rem;
    }
}

.sticky-footer {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 0.5rem;
    z-index: 2;
}

a {
    color: #0669b2;
    text-decoration: none;
    background-color: transparent;
}

.message-box-container {
    max-width: 100%;
}

/* Hide messages_section when no message-box-container inside */
#messages_section:not(:has(.message-box-container)) {
    display: none !important;
}

.alert-limited {
    max-height: 60px;
    overflow: hidden; !important;
    white-space: nowrap; !important;
    /*;*/
    cursor: pointer;
    min-width: 0;
}

/* First (most important) should be more prominent than others */
.alert-primary-message {
    flex: 2 !important;   /* width should be double */
    font-weight: bold;
}

.alert-flex-item {
    flex: 1 1 0;
    min-width: 0;
}

.alert-more-btn {
    white-space: nowrap;
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    font-weight: bold;
}

/* To better distinguish between message header and page info block (for which also Bootstrap's alert is used,
replace class "alert alert-info" by border with different background
*/
.card-title + .alert.alert-info,
.card-title + * + .alert.alert-info,
.card-title ~ .row > .alert.alert-info:first-child
{
    background-color: transparent;
    border: 0 !important;
    border-top: 1px solid var(--bs-border-color-translucent) !important;
    color: inherit;
    padding: 0.75rem 1rem;
}

/* END */
