@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

/* ── S3 Browser modal (Original) ────────────────────────────────────────────*/
.blazored-modal:has(.s3-browser-modal) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.s3-browser-modal {
    min-height: 420px;
    box-sizing: border-box;
    overflow: hidden;
}

.s3-browser-modal .mud-table table {
    table-layout: fixed;
    width: 100%;
}

.s3-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    min-height: 36px;
    padding: 0 4px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
}

.s3-row-selected td {
    background: rgba(var(--mud-palette-primary-rgb), 0.18) !important;
}

/* ── S3 Browser modal V2 (New Split-Panel Layout) ──────────────────────────*/
.blazored-modal:has(.s3-browser-modal-v2) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
}

.s3-browser-modal-v2 {
    min-height: 500px;
    box-sizing: border-box;
    overflow: hidden;
}

.s3-split-container {
    display: flex;
    gap: 12px;
    height: 100%;
}

.s3-bucket-panel {
    width: 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
}

.s3-bucket-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 400px;
    padding: 4px;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
}

.s3-bucket-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
}

.s3-bucket-item:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(2px);
}

.s3-bucket-item.active {
    background: rgba(33, 150, 243, 0.25);
    border-color: rgba(33, 150, 243, 0.5);
    font-weight: 600;
}

.s3-bucket-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.s3-files-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.s3-files-panel .mud-table table {
    table-layout: fixed;
    width: 100%;
}

.s3-breadcrumb-v2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 36px;
}

/* ── Watch Folder editor modal ──────────────────────────────────────────────
   Strip all outer modal chrome when the watch-folder editor is inside:
   the MudPaper (pa-2) already provides its own padding and title row.      */
.blazored-modal:has(.watch-folder-edit-dialog) {
    padding: 0;
}
.blazored-modal:has(.watch-folder-edit-dialog) .blazored-modal-header {
    display: none;
}

/* Hide MudTabs scroll arrows inside the watch-folder dialog — they appear
   when tab labels overflow the bar width and look out of place here.       */
.watch-folder-edit-dialog .mud-tabs-scroll-button {
    display: none !important;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #FFFFFFDE;
}

/* ============================================
   Global UI Improvements
   ============================================ */

/* Button hover effects */
.mud-button-root {
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.mud-button-root:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.mud-button-root:active:not(:disabled) {
    transform: translateY(0);
}

/* Icon button hover */
.mud-icon-button:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Chip hover effects */
.mud-chip:hover {
    filter: brightness(1.1);
}

/* Card/Paper improvements */
.mud-paper {
    transition: box-shadow 0.2s ease;
}

/* Table row hover enhancement */
.mud-table-row:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

/* Input field focus glow */
.mud-input-outlined:focus-within .mud-input-outlined-border {
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

/* Smooth scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Alert/Snackbar animations */
.mud-alert {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dialog backdrop */
.mud-overlay {
    backdrop-filter: none;
}

/* Ensure MudBlazor popovers (e.g. `MudSelect` menus) render above Blazored.Modal overlay */
.mud-popover {
    z-index: 2000;
}

/* Improve text readability in MudBlazor components */
.mud-table-cell,
.mud-table-row,
.mud-typography,
.mud-input,
.mud-input-control {
    color: #FFFFFFDE !important;
}

/* Table header styling with gradient background */
.mud-table-head .mud-table-cell {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%) !important;
    font-weight: 600 !important;
}

.mud-table-cell .mud-typography-caption,
.mud-typography-caption {
    color: #FFFFFFB3 !important;
}

/* Compact and modern pagination styling */
.mud-table-pagination {
    padding: 4px 8px !important;
    min-height: unset !important;
    gap: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mud-table-pagination .mud-table-pagination-select {
    margin: 0 4px !important;
}

.mud-table-pagination .mud-select {
    margin: 0 !important;
    font-size: 0.8rem !important;
}

.mud-table-pagination .mud-select-input {
    padding: 4px 8px !important;
    min-height: unset !important;
    font-size: 0.8rem !important;
}

.mud-table-pagination .mud-icon-button {
    padding: 4px !important;
}


.mud-table-pagination .mud-table-pagination-caption {
    font-size: 0.8rem !important;
}

.mud-table-pagination .mud-table-pagination-actions {
    margin-left: 8px !important;
}

:root {
    --layout-separator: rgba(255, 255, 255, 0.12);
}

/* Thin separators between regions */
.mud-appbar {
    border-bottom: 1px solid var(--layout-separator);
}

/* App bar: a bit more polished + compact */
.mud-appbar.appbar {
    background: linear-gradient(180deg, rgba(42, 42, 42, 0.35) 0%, rgba(18, 18, 18, 0.0) 100%);
    backdrop-filter: none;
}

.mud-drawer {
    border-right: 1px solid var(--layout-separator);
}

/* ============================================
   Sidebar / NavMenu
   ============================================ */

.custom-nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
}

.custom-nav-menu .mud-nav-link {
    color: #ffffffde !important;
    border-radius: 10px;
    margin: 0;
}

.custom-nav-menu .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.custom-nav-menu .mud-nav-link.active {
    background-color: rgba(33, 150, 243, 0.35) !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: none !important;
}

.custom-nav-menu .mud-nav-link .mud-nav-link-text {
    color: inherit !important;
    font-weight: 500;
}

.custom-nav-menu .mud-nav-link .mud-nav-link-icon {
    opacity: 0.92;
}

.nav-divider {
    margin: 6px 4px;
    opacity: 0.35;
}

.nav-mini-header {
    padding: 10px 8px;
    border-bottom: 1px solid var(--layout-separator);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-mini-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 8px;
    align-items: center;
}

.mini-nav-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffffde;
    text-decoration: none;
    border-radius: 12px;
    transition: background-color 0.15s ease;
}

.mini-nav-icon:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.mini-nav-icon.active {
    background-color: rgba(33, 150, 243, 0.18);
    color: #ffffffde;
}

.appbar {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: flex-end;
}

/* MudBlazor wraps app bar content in internal containers; ensure they take full width */
.appbar .mud-appbar-content,
.appbar .mud-toolbar,
.appbar .mud-toolbar-root {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-end;
}

.appbar-right {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    padding-right: 12px;
}

.appbar-right-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.appbar-time {
    text-align: right;
    font-size: 0.8rem;
    line-height: 1.05;
    opacity: 0.9;
}

a, .btn-link {
    color: #03b6e6;
}

.btn-primary {
    color: #fff;
    background-color: #ff671b;
    border-color: #1861ac;
}

.btn-primary:hover {
    color: #fff;
    background-color: #ff871b;
    border-color: #7861ac;
}

.btn-default {
    color: #fff;
    background-color: #2980b9;
    border-color: #1861ac;
}

.btn-default:hover {
    color: #fff;
    background-color: #2990b9;
    border-color: #1871ac;
}


button:disabled,
button[disabled],
button:disabled:hover {
    border: 1px solid #888888;
    color: #bbbbbb;
    background-color: #555555;
    border-color: #777777;
}


.btn-page {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
    width: 80px;
}

.btn-noborder {
    color: #fff;
    background-color: #555555;
    border-color: #777777;
}

.btn-noborder:hover {
    color: #fff;
    background-color: #666666;
    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: #121212;
        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-color: #121212;
}

    .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;
}

.mud-table-loading {
display: none !important;
}

#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-right: 8px;
    margin-left: 8px;
}

@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;
    margin-top: 0;
    margin-bottom: 0.5em;
}

h2 {
    font-size: 1.75em;
    line-height: 1.5em;
    color: #ff671b;
    margin-top: 0;
    margin-bottom: 0.5em;
}

h3 { 
    font-size: 1.4em;
    line-height: 1.5em;
    color: #2980b9
}

h4 {
    font-size: 1.2em;
    line-height: 1.5em;
    color: #ffffff
}

table {
    margin: 0 0 2em 0;
    width: 100%;
    border: solid 2px rgba(160, 160, 160, 0.25);
    border-bottom: solid 2px rgba(160, 160, 160, 0.25);
}

table tbody tr {
    border: solid 0px rgba(144, 144, 144, 0.25);
    border-left: 0;
    border-right: 0;
    text-align: left;
    padding: 3px;
    font-size: 0.8rem;
}

table tbody tr:nth-child(2n + 1) {
    background-color: rgba(144, 144, 144, 0.075);
    text-align: left;
    padding: 3px;
    font-size: 0.8rem;
}

table td {
    padding: 0.5em 0.5em;
    text-align: center;
}

    table th {
        color: #FFFFFF;
        font-size: 0.9em;
        font-weight: 700;
        padding: 0.75em;
        text-align: center;
        border: solid 1px rgba(160, 160, 160, 0.25);
    }

table thead {
    border-bottom: solid 2px rgba(160, 160, 160, 0.25);
}

table tfoot {
    border-top: solid 2px rgba(144, 144, 144, 0.25);
}

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 {
    width: 100px;
}

#tableItem tr:hover {
    background-color: #444;
}

/* Disable layout animations for drawer width changes */
.mud-layout {
    transition: none !important;
}

.mud-main-content {
    transition: none !important;
}

.mud-drawer {
    transition: none !important;
    width: var(--drawer-width, 250px) !important;
}

:root {
    --drawer-width: 250px;
}









