/*
html, body {
    font-family: 'RuneScape-Barbarian-Assault';
    font-family: 'RuneScape-Bold-12', sans-serif;
    font-family: 'RuneScape-Fairy-Large';
    font-family: 'RuneScape-Fairy';
    font-family: 'RuneScape-Plain-11';
    font-family: 'RuneScape-Plain-12';
    font-family: 'RuneScape-Quill-8';
    font-family: 'RuneScape-Quill-Caps';
    font-family: 'RuneScape-Quill';
    font-family: 'RuneScape-Surok';
}
*/

/* Stops vertical scroll when opening modal */
body.modal-open {
    padding-right: 0 !important;
}

body.modal-open .fixed-top,
body.modal-open .sticky-top {
    padding-right: 0 !important;
}
/*                                          */

#main-content {
    margin-top: 60px;
    margin-left: 255px; /* Space for the expanded sidebar */
    margin-right: 5px;
    /*transition: margin-left 0.3s ease;*/
}
#main-content.minimized {
    margin-top: 60px;
    margin-left: 65px; /* Adjust margin when sidebar is minimized */
    margin-right: 5px;
}

#login {
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

#sidebar li.nav-item:hover {
    box-shadow: rgba(21, 21, 21, 0.4) 0px 0px 0px 2px, rgba(21, 21, 21, 0) 0px 4px 6px -1px, rgba(255, 255, 255, 0.08) 0px 1px 0px inset;
}

#sidebar .dropdown-menu li:hover {
    background-color: var(--bg-create);
}

#sidebar button.nav-link {
    width: 100%;
}

#navbar-sidebar-buttons {
    display: none;
}

#driver-search:focus {
    border-color: #86b7fe;
}
#driver-search {
    color: #dee2e6;
    background-color: #373a3f;
    border-color: #495057;
}

#multi-date {
    min-width: 275px;
}

#quick-summary-container {
    min-width: 75px;
    max-width: 75px;
    min-height: 40px;
    max-height: 40px;
}
#filters {
    padding-bottom: 0.1rem;
    margin-bottom: 1rem;
}

#search-container {
    margin-left: 1rem;
    margin-right: 1rem;
}

[id*="_card_"] {
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
}

[data-bs-theme="light"] {
    --bs-body-bg: #fff;

    --custom-primary: #fff;
    --custom-secondary: #b5b5b5;
    --custom-tertiary: #696969;
    --bg-completed: #9bee9e;
    --bg-dispatched: #f0f07c;
    --bg-queued: #cecece;
    --bg-invoiced: #74e4ed;
    --bg-empty: #fb7a70;
    --bg-hl: #f0f07c;
    --bg-create: rgba(0, 0, 0, 0.075);
}
[data-bs-theme="dark"] {
    --bs-body-bg: #373a3f;
    --bs-emphasis-color: #dee2e6;

    --custom-primary: #373a3f;
    --custom-secondary: #5b5b5b;
    --custom-tertiary: #696969;
    --bg-completed: #5ea260;
    --bg-dispatched: #a9a93a;
    --bg-queued: #7a7a7a;
    --bg-invoiced: #59a3a9;
    --bg-empty: #fb7a70;
    --bg-hl: #8d8d42;
    --bg-create: rgba(255, 255, 255, 0.075);
}

td.bg-completed {
    background-color: var(--bg-completed);
}
td.bg-dispatched {
    background-color: var(--bg-dispatched);
}
td.bg-queued {
    background-color: var(--bg-queued);
}
td.bg-invoiced {
    background-color: var(--bg-invoiced);
}
td.bg-empty {
    background-color: var(--bg-empty);
}

.bg-completed {
    background-color: var(--bg-completed) !important;
}
.bg-dispatched {
    background-color: var(--bg-dispatched) !important;
}
.bg-queued {
    background-color: var(--bg-queued) !important;
}
.bg-invoiced {
    background-color: var(--bg-invoiced) !important;
}
.bg-empty {
    background-color: var(--bg-empty) !important;
}
.bg-hl {
    display: inline;
    background-color: var(--bg-hl) !important;
    font-variant-ligatures: none;
}
.bg-primary {
    background-color: var(--custom-primary) !important;
}
.bg-secondary {
    background-color: var(--custom-secondary) !important;
}

.text-completed {
    color: var(--bg-completed) !important;
}
.text-dispatched {
    color: var(--bg-dispatched) !important;
}
.text-queued {
    color: var(--bg-queued) !important;
}
.text-invoiced {
    color: var(--bg-invoiced) !important;
}
.text-empty {
    color: var(--bg-empty) !important;
}

.border-completed {
    border: 2px solid var(--bg-completed) !important;
    border-top: 3px solid var(--bg-completed) !important;
}
.border-dispatched {
    border: 2px solid var(--bg-dispatched) !important;
    border-top: 3px solid var(--bg-dispatched) !important;
}
.border-queued {
    border: 2px solid var(--bg-queued) !important;
    border-top: 3px solid var(--bg-queued) !important;
}
.border-invoiced {
    border: 2px solid var(--bg-invoiced) !important;
    border-top: 3px solid var(--bg-invoiced) !important;
}
.border-empty {
    border: 2px solid var(--bg-empty) !important;
    border-top: 3px solid var(--bg-empty) !important;
}

.btn-month {
    border: none;
}
.btn-month:hover {
    background-color: var(--custom-secondary);
}
.btn-month.active {
    background-color: var(--custom-secondary);
}

.create-button {
    border-radius: 5px;
}
.create-button:hover {
    color: var(--bs-link-color);
    cursor: pointer;
    background-color: var(--bg-create);
}

td[data-label="Actions"] i.bi:hover {
    color: var(--bs-link-color);
}

td[data-label="Actions"] i.bi-trash2:hover {
    color: var(--bg-empty);
}

.btn-close:hover {
    filter: invert(51%) sepia(55%) saturate(3000%) hue-rotate(360deg) brightness(100%) contrast(102%);
}

/* Unchecked state */
.btn-check:not(:checked) + .btn-outline-success {
  color: #dc3545;              /* Bootstrap danger text */
  border-color: #dc3545;       /* Bootstrap danger border */
}

/* Change text when unchecked */
.btn-check:not(:checked) + .btn-outline-success::after {
  content: "Inactive";
}

/* Hide original text and use pseudo-element text instead */
.btn-check:not(:checked) + .btn-outline-success {
  position: relative;
  color: transparent; /* hide original text color */
}

.btn-check:not(:checked) + .btn-outline-success::after {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #dc3545;
}

td.hidden {
    display: none;
}

td.editable:hover {
    cursor: pointer !important;
    opacity: 0.7;
}
th.shrink, td.shrink {
    width: 1%;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

#page-top {
    border-radius: 5px;
    box-shadow: rgba(0, 0, 0, 0.4) 0px 2px 4px, rgba(0, 0, 0, 0.3) 0px 7px 13px -3px, rgba(0, 0, 0, 0.2) 0px -3px 0px inset;
}
#page-top.sticky-top {
    top: 56px;
    background-color: var(--bs-body-bg);
}

button#datefilter-collapse {
    position: fixed;
    z-index: 9999999;
    right: 10px;
    bottom: 10px;
}

button#browser-back-nav {
    position: relative;
    z-index: 9999999;
}
button#browser-forward-nav {
    position: relative;
    z-index: 9999999;
}

#page-bottom {
    position: relative;
    bottom: 0;
    height: 50px;
    pointer-events: none;
}

tr.spacer, tr.spacer td {
    background-color: var(--custom-tertiary);
}

@keyframes glow-border {
    0% { box-shadow: 0 0 1px 2px var(--bg-empty); }
    100% { box-shadow: none; }
}

tr.glow-border {
    box-shadow: 0 0 1px 2px var(--bg-empty);
    position: relative;
    z-index: 1;
}

.glow-effect {
    animation: glow-border 2s ease-out;
    position: relative;
    z-index: 1;
}

.tooltip-inner {
    white-space: pre-wrap;
    text-align: left;
}

.quick-status.container {
    padding: 0;
}
.quick-status.container .row {
    cursor: pointer;
    border-radius: 5px;
}
.quick-status.container .row:hover {
    background-color: var(--custom-tertiary);
}

td[data-label="ID"], td[data-label="Status"] {
    cursor: pointer;
}

/* ICONS */
i {
    cursor: pointer;
}
i[class*="bi-info-"] {
    color: var(--bg-empty);
}

textarea#shipment_info {
    height: 150px !important;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot-big {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}
.status-border {
    width: 20px;
    height: 20px;
    border-radius: 15%;
}

#ws-status-container {
    cursor: pointer;
}
.ws-status.live {
    color: var(--bg-completed);
}
.ws-status.offline {
    color: var(--bg-empty);
}

.status-dot.live {
    background-color: #00ff00;
    box-shadow: 0 0 6px 2px #00ff00;
    animation: pulse-live 1s alternate infinite;
}

.status-dot.offline {
    background-color: #ff0000;
    box-shadow: 0 0 6px 2px #ff0000;
    animation: pulse-offline 1s alternate infinite;
}

.mt-60 {
    margin-top: 60px !important;
}

table.dispatch > thead > tr > th, table.dispatch > tbody > tr > td {
    background-color: transparent;
}

table > tbody > tr:last-child {
    border-bottom: transparent;
}

#logo {
    display: none;
}

.override-mobile {
    display: none;
}

.my-indicator {
    display: none;
}
.htmx-request .my-indicator, .htmx-request.my-indicator {
    display: inline;
}

.show-delay {
    opacity: 0;
    animation: fade-in 0s linear 0.5s 1 normal forwards;
}
.show-delay-02 {
    opacity: 0;
    animation: fade-in 0s linear 0.2s 1 normal forwards;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse-live {
    0% {
        background: rgba(155,238,158,0.3);
        box-shadow: inset 0px 0px 10px 2px rgba(155,238,158,0.5),
        0px 0px 5px 2px rgba(155,238,158,0.3);
    }
    100% {
        background: rgba(155,238,158,0.8);
        box-shadow: inset 0px 0px 10px 2px rgba(155,238,158,0.5),
        0px 0px 5px 2px rgba(155,238,158,0.8);
    }
}

@keyframes pulse-offline {
    0% {
        background: rgba(251,122,112,0.3);
        box-shadow: inset 0px 0px 10px 2px rgba(251,122,112,0.5),
        0px 0px 5px 2px rgba(251,122,112,0.3);
    }
    100% {
        background: rgba(251,122,112,0.8);
        box-shadow: inset 0px 0px 10px 2px rgba(251,122,112,0.5),
        0px 0px 5px 2px rgba(251,122,112,0.8);
    }
}

@media screen and (max-width: 576px) {
    #main-content, #main-content.minimized {
        font-size: 0.8em;
        margin-left: 5px;
    }

    #sidebar {
        display: none;
    }
    #navbar-sidebar-buttons {
        display: inline-block;
    }
    button#browser-back-nav {
        position: fixed;
        z-index: 9999999;
        left: 10px;
        bottom: 10px;
    }
    button#browser-forward-nav {
        position: fixed;
        z-index: 9999999;
        left: 60px;
        bottom: 10px;
    }
    button > i.h5 {
        font-size: unset;
    }
}
@media screen and (max-width: 930px) {
    table:not(.no-mobile) {
        border: 0;
    }

    /* hide thead */
    table:not(.no-mobile) thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    table:not(.no-mobile) tr {
        display: block;
        margin-bottom: 2em;
    }

    table:not(.no-mobile) td {
        border-bottom: 1px solid var(--bs-border-color);
        display: block;
        text-align: right;
        min-height: 2.2em;
    }

    table:not(.no-mobile) tr.spacer td {
        min-height: unset;
    }

    table:not(.no-mobile) td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
    }
    table:not(.no-mobile) td:empty::before {
        content: attr(data-label) "\00a0";
    }

    table:not(.no-mobile) td:last-child {
        border-bottom: 0;
    }

    tr[id^="overrides-"] {
        display: none !important;
    }
    .full_info {
        display: none !important;
    }
    .override-mobile {
        display: block;
        border-top-width: 1px;
    }
}

/* SCROLLBAR */
/* width */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background: var(--custom-primary);
}

/* Handle */
::-webkit-scrollbar-thumb {
    background: var(--custom-secondary);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background: var(--custom-tertiary);
}
/* END SCROLLBAR */

@page { size: auto;  margin: 3mm; }
@media print {
    /* All your print styles go here */
    html, body, table, th, td, #content {
        color: black !important;
        font-size: small;
        background-color: white !important;
    }
    .noprint {
        display: none !important;
    }
    nav,
    #sidebar,
    #search-container,
    #datefilter-component {
        display: none !important;
    }
    button#datefilter-collapse {
        display: none !important;
    }
    #main-content {
        margin: 0 !important;
    }
    #page-top, #page-bottom {
        display: none !important;
    }

    #logo {
        display: flex;
        flex-direction: column;
    }
    #logo h3 h4 {
        justify-self: start;
    }
    #logo img {
        width: 200px;
        height: auto;
        margin-left: auto;
        margin-top: 15px;
        justify-self: end;
    }
    th {
        border-bottom-width: 2px !important;
        border-color: lightgray;
    }
    td {
        border-color: lightgray;
    }

    div#flat_rate {
        display: none !important;
    }
}
