html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.page {
    display: flex;
    height: calc(100vh - 56px); /* assuming top navbar is 56px */
}

.sidebar {
    min-width: 250px;
    background-color: #111;
    color: white;
}

main {
    flex-grow: 1;
    overflow-y: auto;
}

/* LOGIN PAGE STYLES */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #7d8080, #292b2b);
    overflow-y: auto;
    padding: 1rem;
    box-sizing: border-box;
}

.login-card-custom {
    display: flex;
    width: 700px;
    min-height: 300px;
    border-radius: 1rem;
    overflow: hidden;
}

.form-panel {
    flex: 2;
    padding: 2rem;
    max-height: 100%;
    overflow-y: auto;
}

.side-panel {
    flex: 1;
    background-color: #1d2125;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
}

.text-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-decoration: none;
}

.text-link {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
    text-decoration: none;
}

    .text-link:hover {
        color: #aaa;
        text-decoration: none;
    }

.custom-input {
    border-radius: 0.6rem;
    border: 1px solid #ccc;
    padding: 0.75rem;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

    .custom-input:focus {
        border-color: #000;
        box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.2);
    }

.btn-black {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
    transition: all 0.3s ease;
}

    .btn-black:hover {
        background-color: #fff;
        color: #000;
        border: 1px solid #000;
    }

.input-with-icon {
    position: relative;
}

    .input-with-icon .form-control {
        padding-left: 2.5rem;
    }

.input-icon {
    position: absolute;
    top: 50%;
    left: 0.75rem;
    transform: translateY(-50%);
    color: #888;
    font-size: 1.2rem;
}

.text-below-links {
    margin-top: 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12rem;
    text-decoration: none;
    justify-content: center;
    width: 100%;
}

    .text-below-links a {
        text-decoration: none;
        color: #000;
        font-weight: 500;
        transition: color 0.3s ease;
        text-decoration: none;
    }

        .text-below-links a:hover {
            text-decoration: underline;
            color: #555;
        }

.admin-text {
    font-size: 2.5rem;
    color: #fff;
    text-align: center;
    margin-top: 1rem;
    font-weight: 350;
    text-transform: uppercase;
}

.admin-logo {
    display: block;
    max-width: 200px;
    max-height: 140px;
    margin: 0 auto 1rem auto;
    object-fit: contain;
}

.btn-darkgrey {
    background-color: #343a40;
    color: #fff;
    border: 2px solid #343a40;
    transition: background 0.5s, color 0.5s, box-shadow 0.5s, border 0.5s;
    border-radius: 8px;
}

    .btn-darkgrey:hover, .btn-darkgrey:focus {
        background-color: #fff;
        color: #343a40;
        border: 2px solid #343a40;
        border-radius: 8px;
    }

.btn-save-green {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    border: 2px solid #28a745;
}

    .btn-save-green:hover {
        background-color: #fff;
        color: #28a745;
        border: 2px solid #28a745;
        border-radius: 8px;
    }

.btn-darkgrey i {
    color: #fff;
    transition: color 0.3s;
}

    .btn-darkgrey:hover i, .btn-darkgrey:focus i {
        color: #343a40;
    }

/* Top navbar styles */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 56px;
}

.btn-profile {
    background-color: #495057;
    color: white;
    border: none;
}

    .btn-profile:hover {
        background-color: #6c757d;
        color: white;
    }

.btn-logout {
    background-color: #dc3545;
    color: white;
    border: none;
}

    .btn-logout:hover {
        background-color: #c82333;
        color: white;
    }

.page-wrapper {
    display: flex;
    margin-top: 56px;
    height: calc(100vh - 56px);
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
}

/* Font size for content wrapper */
.content-wrapper input,
.content-wrapper select,
.content-wrapper textarea,
.content-wrapper button,
.content-wrapper label,
.content-wrapper .form-control {
    font-size: 12px !important;
}

/* LIGHT THEME (Default) */
body.light-theme {
    background-color: #ffffff;
    color: #212529;
}

    body.light-theme .navbar,
    body.light-theme .card,
    body.light-theme .modal-content {
        background-color: #ffffff;
        color: #212529;
    }

    body.light-theme .btn-primary {
        background-color: #1b6ec2;
        border-color: #1861ac;
        color: #fff;
    }

    body.light-theme a,
    body.light-theme .btn-link {
        color: #0071c1;
    }

        body.light-theme .btn:focus,
        body.light-theme .btn:active:focus,
        body.light-theme .btn-link.nav-link:focus,
        body.light-theme .form-control:focus,
        body.light-theme .form-check-input:focus {
            box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
        }


/* DARK THEME */
body.dark-theme {
    background-color: #121212;
    color: #e1e1e1;
}

    body.dark-theme .navbar,
    body.dark-theme .card,
    body.dark-theme .modal-content {
        background-color: #1e1e1e;
        color: #e1e1e1;
    }

    body.dark-theme .btn-primary {
        background-color: #3a86ff;
        border-color: #2776e2;
        color: #fff;
    }

    body.dark-theme a,
    body.dark-theme .btn-link {
        color: #4aa8ff;
    }

        body.dark-theme .btn:focus,
        body.dark-theme .btn:active:focus,
        body.dark-theme .btn-link.nav-link:focus,
        body.dark-theme .form-control:focus,
        body.dark-theme .form-check-input:focus {
            box-shadow: 0 0 0 0.1rem #e1e1e1, 0 0 0 0.25rem #4aa8ff;
        }


/* COMMON STYLES */
.navbar, .card, .modal-content {
    transition: background-color 0.3s, color 0.3s;
}

h1:focus {
    outline: none;
}

.content {
    padding-top: 1.1rem;
}

.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;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,...truncated...) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* Paginated Grid Styles */
.paginated-grid {
    background: #fff;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
    font-size: 0.8rem;
}

.paginated-grid-actions {
    width: 5%;
}

.paginated-grid th {
    background: #343a40;
    color: #FFFFFF;
    font-weight: 600;
    border-bottom: 1px solid #495057;
    border-right: 1px solid #495057;
}

    .paginated-grid th:last-child {
        border-right: none;
    }

.paginated-grid td {
    vertical-align: middle;
    border-color: #e0e0e0;
    border-right: 1px solid #dee2e6;
}

    .paginated-grid td:last-child {
        border-right: none;
    }

.paginated-grid tr {
    transition: background 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s cubic-bezier(0.4,0,0.2,1);
    border-bottom: 1.5px solid #dee2e6;
}

    .paginated-grid tr:hover {
        background: #e9ecef;
        box-shadow: 0 2px 8px rgba(30, 34, 40, 0.07);
        transition: background 0.2s, box-shadow 0.2s;
        cursor: pointer;
    }

.paginated-grid thead tr {
    border-bottom: 1.5px solid #bfc4c9;
}

.paginated-grid tbody tr:last-child {
    border-bottom: none;
}

.paginated-grid .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f0f2f5;
}

.sectioncontent {
    color: #343a40;
    font-size: 1.7rem;
}

/* Accordion Styles */
.accordion {
    background: #fff;
    border-radius: 0.7rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    overflow: hidden;
    font-size: 0.95rem;
}

.accordion-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.7rem;
    margin-bottom: 1rem;
    overflow: hidden;
    background-color: #fff;
}

    .accordion-item:last-child {
        border-bottom: none;
    }

.accordion-header {
    padding: 0;
    border-radius: 0.7rem 0.7rem 0 0;
}

.accordion-button,
.accordion-button:not(.collapsed) {
    background-color: #343a40 !important;
    color: #fff !important;
    font-weight: 600;
    border: none;
    border-radius: 0.7rem;
    padding: 1rem 1.25rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    box-shadow: none;
}

    .accordion-button:hover,
    .accordion-button:not(.collapsed):hover {
        background-color: #212529 !important;
        color: #fff !important;
    }

    .accordion-button i {
        color: #fff !important;
        margin-right: 0.5rem;
        transition: color 0.3s ease;
    }

.accordion-body {
    overflow: hidden;
    max-height: 750px;
    padding: 0 1.5rem;
    transition: max-height 1s ease, padding 0.3s ease;
    border-radius: 0 0 0.7rem 0.7rem;
    background-color: #fff;
}

    .accordion-body.show {
        max-height: 1000px;
        padding: 1.5rem;
    }

/* Button Styles */
.btn-filter-add {
    background: #343a40;
    color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 0.4rem 1.2rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: background 0.5s, color 0.5s, box-shadow 0.5s, border 0.5s;
}

    .btn-filter-add .add-label {
        font-size: 12px;
        font-weight: 500;
    }

    .btn-filter-add:hover, .btn-filter-add:focus {
        background-color: #fff;
        color: #343a40;
        border: 1px solid #343a40;
    }

    .btn-filter-add i {
        color: #fff;
        transition: color 0.3s;
    }

        .btn-filter-add:hover i,
        .btn-filter-add:focus i {
            color: #343a40;
        }

.btn-item-add {
    background: #343a40;
    color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 0.05rem 0.4rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: background 0.5s, color 0.5s, box-shadow 0.5s, border 0.5s;
}

    .btn-item-add .add-label {
        font-size: 10px;
        font-weight: 500;
    }

    .btn-item-add:hover, .btn-item-add:focus {
        background-color: #fff;
        color: #343a40;
        border: 1px solid #343a40;
    }

    .btn-item-add i {
        color: #fff;
        transition: color 0.3s;
    }

        .btn-item-add:hover i,
        .btn-item-add:focus i {
            color: #343a40;
        }

.btn-item-exists {
    background: #dee2e6;
    color: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 0.05rem 0.4rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: background 0.5s, color 0.5s, box-shadow 0.5s, border 0.5s;
    cursor: none;
}

    .btn-item-exists .add-label {
        font-size: 10px;
        font-weight: 500;
    }

    .btn-item-exists:hover, .btn-item-exists:focus {
        background-color: #fff;
        color: #343a40;
        border: 1px solid #343a40;
        cursor: no-drop;
    }

    .btn-item-exists i {
        color: #fff;
        transition: color 0.3s;
    }

        .btn-item-exists:hover i,
        .btn-item-exists:focus i {
            color: #343a40;
        }

.btn-outline-darkgrey {
    border: 1px solid #343a40;
    color: #343a40;
}

    .btn-outline-darkgrey:hover {
        background-color: #23272b;
        color: #fff;
    }

/* Register and Forgot Password Card Styles */
.register-card-custom {
    display: flex;
    width: 700px;
    height: 450px;
    border-radius: 1rem;
    overflow: hidden;
}

    .register-card-custom .form-panel {
        flex: 2;
        padding: 2rem;
    }

    .register-card-custom .side-panel {
        flex: 1;
        background-color: #1d2125;
        color: white;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1rem;
    }

.forgot-password-card-custom {
    display: flex;
    width: 700px;
    height: 290px;
    border-radius: 1rem;
    overflow: hidden;
}

    .forgot-password-card-custom .form-panel {
        flex: 2;
        padding: 2rem;
    }

    .forgot-password-card-custom .side-panel {
        flex: 1;
        background-color: #1d2125;
        color: white;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 1rem;
    }

.register-link {
    font-size: 2.7rem;
    font-weight: 600;
    text-decoration: none;
}

/* Folder Tree Scrollbar */
.folder-tree::-webkit-scrollbar {
    width: .4rem;
}

.folder-tree::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,.25);
    border-radius: .25rem;
}

/* Quill Editor */
.quill-disabled .ql-editor {
    pointer-events: none;
    background-color: #f9f9f9;
    content: "Editor is disabled while in HTML mode";
    color: #999;
    font-style: italic;
    opacity: 0.5;
}

/* Minimal, Bootstrap-like validation styling without Bootstrap */
.form-control.invalid,
.form-control.modified.invalid {
    border-color: #dc3545;
}

    .form-control.invalid:focus,
    .form-control.modified.invalid:focus {
        border-color: #dc3545;
        box-shadow: 0 0 0 .25rem rgba(220,53,69,.25);
        outline: 0;
    }

/* Date Input Control */
.calendar-button-wrapper {
    display: inline-block;
}

.btn-calendar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 .75rem;
    height: 38px;
    background-color: #343a40;
    color: #fff;
    border: 2px solid #343a40;
    border-radius: 8px;
    cursor: pointer;
}

.visually-hidden-date {
    position: fixed;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: 0;
}

/* Grid Drag and Drop */
.grid-cell {
    position: relative;
    min-height: 60px;
    background: var(--bs-body-bg);
}

    .grid-cell .drag-handle {
        position: absolute;
        top: 4px;
        right: 4px;
        z-index: 2;
        padding: 2px 6px;
        border-radius: 6px;
        background: rgba(0,0,0,.08);
        cursor: grab;
        user-select: none;
        -webkit-user-drag: element;
    }

.list-group-item .drag-handle {
    position: static;
    display: inline-flex;
    align-items: center;
    padding: 0;
    background: transparent;
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.grid-cell-empty {
    background: transparent;
    border: 1px dashed rgba(0,0,0,.15);
}

.grid-content [draggable="false"] {
    -webkit-user-drag: none;
    user-drag: none;
}

.grid-cell.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    border: 1px dashed rgba(0,0,0,.2);
}

.placeholder-plus {
    pointer-events: none;
}

/* Table properties tab styling */
/* COMMENTED OUT FOR TESTING - These styles are now in ControlPropertiesPanel.razor.css (component-scoped)
.nav-tabs-sm {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-end !important;
    justify-content: flex-start !important;
    border-bottom: 1px solid #dee2e6 !important;
    padding: 0 !important;
    margin: 0 0 1rem 0 !important;
    gap: 5px !important;
    width: auto !important;
    list-style: none !important;
}

.nav-tabs-sm > .nav-item {
    display: inline-flex !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    float: none !important;
    width: auto !important;
}

.nav-tabs-sm button.nav-link {
    background-color: #6c757d !important;
    color: #ffffff !important;
    border: 1px solid #6c757d !important;
    border-radius: 0.25rem 0.25rem 0 0 !important;
    margin: 0 !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.875rem !important;
    white-space: nowrap !important;
    position: relative !important;
    bottom: -1px !important;
    display: inline-block !important;
    float: none !important;
    min-width: auto !important;
    max-width: none !important;
}

    .nav-tabs-sm button.nav-link.active {
        background-color: #ffffff !important;
        color: #000000 !important;
        border: 1px solid #dee2e6 !important;
        border-bottom: 1px solid #ffffff !important;
        border-bottom-color: transparent !important;
        z-index: 1 !important;
    }

    .nav-tabs-sm button.nav-link:not(.active):hover {
        background-color: #5a6268 !important;
        color: #ffffff !important;
        border: 1px solid #5a6268 !important;
    }
*/

/* Table with no borders - allows inline styles to override */
.table-no-borders {
    border: none;
    border-collapse: collapse;
}

    .table-no-borders thead,
    .table-no-borders tbody,
    .table-no-borders tfoot,
    .table-no-borders tr,
    .table-no-borders th,
    .table-no-borders td {
        border: none;
    }

    .table-no-borders th,
    .table-no-borders td {
        padding: 0.75rem;
    }

/* Table with only outside border - no cell borders, no internal lines */
.table-outline-only {
    border: 1px solid #dee2e6 !important;
    border-collapse: collapse !important;
}

    .table-outline-only thead,
    .table-outline-only tbody,
    .table-outline-only tfoot,
    .table-outline-only tr,
    .table-outline-only th,
    .table-outline-only td {
        border: none !important;
        border-top: none !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
    }

    .table-outline-only th,
    .table-outline-only td {
        padding: 0.75rem;
    }

/* Table with outside border and horizontal lines only */
.table-horizontal-lines {
    border: 1px solid #dee2e6;
    border-collapse: collapse;
}

    .table-horizontal-lines th,
    .table-horizontal-lines td {
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: 1px solid #dee2e6 !important;
        padding: 0.75rem;
    }

    .table-horizontal-lines thead th {
        border-bottom: 2px solid #dee2e6 !important;
    }

    .table-horizontal-lines tbody tr:last-child td {
        border-bottom: none !important;
    }

/* Clean table with minimal borders */
.table-minimal {
    border: none;
    border-collapse: collapse;
}

    .table-minimal th,
    .table-minimal td {
        border: none !important;
        padding: 0.75rem;
    }

    .table-minimal thead th {
        border-bottom: 2px solid #dee2e6 !important;
    }

/* Custom Link Hover Opacity Classes */
.link-hover-fade-light {
    transition: opacity 0.3s ease;
}

    .link-hover-fade-light:hover {
        opacity: 0.9;
    }

.link-hover-fade {
    transition: opacity 0.3s ease;
}

    .link-hover-fade:hover {
        opacity: 0.75;
    }

.link-hover-fade-medium {
    transition: opacity 0.3s ease;
}

    .link-hover-fade-medium:hover {
        opacity: 0.5;
    }

.link-hover-fade-strong {
    transition: opacity 0.3s ease;
}

    .link-hover-fade-strong:hover {
        opacity: 0.25;
    }
