/* ---- Site-Wide  ---- */

:root {
    --btn-panel-height: 53px;
    --mobile-nav-bar-height: 20px;
    --second-bar-width: 52px;
    --vh: 100vh; /* Default value for viewport height. is changed in js for responsive mobile layout*/
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: auto;
}

body {
    padding-top: 44px;
    padding-bottom: env(safe-area-inset-bottom);
    flex: 1;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    font-size: 14px;
}

/* ---- Top Bar  ---- */

.topBar {
    background-color: var(--sidebar-bg);
    display: flex;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
    height: 44px;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    /*gap: 10px;*/
}

.topBar-LHS-logo-container {
    width: 32px;
    height: 32px;
    max-height: 85%;
    background-image: var(--image-bg);
    background-repeat: no-repeat;
    background-size: contain;
    cursor: pointer;
    flex-shrink: 0;
    transform: translateY(3px);
    margin-left: 10px !important;
    margin-right: 10px !important;
}

.topBar-LHS-buttons {
    display: flex;
    flex-grow: 1;
}

.topBar-RHS-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    margin-right: 8px;
}

.topBar-center {
    display: flex;
    align-items: center;
    justify-content: center; /* Keeps buttons in the center */
    flex-grow: 1;
    position: relative;
}

/* ---- Top Bar Buttons  ---- */

.btn-topbar {
    /*color: var(--color-sf-on-surface);*/
    color: var(--text-color);
    background-color: var(--secondary-bg); /* Light grey background */
    border: none; /* Remove default border */
    border-radius: 8px; /* Slightly rounded corners */
    /*padding: 5px 16px;*/ /* Padding for a comfortable size */
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif; /* Modern font */
    font-size: 14px; /* Adjust font size as needed */
    font-weight: 500; /* Make the font bold */
    cursor: pointer; /* Pointer cursor on hover */
    transition: background-color 0.3s, color 0.3s; /* Smooth hover transitions */
    display: flex inline-flex; /* Allows for vertical alignment of icon and text */
    align-items: center; /* Center-aligns icon and text vertically */
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    height: 32px;
    min-width: 32px;
    margin-right: 5px;
}

.btn-topbar .e-icons {
    line-height: 2;
}


.btn-topbar-dd {
    color: var(--color-sf-on-surface) !important;
    background-color: var(--text-color) !important;
    border: none !important;
    border-radius: 10px !important;
    padding: 8px 16px !important;
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.3s, color 0.3s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    height: 36px !important;
    margin-right: 5px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* Subtle shadow for nicer look */
}

/* Hover Effect */
.btn-topbar:hover {
    background-color: var(--secondary-bg); /* Slightly darker grey on hover */
    color: var(--text-color); /* Darker blue text on hover */
}

/* Active State */
.btn-topbar:active {
    background-color: var(--secondary-bg) !important; /* Even darker grey when clicked */
    color: var(--text-color); /* Even darker blue text when clicked */
}

/* Focus Outline */
.btn-topbar:focus {
    outline: none; /* Remove default outline */
    box-shadow: 0 0 0 3px rgba(14, 48, 85, 0.3); /* Custom focus ring */
    background-color: var(--secondary-bg) !important; /* Ensure light grey background on focus */
    color: var(--text-color) !important; /* Inherit text color to prevent changes */
}

@keyframes button-spinner-animation {
    0% {
        transform: rotate(0deg);
    }

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

.buttonSpinner {
    border: 2px solid currentColor;
    border-style: dotted;
    border-radius: 50%;
    border-top-color: transparent;
    border-bottom-color: transparent;
    height: 16px;
    width: 16px;
    animation: button-spinner-animation 1.3s linear infinite;
}

/* ---- Second Bar & Main Content ---- */

.layout-container {
    display: flex;
    flex-direction: row;
    height: 100%; /* Full height for both second-bar and main-container */
    flex: 1;
    background-color: var(--sidebar-bg);
    overflow: hidden;
}

.second-bar {
    width: var(--second-bar-width); /* Desktop width */
    background-color: var(--sidebar-bg);
    flex-shrink: 0; /* Prevent shrinking */
    position: relative;
}

.main-container {
    display: flex;
    flex-direction: column;
    flex: 1; /* Ensures the main content takes up the remaining space */
    overflow-y: hidden; /* Allow scrolling if content overflows */
    border-top-left-radius: 8px;
    overflow: hidden;
    background: var(--text-color);
}

.main-container #splitter,
.main-container #splitter #left-pane {
    border-top-left-radius: 8px;
    overflow: hidden;
}

/* ---- Alert Popup ---- */

#alert-popup {
    width: 90%; /* Responsive width */
    max-width: 400px; /* Maximum width */
    margin: auto; /* Center the dialog */
    text-align: center; /* Center text */
}

#alert-popup .e-dialog {
    background-color: var(--text-color); /* White background */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}

#alert-popup .e-dlg-header {
    font-size: 1.5em; /* Larger header font size */
    font-weight: bold; /* Bold header */
    color: #333; /* Darker text color */
    font-family: Arial, sans-serif; /* Updated font */
}

#alert-popup .e-dlg-content {
    margin-top: 5px; /* Reduced space between header and content */
    font-size: 1.2em; /* Larger content font size */
    color: #666; /* Lighter text color */
    font-family: Arial, sans-serif; /* Updated font */
}

#alert-popup .e-footer-content {
    padding: 20px;
}

#alert-popup .e-footer-content .e-primary {
    color: #4d4d4d;
    background-color: #eef1f2;
    border-color: #979393;
    border-radius: 0.20rem;
    font-family: Tahoma;
    font-size: 13px;
    line-height: 1.3;
    max-width: 100px;
    height: 31px;
    text-transform: none; /* Ensure text is not capitalized */
}

#alert-popup .e-footer-content .e-primary:hover {
    color: #000;
    background-color: #eef1f2;
    border-color: #000;
    opacity: 1;
}

#alert-popup img {
    width: 100px; /* Adjust width */
    height: 100px; /* Adjust height */
    margin-bottom: 20px; /* Space between image and text */
}

/* ---- WebClient & Splitter panes ---- */

.split {
    display: flex;
    flex-direction: row;
}

.gutter {
    background-color: #eee;
    background-repeat: no-repeat;
    background-position: 50%;
}

.gutter.gutter-horizontal {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
    cursor: col-resize;
}

/* ----  ---- */

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    position: relative;
    flex: 0 1 40%;
    min-width: 200px;
    max-width: 600px;
    height: 32px;
    margin: 0 5px 0 0;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--secondary-bg);
    border-radius: 8px;
    padding: 1px 0px 1px 16px;
    width: 100%;
    height: 32px;
}

.search-input {
    flex: 1;
    border: none !important;
    background: transparent;
    padding: 3px;
    font-size: 16px;
}

.search-input::placeholder {
    color: var(--text-color);
}

.search-icon, .clear-icon {
    font-size: 16px;
    color: var(--text-color);
    margin: 0 8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.search-icon:active, .clear-icon:active {
    transform: scale(0.9);
    opacity: 0.7;
}

/*overriding syncfusion input fieldset styles*/
.e-input.search-input {
    background-color: var(--secondary-bg) !important;
    color: var(--text-color);
}

.e-input.search-input::placeholder {
    color: var(--text-color);
}

.e-grid .e-filtered::before {
    color: var(--secondary-bg) !important;
}

input.e-input, textarea.e-input {
    min-height: 22px;
}

/*dropdown for scheduler*/
.topBar-dropdown-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 220px;
    max-width: 220px;
    width: 100%;
    flex-grow: 1;
    background-color: white;
    border-radius: 4px;
    margin-left: 80px;
}

.topBar-dropdown-container * {
    padding-top: 6px;
    padding-left: 6px;
}

#bottomBar {
    display: none;
}

/*mobile screen*/
@media (max-width: 768px) {

    .layout-container {
        flex-direction: column;
    }

    .second-bar {
        position: fixed;
        top: 0;
        left: 0;
        width: auto;
        height: auto;
        order: initial;
        z-index: 1050;
    }

    .main-container {
        order: 1;
        border-top-left-radius: 0;
    }
    body:not(.page-scheduler) .main-container {
        padding-bottom: 44px !important;
        overflow: auto;
    }

    .search-bar {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        position: relative;
        left: auto;
    }

    .search-wrapper,
    .search-input {
        min-width: 0;
        width: 100%;
    }

    .search-icon, .clear-icon {
        font-size: 14px;
        color: var(--text-color);
        margin: 0 3px;
        cursor: pointer;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .search-input::placeholder {
        font-size: 12px;
    }

    .topBar {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0;
    }

    .topBar-LHS-logo-container {
        display: flex;
        flex: 0 0 auto;
        max-width: 32px;
    }

    .topBar-center {
        display: flex;
        align-items: center;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        justify-content: left;
    }

    .search-bar {
        position: relative;
        left: auto;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        max-width: 50%;
    }

    .topBar-LHS-buttons {
        display: flex;
        flex: 0 0 auto;
        justify-content: flex-end !important;
        white-space: nowrap;
    }

    body:not(.page-scheduler) .topBar-dropdown-container {
        flex: 0 0 auto;
        max-width: 0;
        overflow: hidden;
    }

    body.page-scheduler .topBar-dropdown-container {
        margin-left: 0;
        max-width: 150px !important;
        min-width: 100px !important;
    }

    .topBar-RHS-button-container {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        flex: 0 0 auto;
        min-width: 44px;
        overflow: visible;
    }

    .e-downtail, .e-tail {
        display: none !important;
    }

    body:not(.page-scheduler) .topBar-dropdown-container {
        display: none;
    }

    body.page-scheduler .topBar-center {
        margin-right: 15px !important;
    }

    body.page-scheduler .topBar-RHS-button-container {
        display: none !important;
    }

    /*show hamburger*/
    .second-bar .e-sidebar {
        position: fixed !important;
        top: 60px !important;
        left: 0;
        height: calc(100vh - 60px) !important;
        z-index: 1050;
        overflow: hidden;
    }

    .second-bar .e-sidebar.mobile-open {
        left: 0;
    }

    .second-bar .sidebar-item:hover .submenu {
        display: none;
    }

    .second-bar .sidebar-item .submenu {
        position: static;
        background: #444;
        display: none;
    }

    .second-bar .sidebar-item.active .submenu {
        display: block;
    }

    #sidebar {
        display: none;
    }

    /* Bottom bar */
    #bottomBar {
        background-color: var(--sidebar-bg);
        display: none;
        align-items: center;
        justify-content: center;
        padding: 5px;
        box-sizing: border-box;
        height: 44px;
        width: 100%;
        position: fixed;
        bottom: 0;
    }

    .e-appbar .e-btn.e-inherit {
        color: var(--text-color);
    }
    .e-btn.e-inherit:hover, .e-btn.e-inherit.e-hover, .e-btn.e-inherit:hover::before,
    .e-btn.e-inherit:focus, .e-btn.e-inherit.e-focus, .e-btn.e-inherit:focus::before,
    .e-btn.e-inherit:active, .e-btn.e-inherit.e-active, .e-btn.e-inherit:active::before {
        background-color: var(--secondary-bg) !important;
        color: var(--text-color) !important;
    }


    /* New hamburger */
    .phone-second-bar {
        position: fixed;
        top: 44px !important;
        right: 0;
        height: 100%;
        width: 280px;
        background-color: var(--sidebar-bg) !important;
        box-shadow: -6px 0 16px rgba(0,0,0,0.15);
        transform: translateX(100%);
        transition: transform 180ms ease;
        overflow: auto;
        z-index: 999;
    }

    #phoneSidebar {
        width: 90%;
        left: 5px;
        right: 10px;
    }

    .phone-second-bar .e-treeview {
        background: transparent;
    }

    .phone-second-bar .e-treeview .e-list-item {
        position: relative;
        background: transparent !important;
    }

    .phone-second-bar .e-treeview .e-list-item > .e-fullrow {
        position: absolute !important;
        inset: 0 !important;
        background: transparent !important;
        border-radius: 8px;
        border-color: var(--sidebar-bg);
        height: 50px;
        right: 17px !important;
        z-index: 0;
        align-items: center;
    }

    .phone-second-bar .e-treeview .e-list-item > .e-text-content {
        position: relative;
        z-index: 1;
        padding: 10px 14px !important;
        border-radius: 8px;
        border-color: var(--sidebar-bg);
    }

    .phone-second-bar .e-list-text,
    .phone-second-bar .e-icons,
    .phone-second-bar .e-list-icon,
    .phone-second-bar .e-icon-expandable,
    .phone-second-bar .e-icon-collapsible {
        color: var(--text-color) !important;
    }

    .phone-second-bar .phone-tree-parent.e-active > .e-fullrow,
    .phone-second-bar .phone-tree-parent.e-selected > .e-fullrow {
        background-color: var(--secondary-bg) !important;
        border: none !important;
        padding: 0 !important;
        right: 20px !important;
    }

    .phone-second-bar .phone-tree-parent:hover > .e-fullrow {
        background: var(--secondary-bg) !important;
    }

    .phone-second-bar .submenu-item:hover > .e-fullrow {
        background-color: var(--secondary-bg) !important;
    }

    .phone-second-bar .submenu-item.e-active > .e-fullrow,
    .phone-second-bar .submenu-item.e-selected > .e-fullrow {
        background: var(--secondary-bg) !important;
        border: none !important;
    }

    .phone-second-bar .e-treeview .e-focused {
        outline: none;
    }

}

/*sidebar*/
.second-bar .e-sidebar {
    position: absolute;
    top: 10px;
    left: 0;
    width: var(--second-bar-width);
    bottom: 0;
    height: 100% !important;
    background-color: var(--sidebar-bg);
    color: var(--text-color);
    overflow: visible;
}

.second-bar .e-list {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
    height: 100%;
    width: var(--second-bar-width);
}

.second-bar .sidebar-item {
    margin-top: 3px;
    padding: 10px 0;
    text-align: center;
    cursor: pointer;
    position: relative;
    background: transparent;
}

.second-bar .sidebar-item .e-icons {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 29px;
    margin: auto;
    color: var(--text-color);
    align-items: center;
    justify-content: center;
    display: inline-flex !important;
    line-height: 1 !important;
    padding: 0 !important;
    -webkit-text-stroke: 0.3px var(--sidebar-bg);
    font-weight: 300;
}

.second-bar .sidebar-item:hover {
    background: transparent;
    border-radius: 8px;
}

.second-bar .sidebar-item:hover .e-icons {
    background-color: var(--secondary-bg);
}

.second-bar .sidebar-item.active .e-icons {
    background-color: var(--secondary-bg);
}

/* Submenu hidden by default */
.second-bar .sidebar-item .submenu {
    font-size: 15px;
    position: absolute;
    left: 48px;
    top: 0;
    background-color: var(--sidebar-bg);
    list-style: none;
    margin: 0 7px;
    padding: 5px 0;
    min-width: 150px;
    border-radius: 8px;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.second-bar .sidebar-item .submenu::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 0;
    width: 30px;
    height: 100%;
    background: transparent;
}

.second-bar .sidebar-item .submenu .submenu-title {
    font-size: 17px;
    font-weight: bold;
    pointer-events: none;
    cursor: default;
}

.second-bar .sidebar-item .submenu .submenu-title a:hover {
    background-color: inherit;
    transition: ease-out 2s;
}

.second-bar .sidebar-item .submenu li a {
    color: var(--text-color);
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    text-align: left !important;
    margin: 5px;
    font-family: 'Roboto', Tahoma, Geneva, Verdana, sans-serif;
}

.second-bar .sidebar-item .submenu li a:hover {
    background-color: var(--secondary-bg);
    border-radius: 8px;
}

/* Show submenu on hover */
.second-bar .sidebar-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.second-bar .sidebar-item.bottom-item {
    position: absolute;
    bottom: 10px;
    width: 100%;
}

.second-bar .sidebar-item.bottom-item .submenu {
    top: auto;
    bottom: 0;
    left: 48px;
    overflow-y: auto;
}

.second-bar .sidebar-item.bottom-item .submenu::before {
    content: "";
    position: absolute;
    left: -18px;
    top: 0;
    width: 30px;
    height: 100%;
    background: transparent;
}
