/* SEE: https://getbootstrap.com/docs/5.3/customize/css-variables/ */

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

a, .btn-link {
    /*color: #006bb7;*/
}

.btn-primary {
    color: white;
    background-color: #1b6ec2;
    border-color: #1861ac;
    text-decoration: none;
}

a.btn-primary {
    border-radius: 5%;
    padding: 7px;
    color: white !important;
    text-decoration: none;
}

a.btn-primary:hover {
    color: white;
    background-color: #1861ac;
    border-color: #1b6ec2;
    text-decoration: none;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYg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m9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* 
    UPLOADS PANEL - SET CELL COLOR HERE
    HAVE GONE AROUND THE HOUSES TRYING TO CHANGE SHEET COLORS IN MEMORY, WHICH HASN'T WORKED
*/
.k-spreadsheet .k-spreadsheet-view .k-spreadsheet-cell,
.k-spreadsheet .k-spreadsheet-view .k-spreadsheet-cell *,
.k-spreadsheet-cell,
.k-spreadsheet-cell * 
{
    color: var(--bs-primary-color) !important;
}

/**
 * ==========================
 * Grid Filter Checkboxes 
 * (Orders -> Items filter) 
 * ==========================
**/

/* Target the animation container that holds the filter menu */
.k-animation-container 
{
    /* Allow it to grow beyond the default */
    width: auto !important;
}

@media (min-width: 769px) 
{
    /* Make the popup larger on desktop (large screens) when floating over grid */
    .k-animation-container .k-grid-filter-popup {
        /* Force the width to show long text */
        min-width: 450px !important;
        max-width: 100vw;
    }
}

/* Universal Full-Screen Mobile Popups for Telerik Grid and Dropdowns */
@media (max-width: 768px) 
{
    .k-columnmenu-item-wrapper {
        width: 100vw;
        height: 90vh;
        padding: 0;
        margin: 0;
        background-color: #333;
    }

    .k-multicheck-wrap 
    {
        /*scrollbar-width: auto;
        scrollbar-color: red;*/
        height: 80vh !important;
    }

        /*.k-multicheck-wrap::-webkit-scrollbar 
        {
            width: 24px;
        }*/

    /* Reset the Global Popup Container */
    .k-animation-container.k-animation-container-shown {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        transform: none !important;
        z-index: 10001 !important;
        background-color: #333 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow-y: hidden !important;
    }
    /* Dropdown lists */
    .k-dropdownlist-popup .k-list .k-list-content {
        height: 100vh !important;
        overflow-y: scroll !important;
    }

    /* Close button on filter menu */
    .k-actionsheet-actions .k-button {
        right: 0 !important;
        background-color: var(--bs-danger) !important;
    }

    /* Unified Box Styling for all Popup Types */
    .k-popup,
    .k-grid-filter-popup,
    .k-filter-menu,
    .k-column-menu,
    .k-list-container {
        display: flex !important;
        flex-direction: column !important;
        height: 96vh !important;
        width: 96vw !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important; /* Uses container bg */
        /*overflow-y: hidden !important;*/
    }

    /* Force Expansion of the Middle Content Area */
    /* Targets Filter Menus, Checkbox Lists, and Dropdown Lists */
    .k-filter-menu-container,
    .k-checkbox-list-container,
    .k-list-content,
    .k-menu-vertical {
        flex: 1 1 auto !important;
        overflow-y: auto !important;
        min-height: 0;
        padding: 5px !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100vw !important;
    }

        /*.k-filter-menu-container div, .k-multicheck-wrap 
        {
            min-height: 80vh !important;
        }*/

        .k-filter-menu-container div:not([class^="k"]),
        .k-multicheck-wrap {
            min-height: 80vh !important;
        }

        .k-filter-menu-container .k-searchbox {
            min-height: 3rem !important;
        }

    /* Specifically target the checkbox list itself to expand within its container */
    .k-checkbox-list {
        flex: 1 1 auto !important;
    }

    /* PIN Action Buttons (Filter/Clear) to the very bottom */
    .k-filter-menu .k-actions,
    .k-column-menu .k-actions {
        display: flex !important;
        gap: 12px;
        padding: 15px !important;
        border-top: 1px solid #ddd !important;
        position: sticky !important;
        bottom: 0 !important;
        margin-top: auto !important; /* Pushes to bottom of flex container */
        background-color: #333 !important;
        width: 100vw;
    }

    .k-actionsheet-footer,
    .k-grid-filter-popup .k-actions {
        max-height: 5rem !important;
    }

    .k-filter-menu .k-actions button,
    .k-column-menu .k-actions button,
    .k-actionsheet-view button {
        padding: 1.75rem !important;
        height: 3rem !important;
    }

    .k-toolbar-items button.k-toolbar-button,
    .k-toolbar-items button.k-button-solid {
        height: 3rem !important;
    }

    /* Mobile Optimization for Click Targets */
    .k-list-item, .k-button, .k-checkbox-label {
        min-height: 1.5rem !important;
        font-size: 1.1rem !important;
        display: flex !important;
        align-items: center !important;
    }

    .k-actionsheet-container .k-list-item {
        width: 80vw !important;
    }

    .k-actionsheet-view {
        width: 95vw !important;
    }

    .k-filter-menu-container .k-dropdown-list {
        height: 3rem !important;
    }
}

/* Prevent text wrapping and handle overflow */
.k-animation-container .k-multicheck-wrap .k-item label {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    font-size: 0.75rem !important;
}

/* Ensure the checkbox list scrolls if it gets too tall */
.k-multicheck-wrap {
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: 2rem !important;
}