﻿@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');



html, body, .main, .page {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.embedded-iframe {
    display: block;
    width: 100%;
    height: 100vh;
    border: none;
    margin: 0;
    padding: 0;
}

a, .btn-link {
    color: #0366d6;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

app {
    position: relative;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 3.5rem;
    display: flex;
    align-items: center;
}

.main {
    flex: 1;
}

.main .top-row {
    background-color: #f7f7f7;
    border-bottom: 1px solid #d6d5d5;
    justify-content: flex-end;
}

.main .top-row > a, .main .top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
}

.main .top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar {
    background-image: linear-gradient(180deg, #0b3158 0%, #a3b1c0 70%);
}

    .sidebar .top-row {
        background-color: transparent;
    }


.sidebar .navbar-brand {
    font-size: 1.1rem;
}

.sidebar .oi {
    width: 2rem;
    font-size: 1.1rem;
    vertical-align: text-top;
    top: -2px;
}

.sidebar .nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.sidebar .nav-item:first-of-type {
    padding-top: 1rem;
}

.sidebar .nav-item:last-of-type {
    padding-bottom: 1rem;
}

.sidebar .nav-item a {
    color: #d7d7d7;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
}

.sidebar .nav-item a.active {
    background-color: rgba(255,255,255,0.25);
    color: white;
}

.sidebar .nav-item a:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
}

.content {
    padding-top: 1.1rem;
}


.navbar-toggler {
    background-color: rgba(255, 255, 255, 0.1);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

@media (max-width: 767.98px) {
    .main .top-row:not(.auth) {
        display: none;
    }

    .main .top-row.auth {
        justify-content: space-between;
    }

    .main .top-row a, .main .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 840px) {
    app {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .main .top-row {
        position: sticky;
        top: 0;
    }
    .main > div {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .sidebar .collapse {
        /* Never collapse the sidebar for wide screens */
        display: block;
    }
}






.log-lists-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    width: 100%;
    gap: 20px; /* Space between columns */
    margin-bottom: 20px;
}

.log-list-column {
    flex: 0 0 auto; /* Don't grow or shrink */
    width: 550px; /* Fixed width */
    max-width: 550px;
}

.log-list-container {
    max-height: 12em;
    overflow-y: auto;
    margin-bottom: 1em;
    width: 100%; /* Take full width of parent */
    display: block;
    padding-left: 1.2em;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.log-list-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 0 5px;
}

.log-list-container li {
    position: relative;
    padding: 4px 0 4px 18px;
    border-bottom: 1px solid #f0f0f0;
}

.log-list-container li:last-child {
    border-bottom: none;
}

.log-list-container li:before {
    content: "📄";
    position: absolute;
    left: 0;
    opacity: 0.8;
    font-size: 14px;
}

.log-list-container li:hover {
    background-color: #f0f0f0;
}

.log-list-column p a {
    display: inline-block;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.log-list-column p a:hover {
    background-color: #e5e5e5;
    text-decoration: none;
}

/* Style for the log titles */
.log-title {
    margin-bottom: 10px;
    font-weight: 600;
}

/* Main log content area */
.log-content {
    width: 100%; /* Take full width of parent */
    max-width: 1120px;
    height: 100%; /* Fill available space in grid */
    min-height: 200px; /* Minimum height */
    overflow-y: auto;
    overflow-x: scroll;
    white-space: pre;
    word-break: keep-all;
    word-wrap: normal;
    padding: 1em;
    margin: 0;
    font-size: 1rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Add styling for the pre element */
pre.log-content {
    margin: 0; /* Remove default margins */
    background-color: #f5f5f5; /* Light background for better readability */
    border-radius: 4px; /* Rounded corners */
}

    /* Style for the code element inside pre */
    pre.log-content code {
        display: inline-block;
        min-width: 100%; /* Ensure horizontal scrolling works properly */
        font-family: Consolas, Monaco, 'Courier New', monospace; /* Better monospace font */
    }

/* Make the container use CSS Grid for better layout control */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    width: 100%;
    max-width: 1500px;
    margin: 0; /* Simplified from margin: 0 0 1px 0 */
    /* Grid layout */
    display: grid;
    grid-template-rows: auto auto 1fr; /* Title, log-lists, content (fills remaining space) */
    grid-gap: 20px;
    height: calc(100vh - 60px); /* Reduced from 120px to 60px for less bottom space */
}

/* Ensure the log content section takes the available space */
.mt-4 {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow shrinking in grid */
}

    .mt-4 h4 {
        font-weight: 600;
        color: #1b6ec2;
        border-bottom: 1px solid #eee;
        padding-bottom: 6px;
        margin-bottom: 12px;
        flex-shrink: 0; /* Don't shrink the title */
    }

/* Style for the pre element */
pre.log-content {
    margin: 0; /* Remove default margins */
}

    /* Style for the code element inside pre */
    pre.log-content code {
        display: inline-block;
        min-width: 100%; /* Ensure horizontal scrolling works properly */
        font-family: Consolas, Monaco, 'Courier New', monospace; /* Better monospace font */
        background-image: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.02) 50%);
        background-size: 100% 40px; /* Adjust based on your line height */
        background-position: 0 1px;
    }


/* Scrollbar styling for better visibility */
.log-content::-webkit-scrollbar {
    width: 10px; /* Vertical scrollbar width */
    height: 10px; /* Horizontal scrollbar height */
}

.log-content::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

    .log-content::-webkit-scrollbar-thumb:hover {
        background-color: #666; /* Darker on hover */
    }

.log-content::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

/* Corner where scrollbars meet */
.log-content::-webkit-scrollbar-corner {
    background-color: #f5f5f5;
}

/* More prominent log file title */
.mt-4 h4 {
    font-weight: 600;
    color: #1b6ec2; /* Match your primary color */
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

/* for highlighter.js */
pre code.language-log .hljs-number,
pre code.language-log .hljs-literal,
pre code.language-log .hljs-variable,
pre code.language-log .hljs-template-variable,
pre code.language-log .hljs-tag .hljs-attr {
    color: #d14 !important; /* Red color for numbers */
}

pre code.language-log .hljs-string,
pre code.language-log .hljs-doctag {
    color: #008080 !important; /* Teal color for strings */
}

pre code.language-log .hljs-section,
pre code.language-log .hljs-name,
pre code.language-log .hljs-selector-tag,
pre code.language-log .hljs-deletion,
pre code.language-log .hljs-subst {
    color: #900 !important; /* Dark red color for sections */
}

/* Timestamps in logs */
pre code.language-log .hljs-comment {
    color: #998 !important;
    font-style: italic;
}





/* do not apply padding to pages with iframes (embedded pages and swagger) */
body:not(.embedded-page):not(.swagger-page) .main > div {
    padding-left: 2rem !important;
    padding-right: 1.5rem !important;
    padding-top: 1.1rem !important;
}

/* Target the main container and all parent elements for embedded iframe pages */
body.embedded-page,
.embedded-page .page,
.embedded-page .main,
.embedded-page .content,
.embedded-page .main > div,
.embedded-root {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
}

/* Target the main container and all parent elements for swagger */
body.swagger-page,
.swagger-page .page,
.swagger-page .main,
.swagger-page .content,
.swagger-page .main > div,
.swagger-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
}

/* the above two blocks cause a bug where scrolling is disabled after switching from an iframe page to a normal page. (due to the overflow:hidden being applied to entire page)
     the two blocks below fix it, but also cause some incorrect padding.  another fix was added with the javascript removeBodyPageClasses function (see _host.cshtml and mainlayout.razor)
    leaving this other fix as reference incase needed in future. 
 */

/*.embedded-root {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    height: 100vh;
}

.swagger-container {
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    height: 100vh;
}*/

/* Specifically override the media query rule that adds padding */
@media (min-width: 768px) {
    .embedded-page .main > div,
    .swagger-page .main > div {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }
}
/* Simulation mode banner (MainLayout) - shown on every page while the firmware
   is initialized with SimulationMode=true. */
.simulation-banner {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: repeating-linear-gradient(45deg, #ffc107 0 14px, #e0a800 14px 28px);
    color: #212529;
    font-weight: 700;
    letter-spacing: .12em;
    text-align: center;
    padding: .3rem .5rem;
    font-size: .9rem;
}

/* Hide the banner on iframe-embedded pages; they manage the full viewport themselves. */
.embedded-page .simulation-banner,
.swagger-page .simulation-banner {
    display: none;
}
