/* TMS Main stylesheet
 * ======================
 * Created by: Peter Richards
 * Created on: 06/01/2021
 * (C) Copyright YingaTech UK Ltd.
 */

/*# Index:
 * - Base styles & page containers
 * - Header styles
 * - Beneath track styles
 * + Object styles
 * | - Cards, blocks & buttons
 * | - Status indicators
 */

@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v134/kJEhBvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oFsI.woff2) format('woff2');
    font-display:block;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    max-width:24px;
    max-height:24px;
    overflow:hidden;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    cursor:default !important;
}

/* =============================
 * Base styles & page containers
 * ============================= */
html, body {
    width: 100%;
    height: 100%;
    padding: 0;
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #222329;
    color: #fff;
}

.tms_container_page {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.tms_container_centerFill {
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
}

.tms_container_paddingFill {
    width:100%;
    height:100%;
    align-items:center;
    box-sizing: border-box;
    padding:20px;
}

@media(max-width:600px) {
    .tms_container_paddingFill {
        padding:20px 5px;
    }
}

/* =============================
 * Header styles
 * ============================= */
.tms_header {
    width:100%;
    display:flex;
    flex-direction:row;
    margin-bottom:12px;
    justify-content:flex-start;
}

.tms_header div {
    align-content: center;
}

.tms_header_controls {
    margin: auto;
    display: flex;
    flex-direction: row;
}

.tms_header_controls a {
    text-decoration: none;
}

.tms_header_button {
    vertical-align: middle;
    cursor: pointer;
    padding: 11px 30px 9px 30px !important;
    border-radius: 50px !important;
    font-weight:bold;
    transition:background-color 0.2s;
    user-select:none;
    color:#fff;
    text-decoration:none;
    text-align:center;
    font-size:13px;
    margin:0 10px !important;
    background: #535661 !important;
}

.tms_header_button:hover {
    background: #3b3c43 !important;
}

.tms_header_button_icon {
    font-family: 'Material Icons', serif;
    vertical-align: middle;
    padding: 5px;
    border-radius: 50px;
    border: 3px solid;
    margin: -2px 7px 0 0;
    display:inline-block;
    font-size: 15px;
    width: 15px;
    font-weight: normal;
}

.tms_header_separator {
    height: 60px;
    border-right: 1px solid #fff;
    margin: auto 20px;
}

.tms_logoBlock {
    max-width:300px;
    border-radius:10px;
    padding-left:5px;
    margin-right:auto;
}

.tms_logo {
    width:100%;
    display:block;
}

.tms_header_controls_container {
    flex: 1;
    display: flex;
    padding: 10px 0;
}

.tms_weatherBlock, .tms_playbackControlsBlock {
    padding:10px 30px !important;
    font-weight:bold;
    font-family:'Lato', sans-serif;
    user-select: none;
}

.tms_playbackControlsBlock {
    text-align:center;
    display:none;
    width:60%;
}

#tms_playbackControls_date {
    font-weight:normal;
    font-size:12px;
}

#tms_playbackControls_time {
    font-size:30px;
    margin-bottom: 5px;

}

#tms_playbackControls_playPause {
    font-family: 'Material Icons', serif;
    cursor: pointer;
    display: inline-block;
    font-size: 20px;
    border-radius: 3px;
    padding: 4px;
    background: #535661;
    vertical-align: middle;
    user-select: none;
}

#tms_playbackControls_speed {
    background: #535661;
    color: #fff;
    vertical-align: middle;
    padding: 6px 5px;
}

.tms_playbackControls_seek {
    appearance: none;
    width: 100%;
    height: 20px;
    background: #0f5eee;
    outline: none;
    border-radius: 50px;
    padding: 0 5px;
    cursor: pointer;
    vertical-align: middle;
}

.tms_playbackControls_seek::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #FFFFFF;
}

#tms_menu_toggle {
    text-align: center;
    cursor: pointer;
    user-select: none;
    flex: 0;
    font-family: 'Material Icons';
    padding: 5px 15px;
}

@media (max-width: 1455px) {
    .tms_header
    {
        flex-wrap: wrap;
    }

    .tms_logoBlock
    {
        display:block;
        width:100%;
        max-width: none;
    }

    .tms_logo
    {
        max-width: 300px;
        margin: 0 auto;
    }

    .tms_header_controls_container
    {
        overflow-x: auto;
        flex-basis: 100% !important;
    }

    .tms_weatherBlock
    {
        flex: 1;
        padding: 10px !important;
    }

    .tms_playbackControlsBlock {
        width: 100%;
        padding: 0;
    }
}

@media (max-width: 900px) {
    .tms_logoBlock
    {
        margin-bottom:10px;
    }

    .tms_header_controls_container
    {
        display: none;
    }

    .tms_weatherBlock {
        padding: 5px 10px !important;
    }
}

@media (max-width: 700px) {
    .tms_header_button {
        width: 60px;
        padding:7px !important;
        border-radius: 10px !important;
    }

    .tms_header_button_icon {
        display: block;
        margin: 0 auto 5px auto;
        font-size: 25px;
        width: 25px;
    }
}

/* =============================
 * Beneath track styles
 * ============================= */
.tms_beneathTrack {
    width:100%;
    display:flex;
    flex-direction:row;
    margin-bottom:15px;
    align-items: flex-start;
    justify-content:flex-start;
}

.tms_beneathTrack_options {
    margin:10px 0 10px auto !important;
    font-weight:bold;
    font-family:'Lato', sans-serif;
    display:flex;
    flex-direction:row;
    justify-content: flex-end;
}

.tms_custom
{
    padding: 10px;
}

.tms_beneathTrack_status {
    min-width: 590px;
}

.material-symbols-outlined {
    font-size: 18px !important;
}

.tms_module_statusIcons_container {
    background: #484a54;
    border-radius: 4px;
    padding: 4px 3px 0 4px;
    margin-left: auto;
    display: block;
    margin-right:4px;
    min-width: 43px;
    text-align: center
}

@media (max-width: 900px) {
    .tms_beneathTrack
    {
        flex-wrap: wrap;
    }

    .tms_beneathTrack_status
    {
        order: 2;
        flex-basis: 100%;
        text-align:center;
        min-width: 0;
    }

    #tms_statusTable
    {
        margin: 0 auto;
    }

    #tms_statusTable td
    {
        text-align: left;
        user-select:none;
    }

    .tms_beneathTrack_options
    {
        width:100%;
    }

    .tms_custom
    {
        order:3;
    }

    #tms_beneathTrack_controls
    {
        display:flex;
        flex-basis: 100%;
        flex-wrap: wrap;
    }

    #tms_beneathTrack_controls div
    {
        flex: 1;
    }

    div:has(> .tms_module_statusIcons_container)
    {
        flex-wrap:wrap;
    }

    .tms_module_statusIcons_container
    {
        margin: 5px 0 0 0;
    }

    td {
        padding: 5px 0;
    }
}

/* =============================
 * Object styles
 * =============================*/
/* Cards, Blocks & buttons */
.tms_card {
    padding: 20px;
    background: #121318;
    border-radius: 10px;
    margin:5px;
}

.tms_card_map {
    width: 95%;
    background: #484a54;
    text-align: center;
    height:500px;
    min-height: 460px;
}

.tms_map_marker {
    background-image: url('../img/map_marker.png');
    background-size: cover;
    width: 40px;
    height: 40px;
    /*cursor: pointer;*/
}

.tms_map_marker_idle {
    background-image: url('../img/map_marker_idle.png');
    background-size: cover;
    width: 40px;
    height: 40px;
}

.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip, .mapboxgl-popup {
    background: transparent !important;
    pointer-events: none;
    border-top-color: transparent !important;
}

.mapboxgl-popup-content {
    text-align: center;
    color:#0f5eee;
    font-weight:bold;
    font-size:15px;
    box-shadow:none !important;
    font-family:'Lato', sans-serif;
    background: transparent !important;
    pointer-events: none !important;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

.tms_button{
    border-radius:50px;
    border:0;
    background:#0f5eee;
    padding:10px 40px;
    color:#fff;
    font-weight:bold;
    font-family:'Lato', sans-serif;
    font-size:17px;
    cursor:pointer;
    transition:0.2s background-color;
    margin:5px 5px;
    text-align:center;
    min-width: 120px;
    user-select:none;
}

.tms_button:hover{
    background:#397fff;
}

.tms_button_red{
    background: #d01515;
}

.tms_button_red:hover{
    background: #f54040;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Status Indicators */
.tms_statusIndicator{
    font-family:'Lato', sans-serif;
    font-weight:bold;
    border-radius:50px;
    background:#02b4ea;
    padding:5px 10px;
    color:#fff;
    text-align:center;
    margin:5px 5px;
    display:inline-block;
}

.tms_statusIndicator_green{
    background:#1db437;
}

.tms_statusIndicator_amber{
    background:#ffa500;
}

.tms_statusIndicator_red{
    background:#ff0000;
}

.tms_status_remarksPrimary{
    font-weight:bold;
    font-family:'Lato', sans-serif;
    color: #fff;
}

.tms_status_remarksSecondary{
    color: #7f7f7f;
    font-family:'Arial', sans-serif;
}

.tms_status_remarksSecondary a
{
    color: #7f7f7f;
}

.tms_status_detailsLink {
    text-decoration:underline;
    cursor:pointer;
}

.tms_system_status
{
    transition: background 0.5s;
}

.tms_system_status_icon {
    font-size: 55px;
    vertical-align: middle;
    font-family: 'Material Icons';
    display:block;
    margin: 0 auto 5px auto;
    color: #838383;
}

.tms_system_status_good
{
    background: #074c13;
}

.tms_system_status_warning
{
    background: #4c3207;
}

.tms_system_status_error
{
    background: #520a0a;
}

.tms_system_status_good .tms_system_status_icon
{
    color:#1db437;
}

.tms_system_status_warning .tms_system_status_icon
{
    color:#d8a308;
}

.tms_system_status_error .tms_system_status_icon
{
    color: #ff1818;
}

@media (max-width: 900px)
{
    .tms_system_status_icon {
        margin: 0;
        font-size: 35px;
        display: inline-block;
    }
}

/* Tables */
td{
    padding:5px 10px;
}

@media (max-width: 500px) {
    td:first-child {
        width: 1%;
        white-space: nowrap;
    }

    td{
        padding:5px 0 5px 10px;
    }
}

/* Input */
.tms_input{
    border-radius:5px;
    border:0;
    margin:5px 0 15px 0;
    padding:10px;
    background:#57555f;
    color:#fff;
    max-width:250px;
    width:90%;
    text-align:center;
    min-width:220px;
}

input[type="datetime-local"], select {
    border-radius: 5px;
    border: 1px solid #000;
    padding: 5px;
}

/* Module details dialog box */
.dialog_box_details {
    width:600px;
    font-family:Arial, sans-serif;
}

.dialog_box_details_title {
    font-size: 30px;
    font-weight: bold;
    font-family: 'Varela Round', sans-serif;
    color: #0e224d;
}

.dialog_box_details_redBox {
    background: #ff0000;
    color: #fff;
    border-radius: 5px;
    padding: 10px;
}

#dialog_box_details_extra {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.dialog_box_details_extra_block {
    border-radius: 5px;
    background: #e3e3e3;
    padding: 7px 15px;
    flex-grow: 1;
    flex-basis: 0;
}

.dialog_box_details_extra_block span {
    font-weight: bold;
    font-family: 'Varela', sans-serif;
}

/* Hide module dialog box */
.dialog_box_hideModule {
    padding:20px 30px;
    color:#000;
    font-family:'Lato', sans-serif;
}

.dialog_box_hideModule_title {
    font-size: 30px;
    font-weight: bold;
}

/* Manage modules dialog box */
.dialog_modules_row {
    width: 400px;
    max-width: 100%;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 0;
    display: flex;
    text-align: left;
    align-items: center;
}

.dialog_modules_serial {
    font-weight: bold;
    color: #89868c;
}

.dialog_modules_name {
    color: #3a474b;
    font-family: 'Varela Round', sans-serif;
    font-weight: bold;
    font-size: 25px;
}

.dialog_modules_ordering_arrows {
    font-family: 'Material Icons', serif;
    font-size: 23px;
    display: flex;
    flex-direction: column;
}

.dialog_modules_ordering_arrows > a {
    text-decoration:none;
}

.dialog_modules_button {
    color: #105ff0;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    text-align: center;
}

.dialog_modules_button > div {
    border-radius: 50px;
    background: #105ff0;
    color: #fff;
    font-family: 'Material Icons';
    padding: 8px;
    font-size: 18px;
    display: inline-block;
}

.dialog_modules_button_inactive {
    color: #808080 !important;
    cursor: not-allowed !important;
}

.dialog_modules_button_inactive > div {
    background: #808080 !important;
}

/* Loading dialog box */
.dialog_overlay {
    position: fixed;
    z-index: 2000;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.dialog_box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    display: block;
    text-align: center;
    background-color: #fff;
    border-radius: 20px;
    max-width: 95%;
    padding:20px 30px;
    color:#000;
    max-height: 90vh;
    overflow: auto;
}

.dialog_box_loading {
    padding: 0;
}

@media (max-width: 900px) {
    .dialog_box
    {
        max-height: 80vh;
    }

    #dialog_box_details_extra
    {
        flex-wrap:wrap;
    }
}

.dialog_loading_loader {
    width: 100px !important;
    height: 100px !important;
    margin: auto;
    overflow: hidden;
}

.dialog_loading_circular {
    animation: dialog_loading_rotate 2s linear infinite;
    height: 100px;
    position: relative;
    width: 100px;
}

.dialog_loading_path {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
    animation: dialog_loading_dash 1.5s ease-in-out infinite;
    stroke-linecap: round;
    stroke: #0f5eee;
}

#dialog_box_loading_info{
    margin-top: -25px;
    font-weight: bold;
    font-family: 'Lato', sans-serif;
    padding: 15px 20px;
}

@keyframes dialog_loading_rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dialog_loading_dash {
    0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124;
    }
}

/* TMS Scroller & scroll bar */
.tms_scroller, .tms_scroller_light {
    --sb-size: 16px;
    overflow: auto;
}

.tms_scroller {
    --sb-track-color: #2a2c35;
    --sb-thumb-color: #1d5dd2;
}

.tms_scroller_light {
    --sb-track-color: #ffffff;
    --sb-thumb-color: #9f9f9f;
}

.tms_scroller::-webkit-scrollbar, .tms_scroller_light::-webkit-scrollbar {
    width: var(--sb-size);
    left:-100px;
}

.tms_scroller::-webkit-scrollbar-track, .tms_scroller_light::-webkit-scrollbar-track {
    background: var(--sb-track-color);
    border-radius: 6px;
}

.tms_scroller::-webkit-scrollbar-thumb, .tms_scroller_light::-webkit-scrollbar-thumb {
    background: var(--sb-thumb-color);
    border-radius: 8px;
    border: 4px solid var(--sb-track-color);
}

@supports not selector(::-webkit-scrollbar) {
    .tms_scroller, .tms_scroller_light {
        scrollbar-color: var(--sb-thumb-color)
        var(--sb-track-color);
    }
}

/* Mobile handling */
.mobile_show { display:none; }

@media (max-width: 900px) {
    .mobile_hide { display:none !important; }
    .mobile_show { display:block; }

    #tms_statusTable .mobile_show {display: none;}
    #tms_statusTable .mobile_hide { display:inline-block !important; }
}

@media (max-width: 650px) {
    #tms_statusTable .mobile_hide { display:none !important; }
    #tms_statusTable .mobile_show { display:block; }
}