﻿/*
 * Copyright (c) 2026 Quantum Design Services Limited
 * 
 * Confidential and proprietary.
 * Unauthorised copying of this file is prohibited.
 */

/*                    */
/* Site wide styling. */
/*                    */

@font-face {
    font-family: 'poppins';
    src: url('/webfonts/PoppinsRegular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body, input, select, textarea, button {
    font-family: 'poppins', Arial, sans-serif !important;
}

html, body {
    height: 100%;
    margin: 0;
    background: white;
    font-family: poppins, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.page-root {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: 100vh;
    background: white;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: white;
    border-bottom: 1px solid #ddd;
}

.header-left {
    display: flex;
    align-items: center;
    padding: 8px;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-right {
    gap: 12px;
}

.company-logo {
    height: 75px;
    width: auto;
    display: block;
}

.app-footer {
    background: white;
    border-top: 1px solid #ddd;
}

.footer-content {
    max-width: 1400px;
    margin-left: 30px;
    margin-bottom: 5px;
    margin-top: 5px;
}

.app-main {
    padding: 16px;
    background: white;
    height: 100%;
    min-height: 0; /* ✅ CRITICAL */
    overflow: hidden; /* ✅ KEEP SCROLLING INSIDE CHILDREN */
}


.welcome-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-image {
    height: 75%; /* ✅ fills 75% of available height */
    width: auto;
    max-width: 100%;
    object-fit: contain;
    opacity: 50%;
}

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/*  QDSL Home page                                                                                                    */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

div.site-content {
    display: flex;
    width: 100%;
    height: 100%;
    gap: 10px;
    margin-top: 120px;
    padding-left: 15%;
    padding-right: 15%;
}

div.site-column {
    flex: 1;
    height: 50%;
    padding: 20px;
    border: 1px solid black;
}

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/*  Dashboard                                                                                                         */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

.dashboard-container {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-sizing: border-box;
}

.dashboard-toolbar {
    display: grid;
    grid-template-columns:
        minmax(160px, 180px)
        minmax(160px, 180px)
        minmax(160px, 200px)
        minmax(160px, 200px)
        auto;

    gap: 12px;
    background: #e9e9e9; /* ✅ only grey */
    padding: 15px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.toolbar-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

    .toolbar-field label {
        font-size: 16px;
        font-weight: 800;
        color: #555;
    }

    .toolbar-field select {
        height: 32px;
    }

    .toolbar-field .e-control,
    .toolbar-field .e-dropdownlist,
    .toolbar-field .e-multiselect {
        width: 100%;
    }

.toolbar-actions {
    display: flex;
    align-items: flex-end;
}

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/*  Dashboard tabs                                                                                                    */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

/* Dashboard layout */
.dashboard-container {
    height: 100%;
    display: grid;
    /* Toolbar and Tab rows. */
    grid-template-rows: auto 1fr;
    min-height: 0;
}

/* Tabs wrapper must stretch */
.dashboard-tabs {
    height: 100%;
    min-height: 0; /* IMPORTANT for grid/flex children */
    border: 1px solid #d0d0d0;
    border-radius: 8px;
}

    .dashboard-tabs .e-tab {
        height: 100%;
        display: flex;
        flex-direction: column;
    }

/* Hide raw external tab content */
.tab-content {
    display: none;
    height: 100%;
    width: 100%;
    padding: 5px;
}

/* Show only active tab */
.e-tab .e-content .e-item.e-active .tab-content {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 0;
}

/* Header area (buttons, etc.) */
.tab-header {
    display: flex;
    align-items: center;
    align-content: flex-start;
    margin-bottom: 10px;
}

    .tab-header .left {
        margin-left: 10px;
        margin-right: auto;
        display: flex;
        align-items: center;
        gap: 20px; /* spacing between items */
    }

    .tab-header .right {
        margin-left: auto;
    }

.tab-body {
    height: calc(100vh - 450px); /* or 100%, or calc(100vh - header) */
    min-height: 0; /* CRITICAL for overflow */
    padding-bottom: 25px;
}

.tab-footer {
    position: absolute;
    bottom: 5px; /* matches your padding */
    left: 5px;
    right: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid #ddd;
    padding-top: 6px;
    background: white; /* important if overlaying content */
}

.tab-header-label {
    font-size: 20px;
    font-weight: 700;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 4px;
}

/* Chart Tab specific. */

#chartWrapper {
    height: calc(100vh - 450px);
    width: 100%;
    display: flex; /* KEY */
    flex-direction: row; /* horizontal layout */
    gap: 5px; /* optional spacing */
}

#chartContainer {
    flex: 1; /* takes remaining width */
    height: 100%;
    min-width: 0; /* IMPORTANT: prevents overflow issues */
}

.e-grid .e-popup {
    position: fixed !important; /* breaks out of container */
    z-index: 10000 !important; /* keeps it above chart */
}

#gridContainer {
    width: 250px; /* fixed width (adjust as needed) */
    height: 100%;
    min-width: 360px; /* optional safety */
    overflow: hidden;
}

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/*  DropDowns                                                                                                         */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

/* Target DropDownList wrapper with correct class */
.e-input-group.e-control-wrapper.e-ddl {
    min-width: 170px;
    border-radius: 5px !important;
    overflow: hidden; /* clip corners */
    height: 30px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/*  Multiselects                                                                                                      */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

.e-multiselect.e-input-group {
    height: 30px;
    font-weight: 600;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    overflow: hidden; /* Ensures corners are clipped */
}

    .e-multiselect.e-input-group .e-multi-select-wrapper {
        background-color: white;
        height: 30px;
        min-width: 170px;
    }

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/* Date/Time pickers                                                                                                  */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

.e-datetime-wrapper.e-control-wrapper {
    height: 30px;
    min-width: 200px;
    max-width: 200px;
    margin-right: 10px;
    border-radius: 5px !important;
    overflow: hidden;
}

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/* Spinner overlay                                                                                                    */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

#spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.6);
    z-index: 9999;
    display: flex; /* Always flex for centering */
    justify-content: center;
    align-items: center;
}

    /* Hidden state */
    #spinner-overlay.hidden {
        display: none; /* Hide completely */
    }

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/* Heatmap                                                                                                            */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

.heatmap-header {
    display: flex;
    align-items: center;
}

.heatmap-resolution {
    display: flex;
    margin-left: 50px;
    margin-right: 20px;
    gap: 12px;
    font-size: 0.9rem;
}

    .heatmap-resolution label {
        display: flex;
        align-items: center;
        gap: 4px;
        cursor: pointer;
    }

#heatmap-scroller {
    margin-bottom: auto; /* ✅ pushes footer down */
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
}

/* HeatMap itself */
#heatmap-div {
    width: max-content;
    padding: 10px;
}

/* Footer stays at bottom */
.heatmap-footer {
    flex-shrink: 0;
    padding-top: 10px;
    border-top: 1px solid #ccc;
}

.popup-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}

    .popup-table th,
    .popup-table td {
        border: 1px solid #ccc;
        padding: 4px 6px;
        text-align: left;
    }

    .popup-table th {
        background: #444;
        color: white;
    }

.popup-content {
    min-width: 200px;
    max-width: 300px;
}

.custom-popup {
    position: absolute;
    background: #1f2937;
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    pointer-events: none;
    z-index: 1000;
    min-width: 150px;
}

/* Overlay background */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

/* Popup box */
.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    width: 400px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Close button (X) */
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
}

    .close:hover {
        color: red;
    }

/*--------------------------------------------------------------------------------------------------------------------*/
/*                                                                                                                    */
/* Login/out                                                                                                          */
/*                                                                                                                    */
/*--------------------------------------------------------------------------------------------------------------------*/

/* Specify width and alignment etc for login page. */
div.login-page {
    max-width: 1200px;
    align-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    width: 1200px;
}


/* LOGOUT button. */
.logout-button {
    height: 50px;
    border: none;
    color: white;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    background-color: #3f3030;
}

    .logout-button:hover:not(.active) {
        background-color: orange;
    }

/*--------------------------------------------------------------------------------------------------------------------*/

/*
 *
 * For borderless BUTTON with IMAGE.
 *
 */

.image-button {
    padding: 0;
    border: none;
    background: transparent;
    line-height: 0; /* Remove extra vertical space */
}

    .image-button img {
        display: block; /* Remove inline gap under image */
    }

    /* Custom square focus */
    .image-button:focus {
        outline: 2px solid #0078d4;
        /* Gap between image and outline */
        outline-offset: 2px;
    }

/*--------------------------------------------------------------------------------------------------------------------*/

a.sh {
    margin: 0;
    padding: 0;
    width: 140px;
}

p.sh {
    margin: 0;
    padding: 0;
    width: 140px;
}

img.sh {
    display: inline;
    margin: 0;
    padding: 5px;
    width: auto;
    height: 45px;
}

    img.sh:hover:not(.active) {
        background-color: orange;
    }

p.site-header {
    position: relative;
    top: 0;
    display: block;
    margin: 2px;
    padding: 0px;
    text-align: center;
    font-size: 30px;
    font-weight: 600;
    background-color: #3f3030;
}

/* For QDSL title. */
.red {
    color: red;
}

.green {
    color: green;
}

.orange {
    color: orange;
}

.blue {
    color: blue;
}


/* Use this for top level div in individual pages. */
div.site-page {
    position: relative;
    top: 20px;
}



/* Sticky footer styles
-------------------------------------------------- */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
    position: relative;
    min-height: 100%;
}

/*body {
    margin-bottom: 60px;
    font-family: 'Roboto', sans-serif;
}*/

/*for tab control*/
div.login-logout-tab div.card-header {
    padding: 0px 0px 12px 0px;
}

div.login-logout-tab ul.nav-tabs {
    margin: 0px 0px -12px 0px;
}

div.login-logout-tab li.nav-item {
    width: 50%;
}

div.login-logout-tab a.nav-link {
    font-size: 25px;
    color: #495057;
    text-align: center;
}

div.card-content {
    padding: 10px 20px;
}

/*login form*/
div.login-form-icon {
    text-align: center;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    white-space: nowrap;
    line-height: 60px; /* Vertically center the text there */
}
