/* inventor/static/css/custom.css */

body {
    /* Adjust padding-top if you have a fixed top navbar for mobile that's not part of the offcanvas toggle */
}

/* Sidebar Styling */
#offcanvasSidebar {
    width: 280px;
    /* Adjust width as needed */
    border-right: 1px solid #dee2e6;
}

#offcanvasSidebar .offcanvas-header {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

#offcanvasSidebar .nav-link {
    padding: .75rem 1rem;
    font-weight: 500;
    color: #495057;
    /* Darker text for links */
}

#offcanvasSidebar .nav-link:hover,
#offcanvasSidebar .nav-link.active {
    color: #0d6efd;
    /* Bootstrap primary blue for active/hover */
    background-color: #e9ecef;
    /* Light background for active/hover */
}

#offcanvasSidebar .sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05rem;
    color: #6c757d;
    /* Muted color for headings */
}

#offcanvasSidebar .dropdown-toggle::after {
    display: inline-block;
    margin-left: .255em;
    vertical-align: .255em;
    content: "";
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-bottom: 0;
    border-left: .3em solid transparent;
}

/* Main content adjustments for fixed sidebar on larger screens */
@media (min-width: 992px) {

    /* lg breakpoint */
    .main-content-wrapper {
        margin-left: 280px;
        /* Same as sidebar width */
        padding-top: 0;
        /* Remove padding if mobile navbar is hidden */
    }

    #offcanvasSidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 100;
        /* Behind normal navbar but above content */
        padding: 0;
        box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
        /* Make it always visible on large screens, not as an offcanvas */
        transform: none !important;
        /* Override offcanvas transform */
        visibility: visible !important;
        /* Override offcanvas visibility */
    }

    .navbar-toggler {
        /* Hide the mobile toggler on large screens */
        display: none;
    }

    .main-navbar {
        /* Optional top navbar for desktop */
        margin-left: 280px;
        /* Align with content */
        position: sticky;
        /* Or fixed, depending on desired behavior */
        top: 0;
        z-index: 1020;
        /* Above sidebar */
    }

    .main-content-wrapper main.container-fluid {
        /* Add padding top if you have a sticky main-navbar on desktop */
        /* padding-top: 70px; */
    }
}

/* Mobile fixed top navbar (the one with the toggler) */
.navbar.fixed-top.d-lg-none {
    z-index: 1030;
    /* Ensure it's above other content */
}

/* Adjust body padding if the mobile navbar is fixed-top */
body {
    padding-top: 56px;
    /* Default Bootstrap navbar height */
}

@media (min-width: 992px) {
    body {
        padding-top: 0;
        /* Remove padding-top on larger screens as sidebar is fixed */
    }
}

/* Sidebar Tab Styles */
#sidebarTab .nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem; /* Slightly smaller font */
    color: #495057;
    border-top-left-radius: .25rem;
    border-top-right-radius: .25rem;
    border-bottom: none;
}

#sidebarTab .nav-link.active {
    font-weight: bold;
    color: #0d6efd;
    background-color: #f8f9fa; /* Light background for active tab */
    border-color: #dee2e6 #dee2e6 #f8f9fa;
}

#sidebarTabContent {
    border: 1px solid #dee2e6;
    border-top: none;
    padding: 0 0.5rem;
    background-color: #f8f9fa; /* Match active tab background */
}











/* Add this to your project's CSS file, e.g., inventor_custom.css or within a <style> tag in inventor/base.html */

/* Custom styling for the delete checkbox */
.delete-checkbox-label {
    position: relative;
    cursor: pointer;
    font-size: 1.2em;
    /* Adjust size as needed */
    display: inline-flex;
    /* Aligns checkbox and icon nicely */
    align-items: center;
    user-select: none;
    /* Prevents text selection on click */
}

/* Hide the actual checkbox input */
.delete-checkbox-label input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

/* Style for the custom icon */
.delete-checkbox-icon {
    display: inline-block;
    width: 20px;
    /* Adjust size */
    height: 20px;
    /* Adjust size */
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 5px;
    /* Space between icon and (hidden) text if any */
    text-align: center;
    line-height: 18px;
    /* Vertically center content if using text X */
    color: red;
    /* Color for the X */
}

/* Style for the icon when checkbox is checked (red X) */
.delete-checkbox-label input[type="checkbox"]:checked+.delete-checkbox-icon::before {
    content: "\2716";
    /* Unicode for HEAVY MULTIPLICATION X (a cross) */
    /* Alternatively, use an SVG or an icon font */
    font-weight: bold;
}

/* Style for the icon when checkbox is not checked (empty box) */
.delete-checkbox-label input[type="checkbox"]:not(:checked)+.delete-checkbox-icon::before {
    content: "";
    /* Empty for unchecked state, border provides the box */
}

/* Ensure table cells with inputs don't cause excessive height changes */
#bom-elements-table td {
    vertical-align: top;
    /* Align content to the top of the cell */
}

/* Style for designator cell content */
#bom-elements-table td[style*="word-wrap: break-word"] div {
    line-height: 1.2;
    /* Adjust line height for smaller font */
}

/* /Users/duddie/Projects/www/inventor/static/css/custom.css */

/* ... your existing custom CSS ... */

/* DAL Select2 Customizations */
/* Adjust height of Select2 single-select boxes to match Bootstrap's form-control height */
/* Make the Select2 container a block element to take up the full width,
   ensuring it appears below its label, just like a standard Bootstrap form control. */
.select2-container {
    box-sizing: border-box;
    display: block;
    width: 100% !important; /* The !important is often needed to override Select2's inline styles */
    /* This is a global fix for DAL dropdowns appearing behind Bootstrap modals.
       Bootstrap modals have a z-index of ~1050. By setting a higher z-index
       on the Select2 container when it's appended to the body, we ensure
       it always appears on top. */
    z-index: 1055;
}

body .select2-container--default .select2-selection--single {
    height: calc(1.5em + .75rem + 2px);
    /* Matches Bootstrap's .form-control height */
    border: 1px solid #ced4da;
    /* Matches Bootstrap's .form-control border */
    border-radius: .25rem;
    /* Matches Bootstrap's .form-control border-radius */
}

/* Vertically align the text within the Select2 single-select box */
body .select2-container--default .select2-selection--single .select2-selection__rendered {
    /* line-height: calc(1.5em + .75rem); */
    /* Original line-height approach */
    padding-left: .75rem;
    /* Matches Bootstrap's .form-control padding */
    padding-right: 2.25rem;
    /* Space for the arrow */
    display: flex;
    /* Use flexbox for alignment */
    height: 100%;
    /* Make the rendered text area take full height of its parent */
    align-items: center;
    /* Vertically center content */
}

/* Style the dropdown arrow */
body .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(1.5em + .75rem);
    /* Align with inner height of the selection area */
    top: 1px;
    /* Align with border */
    right: 0.5rem;
    /* Position arrow to the far right */
    position: absolute;
    /* Ensure absolute positioning */
}

/* Style the clear 'x' button */
body .select2-container--default .select2-selection--single .select2-selection__clear {
    position: absolute;
    /* Ensure absolute positioning */
    top: 50%;
    right: 2.25rem;
    /* Position it to the left of where the arrow starts (arrow width + its right offset) */
    transform: translateY(-50%);
    margin-top: 0;
    /* Override any conflicting margins */
    font-size: 1.2em;
    /* Optional: adjust size */
    line-height: 1;
    /* Ensure consistent line height for the 'x' */
    cursor: pointer;
    z-index: 1;
    /* Ensure it's clickable and above the rendered text if overlapping occurs */
}

/* Adjustments for when the Select2 dropdown is open */
body .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #86b7fe;
    /* Matches Bootstrap's focus outline color */
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
    /* Matches Bootstrap's focus box-shadow */
}

/* Ensure the search input within the dropdown also looks consistent (optional) */
body .select2-search--dropdown .select2-search__field {
    border: 1px solid #ced4da;
    border-radius: .25rem;
    padding: .375rem .75rem;
    /* Matches Bootstrap's .form-control padding */
}

/* Placeholder text styling (optional, if you want it to match Bootstrap more closely) */
body .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6c757d;
    /* Bootstrap's placeholder color */
}

/* Styling for multi-select (if you use them elsewhere and want consistency) */
body .select2-container--default .select2-selection--multiple {
    border: 1px solid #ced4da;
    border-radius: .25rem;
    padding: .2rem .5rem;
    /* Slightly adjusted padding for multiple items */
}

body .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #0d6efd;
    /* Bootstrap primary color */
    border-color: #0a58ca;
    color: white;
    padding: .1rem .5rem;
    margin-right: .25rem;
    border-radius: .2rem;
}

body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: rgba(255, 255, 255, 0.7);
    margin-left: .25rem;
}

body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: white;
}

/* Custom CSS for Inventor App */

.btn-outline-purple {
    --bs-btn-color: #6f42c1;
    --bs-btn-border-color: #6f42c1;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #6f42c1;
    --bs-btn-hover-border-color: #6f42c1;
    --bs-btn-focus-shadow-rgb: 111, 66, 193;
    /* RGB for #6f42c1 */
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #6f42c1;
    --bs-btn-active-border-color: #6f42c1;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #6f42c1;
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: #6f42c1;
    --bs-gradient: none;
}




.row-marked-for-deletion,
.row-marked-for-deletion td {
    /* Apply to the row AND its cells */
    background-color: #ffdddd !important;
    /* Light red, !important to help override other styles */
}

.partname-results-list .list-group-item.active-result-item {
    /* background-color: #c0daf5; */
    background-color: #c0daf5;
    /* Light blue for modal selection */
}

/* Generic style for a highlighted/active table row, used for keyboard navigation */
tr.active-row>td,
tr.active-row>th {
    background-color: #cfe2ff !important;
    /* Bootstrap's .table-active color */
}

/* Style for focusable tables used in keyboard navigation */
table[tabindex="0"]:focus {
    outline: 2px solid #0d6efd;
    /* Bootstrap primary color */
    outline-offset: 2px;
}


.table-hover .clickable-cell:hover {
    cursor: pointer;
    background-color: #f8f9fa;
}

/* Style for keyboard-navigated active row */
.table-hover .active-row {
    background-color: #cfe2ff;
    /* Bootstrap's primary-light color */
    --bs-table-accent-bg: #cfe2ff;
}