@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #101010;
    color: #FFFFFF;
}

:root {
    --accent-orange: #ff7a33;
    --accent-blue: #3aa6ff;
}

a, .btn-link {
    color: #03b6e6;
}

/* Heading defaults */
h2 {
    font-size: 1.75em;
    line-height: 1.5em;
    color: var(--accent-orange);
}

h3 {
    font-size: 1.4em;
    line-height: 1.5em;
    color: var(--accent-blue);
}

.content h3 {
    color: var(--accent-blue) !important;
}

/* Modern button baseline */
.btn,
button.btn,
input[type="button"],
input[type="submit"] {
    border-radius: 0.25rem;
    border-width: 1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
    transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, transform .1s ease-in-out;
}

.btn:focus,
button.btn:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
.btn:focus-visible,
button.btn:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible {
    outline: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

.btn:active:not(:disabled),
button.btn:active:not(:disabled),
input[type="button"]:active:not(:disabled),
input[type="submit"]:active:not(:disabled),
.btn-default:active:not(:disabled),
.btn-primary:active:not(:disabled),
.btn-noborder:active:not(:disabled),
.btn-page:active:not(:disabled) {
    transform: translate(1px, 1px) !important;
    box-shadow: none !important;
    filter: brightness(0.90) !important;
}

.btn-primary {
    color: #fff;
    background-color: #ff671b;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.08) 100%);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-primary:hover {
    color: #fff;
    background-color: #ff7a33;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(0,0,0,0.10) 100%);
    border-color: rgba(255, 255, 255, 0.18);
}

.btn-default {
    color: #fff;
    background-color: #2980b9;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.10) 100%);
    border-color: rgba(255, 255, 255, 0.12);
}

.btn-default:hover {
    color: #fff;
    background-color: #2f8fce;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(0,0,0,0.12) 100%);
    border-color: rgba(255, 255, 255, 0.18);
}


button:disabled,
button[disabled],
button:disabled:hover {
    border: 1px solid #888888;
    color: #bbbbbb;
    background-color: #555555;
    border-color: #777777;
    box-shadow: none;
}


.btn-page {
    color: #fff;
    background-color: #1b6ec2;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.10) 100%);
    border-color: rgba(255, 255, 255, 0.12);
    width: 80px;
}

.btn-noborder {
    color: #fff;
    background-color: #555555;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.10) 100%);
    border-color: #777777;
}

.btn-noborder:hover {
    color: #fff;
    background-color: #666666;
    background-image: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.12) 100%);
    border-color: #888888;
}

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: #101010;
        border-bottom: 0px solid #565555;
        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, rgb(20, 20, 20) 0%, #303030 70%);
}

    .sidebar .top-row {
        background-color: rgba(0,0,0,0.4);
    }

    .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;
    }
}

.right {
    float: right;
}

.left {
    float: left;
}

select {
    margin: 0;
}

/* Dropdowns: match custom control styling (dark theme, consistent border/focus) */
select,
.form-select {
    color: #495057;
    background-color: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    height: calc(1.5em + .5rem + 2px);
    line-height: 1.5;
    padding: .25rem 2rem .25rem .75rem;
}

select:hover,
.form-select:hover {
    background-color: #ffffff;
    border-color: #bfc9d4;
}

select:focus,
.form-select:focus {
    outline: 0;
    border-color: #ff671b;
    box-shadow: 0 0 0 0.2rem rgba(255, 103, 27, 0.25);
}

select:disabled,
.form-select:disabled {
    color: #6c757d;
    background-color: #e9ecef;
    border-color: #ced4da;
    opacity: 1;
}

/* Checkbox styling (use app's blue accent) */
input[type="checkbox"] {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: #2980b9;
    vertical-align: middle;
}

input[type="checkbox"]:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 1px rgba(41, 128, 185, 0.65);
}

/* Text and number input styling - consistent width */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="url"],
input[type="email"],
input[type="time"],
input[type="date"],
.form-control {
    max-width: 400px;
    height: calc(1.5em + .5rem + 2px);
    padding: .25rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="url"]:focus,
input[type="email"]:focus,
input[type="time"]:focus,
input[type="date"]:focus,
.form-control:focus {
    outline: 0;
    border-color: #ff671b;
    box-shadow: 0 0 0 0.2rem rgba(255, 103, 27, 0.25);
}

/* Input inside form-group can be full width of max-width */
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group .form-control {
    width: 100%;
}

/* Number inputs should be narrower by default */
input[type="number"],
input[type="number"].form-control {
    max-width: 150px;
}

/* Wide input for file paths and URLs - double width */
input.input-wide,
.form-control-wide,
input[type="text"].input-wide,
input[type="url"].input-wide {
    max-width: 800px;
    width: 100%;
}

/* Narrow input for small numbers like ports, counts */
input.input-narrow,
input[type="number"].input-narrow {
    max-width: 100px;
}

/* ==========================================
   HORIZONTAL FORM LAYOUT - Aligned labels and controls
   ========================================== */

/* Container for horizontal form layout */
.form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Horizontal form group - label on left, control on right */
.form-group-horizontal {
    display: grid;
    grid-template-columns: 200px 1fr;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

/* Label styling in horizontal layout */
.form-group-horizontal > label {
    text-align: left;
    margin-bottom: 0;
    white-space: nowrap;
}

/* For checkbox rows - align checkbox with label on left */
.form-group-horizontal.checkbox-row {
    grid-template-columns: 200px auto 1fr;
}

.form-group-horizontal.checkbox-row > input[type="checkbox"] {
    justify-self: end;
}

/* Wider label column variant */
.form-group-horizontal.label-wide {
    grid-template-columns: 280px 1fr;
}

/* Narrow label column variant */
.form-group-horizontal.label-narrow {
    grid-template-columns: 150px 1fr;
}

/* Helper text / example text below control */
.form-group-horizontal .form-text {
    grid-column: 2;
    font-size: 0.875rem;
    color: #6c757d;
}

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

    .sidebar {
        width: 200px;
        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;
    }
}

.form-control-shorter {
    display: block;
    width: 100%;
    max-width: 700px;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out
}

h1 {
    font-size: 1.75em;
    line-height: 1.5em;
    color: #ff671b
}

h2 {
    font-size: 1.75em;
    line-height: 1.5em;
    color: #ff671b
}

h3 { 
    font-size: 1.4em;
    line-height: 1.5em;
    color: #2980b9
}

h4 {
    font-size: 1.2em;
    line-height: 1.5em;
    color: #ffffff
}

table {
    width: 100%;
    margin: 0 0 1.25rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.02);
}

table thead th {
    color: #ffffff;
    font-size: 0.9em;
    font-weight: 700;
    padding: 0.75rem 0.75rem;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

table tbody td {
    padding: 0.6rem 0.75rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

table tbody tr:nth-child(2n + 1) {
    background-color: rgba(255, 255, 255, 0.03);
}

table tbody tr:hover {
    background-color: rgba(255, 103, 27, 0.06);
}

table tbody tr:last-child td {
    border-bottom: 0;
}

table tfoot {
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

/* Optional table variants */
table.table-compact tbody td,
table.table-compact thead th {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

table.table-nohover tbody tr:hover {
    background-color: inherit;
}

table.table-nozebra tbody tr:nth-child(2n + 1) {
    background-color: transparent;
}

table.alt {
    border-collapse: separate;
}

table.alt tbody tr td {
    border: solid 1px rgba(144, 144, 144, 0.25);
    border-left-width: 0;
    border-top-width: 0;
}

table.alt tbody tr td:first-child {
    border-left-width: 1px;
}

table.alt tbody tr:first-child td {
    border-top-width: 1px;
}

table.alt thead {
    border-bottom: 0;
}

table.alt tfoot {
    border-top: 0;
}

.btn-fixedwidth {
    min-width: 120px;
    text-align: center;
}

/* Consistent button sizing for OK/Cancel and all action buttons */
.btn-primary,
.btn-secondary,
.btn-default,
.btn-noborder {
    min-width: 100px;
    text-align: center;
}

/* Button spacing utility - handles buttons next to each other */
/* Note: Using margin-left for inline buttons; use flex with gap for consistent spacing */
.btn + .btn,
.btn + label.btn,
label.btn + .btn,
label.btn + label.btn {
    margin-left: 4px;
}

/* Button after select/dropdown spacing */
select + .btn,
select + label.btn,
.form-select + .btn,
.form-select + label.btn {
    margin-left: 8px;
}

/* Ensure label buttons align vertically with regular buttons */
label.btn {
    vertical-align: middle;
    display: inline-block;
    margin-bottom: 0;
    margin-left: 0;
}

/* Flexbox button groups - consistent spacing */
.btn-group-flex {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Form group spacing - adds margin between form groups including dropdowns */
.form-group {
    margin-bottom: 0.75rem;
}

/* Dropdown spacing in form groups */
.form-group select,
.form-group .form-select {
    margin-bottom: 0.25rem;
}

#tableItem tr:hover {
    background-color: #444;
}

/* Keep context menus within the viewport and scroll if needed */
.blazor-context-menu,
.blazor-context-submenu {
    max-height: calc(100vh - 10px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Tooltip wrapper should be inline so it sits next to labels */
.tooltip-wrapper {
    display: inline;
}






