:root {
    color-scheme: dark light;
}

html {
    font-size: 100%;
}

.full-page-grid {
    margin-right: -15px !important;
    margin-left: -15px !important;
    height: 100%;
}

.e-spin-overlay {
    z-index: 9999;
}

.e-overlay {
    cursor: default !important;
}

.scrollable {
    overflow-y: auto;
}

.cursor-pointer {
    cursor: pointer;
}

.e-toolbar .badge {
    border-radius: 0px;
}

.grid-height {
    max-height: calc(90vh - 130px);
}

.warning-icon {
    color: orange;
}

.danger-icon {
    color: firebrick;
}

.e-sidebar {
    box-shadow: 1px 0 5px #333 !important;
    overflow-x: clip !important;
    transform: none !important;
}

.e-toolbar {
    overflow: visible;
    box-shadow: 0 1px 5px #333 !important;
}

select {
    cursor: pointer;
}

.e-tbar-btn .fa {
    font-size: 20px;
    margin: 0;
    padding: 2px 0 0 10px;
    line-height: 16px;
    min-height: 16px;
    vertical-align: middle;
    display: inline-block;
}

.profile-header {
    font-size: 1rem;
}

.profile-circle-img {
    width: 42px;
    height: 42px;
    margin: 8px;
}

.profile-circle {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    border: 1px solid;
}

.profile-initials {
    margin: 8px 7px;
}

ul .dropdown-menu {
    width: 100%;
}

.footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 30px;
    line-height: 30px;
    display: flex;
    align-content: flex-end; 
}

.custom-toolbar-padding {
    padding-top: 6px;
}

.e-grid .e-row:has(td.e-active) {
    outline-offset: -1px;
    outline: 2px dashed #e3e3e3;
}

.e-grid .e-summarycell {
    font-size: 0.8rem;
    vertical-align: middle;
} 

/* SfMultiSelect and SfDatetimePicker */
.form-group .e-multiselect.e-input-group .e-multi-select-wrapper,
.form-group .e-input-group input.e-input,
.form-group .e-input-group.e-control-wrapper input.e-input {
    font-size: 1rem;
    height: 36px;
    padding: 6px 12px;
}

.e-dialog .e-dlg-header {
    white-space: unset !important;
}

.grid-icon {
    margin: 0 5px;
    text-shadow: 0px 0px 5px black;
}

.grid-link {
    margin: 0 2px;
    cursor: pointer;
    border-radius: 3px;
    padding: 3px 3px;
}

.e-grid .e-focused:not(.e-menu-item),
.e-grid .e-focused:not(.e-menu-item):not(.e-editedbatchcell) {
    box-shadow: none;
}

.bg-purple {
    opacity: 1;
    background-color: #be00ff !important;
    color: azure !important;
}

.form-control:disabled {
    border: none;
    opacity: 0.75;
}

.form-col-border {
    border: #3e3e3e solid 2px;
    border-radius: 5px;
    padding-top: 10px;
    padding-bottom: 10px;
    margin: 0 0 10px 0;
}

.validation-message {
    color: firebrick;
}

.e-richtexteditor .e-rte-content,
.e-richtexteditor .e-source-content {
    background: inherit;
    color: inherit;
    font-size: inherit !important;
    border-top: none;
    border-bottom: none;
}

.e-richtexteditor .e-rte-content .e-content,
.e-richtexteditor .e-source-content .e-content {
    color: inherit;
    font-size: inherit !important;
    border-top: none;
    border-bottom: none;
    padding: 0;
}

.e-richtexteditor.e-rte-tb-expand .e-rte-content {
    border: 0;
    border-bottom: none;
    border-top: none;
}

.dropdown-menu li {
    position: relative;
}

.dropdown-menu .dropdown-submenu {
    display: none;
    position: absolute;
    left: 100%;
    top: -7px;
}

.dropdown-menu .dropdown-submenu-left {
    right: 100%;
    left: auto;
}

.dropdown-menu > li:hover > .dropdown-submenu {
    display: block;
}

.validation-header {
    position: sticky;
    top: -12px;
    padding: 0px !important;
    margin: 0px;
}

.e-ddl.e-input-group .e-input-value,
.e-ddl.e-input-group .e-input-value:focus {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    background-clip: padding-box;
    appearance: none;
    border-radius: 0.25rem;
}

.e-clear-icon.e-clear-icon-hide {
    display: flex !important;
}

/* Tab styles */
.e-tab.e-background .e-tab-header {
    background: var(--bs-gray-400);
    border: 0;
}

.tinymce-wrapper {
    width: 100%;
    min-height: 40px;
    margin: 3px 5px;
}

@media (prefers-color-scheme: dark) {
    .e-tbar-btn .fa {
        color: #adb5bd;
    }

    .profile-header {
        color: #adb5bd;
        border-color: #adb5bd;
    }

    .dropdown-menu {
        background-color: #282d31;
    }

    .nav-link,
    .nav-link:hover {
        color: #adb5bd;
    }

    .footer {
        background-color: #282d31;
    }

    .e-spinner-pane .e-spinner-inner .e-spin-label,
    .e-spinner-pane .e-spinner-inner .e-spin-bootstrap5 {
        fill: #adb5bd;
        stroke: #adb5bd;
        color: #adb5bd;
    }

    .badge-selected {
        border: white 1px solid !important;
    }

    /* SfMultiSelect and SfDatetimePicker */
    .e-multiselect.e-input-group .e-multi-select-wrapper,
    .e-input-group input.e-input, .e-input-group.e-control-wrapper input.e-input {
        color: #b1b1b1;
        background-color: #222;
        border: 1px solid #515151;
    }

    .e-pager-default,
    .e-currentitem {
        color: #adb5bd !important;
    }

    .grid-link:hover {
        background: #FFFFFF55;
    }

    .grid-link-highlight {
        background: #2d9219bf;
    }

    .vsb-menu,
    .vsb-main,
    .vsb-main button,
    .vsb-menu .multi,
    .vsb-menu .multi li {
        background-color: #222 !important;
        color: #b1b1b1;
    }

    .vsb-main li:hover,
    .vsb-menu li:hover {
        background: #333;
        color: #b1b1b1;
    }

    .vsb-menu .multi li:not(.grouped-option).active::after {
        border-bottom: 2px solid #b1b1b1;
        border-right: 2px solid #b1b1b1;
    }

    .form-control option:disabled {
        color: #b1b1b150;
    }

    .tinymce-input {
        border-width: 1px;
        border-style: solid;
        border-color: rgb(68, 76, 84);
        border-image: initial;
        color: rgb(255, 255, 255);
        background: rgb(33, 37, 41);
    }
}

@media (prefers-color-scheme: light) {
    .bg-dark,
    .bg-primary,
    .bg-success,
    .bg-danger {
        color: #f8f9fa !important;
    }

    .badge {
        color: #212529;
    }

    .e-tbar-btn .fa {
        color: #333;
    }

    .profile-header {
        color: #333;
        border-color: #333;
    }

    .dropdown-menu {
        background-color: #f8f9fa;
    }

    .nav-link,
    .nav-link:hover {
        color: #333;
    }

    .footer {
        background-color: #f8f9fa;
    }

    .e-spinner-pane .e-spinner-inner .e-spin-label,
    .e-spinner-pane .e-spinner-inner .e-spin-bootstrap5 {
        fill: #333;
        stroke: #333;
        color: #333;
    }

    .badge-selected {
        border: #333 1px solid !important;
    }

    /* SfMultiSelect and SfDatetimePicker */
    .e-multiselect.e-input-group .e-multi-select-wrapper,
    .e-input-group input.e-input, .e-input-group.e-control-wrapper input.e-input {
        color: #212529;
        background-color: #fff;
        border: 1px solid #ced4da;
    }

    .e-pager-default,
    .e-currentitem {
        color: #333 !important;
    }

    .grid-link:hover {
        background: #00000055;
    }

    .grid-link-highlight {
        background: #2f9b1a66;
    }

    .vsb-menu,
    .vsb-main,
    .vsb-main button,
    .vsb-menu .multi,
    .vsb-menu .multi li {
        background-color: #fff !important;
        color: #333;
    }

        .vsb-main li:hover,
        .vsb-menu li:hover {
            background: #fff;
            color: #333;
        }

    .vsb-menu .multi li:not(.grouped-option).active::after {
        border-bottom: 2px solid #333;
        border-right: 2px solid #333;
    }

    .form-control option:disabled {
        color: #21252950;
    }

    .tinymce-input {
        border-width: 1px;
        border-style: solid;
        border-color: rgb(68, 76, 84);
        border-image: initial;
        color: rgb(0, 0, 0);
        background: rgb(200, 200, 200);
    }
}

/* Tasks */
.task-card-wrapper {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 400px;
    position: relative;
}

.task-card-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 2;
}

.task-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.card-text {
    margin-bottom: 0.2rem;
}

/* Make the Bootstrap card use flexbox */
.task-card .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.task-card .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0.5rem 1rem;
}

/* Ensure card-footer stays at bottom */
.task-card .card-footer {
    margin-top: auto;
}

/* Single row styling */
.task-row {
    display: grid;
    grid-template-columns: 24px 2fr 1.5fr auto auto; /* icon | name | desc | assigned | due */
    gap: 12px; /* Equal spacing between all items */
    align-items: center;
    height: 45px;
    padding: 0.50rem;
    border: solid 1px;
    border-radius: 5px;
    padding-right: .5rem !important;
    padding-left: .5rem !important;
    margin: 0 0 .5rem 0 !important;
    color: inherit !important;
}

.task-row-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.task-row-name,
.task-row-description {
    min-width: 0; /* allow truncation */
}

.task-row-name,
.task-row-description,
.task-row-assignedto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-row-duedate {
    white-space: nowrap;
    justify-self: end;
    width: 80px;
    font-weight: bold;
    margin: 0 10px;
}

.task-row-assignedto {
    width: 165px;
    font-style: italic;
}

/* Task status styling using Bootstrap colors */
.task-available {
    border-left: 4px solid #0d6efd !important;
}

.task-completed {
    border-left: 4px solid #198754 !important;
    opacity: 0.8;
}

.task-unavailable {
    border-left: 4px solid #6c757d !important;
    opacity: 0.5;
}

.task-overdue {
    border-left: 4px solid #dc3545 !important;
}

.task-selected {
    background-color: #e3f2fd;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

/* Dark mode override for task-selected */
@media (prefers-color-scheme: dark) {
    .task-selected {
        background-color: rgba(13, 110, 253, 0.2);
    }
}

/* Task dependencies styling */
.task-dependencies {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 0.375rem;
    border-left: 3px solid #6c757d;
}

.dependency-line {
    margin-bottom: 4px;
    font-style: italic;
}

@media (max-width: 1200px) {
    .task-card-wrapper {
        min-width: 280px;
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .task-card-wrapper {
        width: 100%;
        max-width: none;
        min-width: 280px;
    }
}

.task-checklist-panel {
    display: flex;
    flex-direction: column;
    border-left: solid 1px;
    min-width: 350px;
}

.checklist-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-content {
    flex: 1;
    padding: 0 15px;
    overflow-y: auto;
}

.checklist-item {
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 0.375rem;
    border: solid 1px;
}

.checklist-item-completed {
    text-decoration: line-through;
}

.completed-info {
    margin-top: 0px;
    padding-top: 0px;
}

.form-check {
    min-height: unset !important;
    margin-bottom: unset !important;
}
/* End tasks */

/* TaskItem details */
.task-checklist-panel {
    display: flex;
    flex-direction: column;
    border-left: solid 1px;
    min-width: 350px;
}

.checklist-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-content {
    flex: 1;
    padding: 0 15px;
    overflow-y: auto;
}

.checklist-item {
    margin-bottom: 5px;
    padding: 10px;
    border-radius: 0.375rem;
    border: solid 1px;
}

.checklist-item-completed {
    text-decoration: line-through;
}

.completed-info {
    margin-top: 0px;
    padding-top: 0px;
}

.form-check {
    min-height: unset !important;
    margin-bottom: unset !important;
}
/* End TaskItem details*/

/* Task flow visualization */
.project-task-flow {
    height: 100%;
    width: 100%;
}

.task-flow-container {
    display: flex;
    height: 100%;
    gap: 20px;
}

.task-flow-main {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

.completed-info {
    margin-top: 0px;
    padding-top: 0px;
}

/* Task level and row layout */
.task-level {
    margin-bottom: 40px;
    width: 100%;
    position: relative;
}

.task-visualization-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    position: relative;
}

/* Level connectors - simple arrows between levels */
.level-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px 0;
    z-index: 0;
}

.connector-arrow::before {
    content: '\2B63';
    font-size: 1.5rem;
    color: #6c757d;
    font-weight: bold;
}


/* Enhanced parent-child relationship styling */
.task-level[data-level="0"] .task-row {
    justify-content: center;
}

/* Responsive design */
@media (max-width: 768px) {
    .task-flow-container {
        flex-direction: column;
    }

    .task-checklist-panel {
        width: 100%;
    }

    .task-visualization-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .level-connector {
        margin: 15px 0;
    }
}
/* End task flow visualization*/