body {
    font-family: 'Open Sans';
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
    font-size: 15px;
    letter-spacing: 0px;
    color: #1f355e;
}

dd {
    margin: 0 0 0 110px;
    padding: 0 0 10px 0;
}

#home_links {
    padding-right: 30px;
}

#user-tools a {
    border-bottom: none;
    font-size: 12px;
    font-weight: bold;
}

#header {
    height: auto;
}

#pie_charts div {
    display: inline-block;
    width: 200px;
}

.dashboard #content {
    width: unset;
    text-align: center;
}

#footer .container span {
    padding-right: 20px;
}

#footer .container {
    text-align: center;
    padding-right: 20px;
}

fieldset.admin-form-fields-2-cols div.form-row div.form-multiline div:not(.flex-container) {
    width: 50%;
    margin-right: 0;
}

fieldset.admin-form-fields-4-cols div.form-row div.form-multiline div:not(.flex-container) {
    width: 25%;
    margin-right: 0;
}

/* Custom for Safer chemicals page */
form#datasheet_form div.field-search div.flex-container {
    flex-direction: column;
}

div.field-supplier_notes div.flex-container{
    flex-direction: column;
}

.required label::after, label.required::after {
    content: "*" !important;
    color: red;
}

/* Navbar */

@media (max-width: 1023px) {
    #header {
        display: flex;
        flex-direction: initial !important;
        padding: 15px 15px;
        height: auto;
        line-height: 1;
    }

    .bu-navbar-link.ellipsis {
        display: none;
    }

    .bd-navbar-search-icon {
        box-sizing: border-box;
        border-width: 0;
        border-style: solid;
        border-color: #e5e7eb;
        background-color: transparent;
        background-image: none;
    }

    /* TODO: Fix the header on mobile */
    /*nav.bu-navbar {*/
    /*    position: fixed;*/
    /*    width: 100%;*/
    /*}*/

    #id_menu_location_mobile, #id_menu_location_mobile + .select2-container {
        min-width: auto;
        width: 250px;
    }

    .bu-navbar-item:has(#id_menu_location) {
        display: none;
    }

    /* Enhanced mobile menu scrolling */
    .bu-navbar-menu.bu-is-active {
        /* Ensure proper scrolling behavior */
        max-height: calc(100vh - 3.25rem);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;

        /* Add visual scrolling indicators */
        background: linear-gradient(white 30%, rgba(255,255,255,0)),
                    linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
                    radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)),
                    radial-gradient(50% 100%, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
        background-repeat: no-repeat;
        background-color: white;
        background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
        background-attachment: local, local, scroll, scroll;

        /* Add subtle border to indicate scrollable area */
        border-left: 3px solid #e5e7eb;
        border-right: 3px solid #e5e7eb;
    }

    /* Style scrollbar for webkit browsers */
    .bu-navbar-menu.bu-is-active::-webkit-scrollbar {
        width: 6px;
    }

    .bu-navbar-menu.bu-is-active::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }

    .bu-navbar-menu.bu-is-active::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    .bu-navbar-menu.bu-is-active::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }
}

@media (max-width: 767px) {
    #header {
        padding: 10px 10px;
    }

    fieldset.admin-form-fields-2-cols div.form-row div.form-multiline div:not(.flex-container), fieldset.admin-form-fields-4-cols div.form-row div.form-multiline div:not(.flex-container) {
        width: 100%;
        margin-right: 0;
    }

    select:not(#id_menu_location, #id_menu_location_mobile) + .select2-container {
        width: 100% !important;
    }

    #id_menu_location_mobile, #id_menu_location_mobile + .select2-container {
        min-width: auto;
        width: 200px;
    }

    .bu-navbar-item:has(#id_menu_location) {
        display: none;
    }
}

@media (max-width: 500px) {
    #header {
        padding: 8px 8px;
    }

    #id_menu_location_mobile, #id_menu_location_mobile + .select2-container {
        min-width: auto;
        width: 120px;
    }

}

#changelist-filter {
    z-index: auto !important;
}

.bu-navbar-link.not-ellipsis {
    display: none;
}

@media (min-width: 1024px) {
    select#id_menu_location {
        height: 26px;
        max-width: 115px;
        width: 115px;
        min-width: 115px;
    }

    select#id_menu_location + .select2-container {
        min-width: 115px;
    }
}

@media (min-width: 1075px) {
    select#id_menu_location {
        height: 26px;
        max-width: 165px;
        width: 165px;
        min-width: 165px;
    }

    select#id_menu_location + .select2-container {
        min-width: 165px;
    }
}

@media (min-width: 1125px) {
    select#id_menu_location {
        height: 26px;
        max-width: 215px;
        width: 215px;
        min-width: 215px;
    }

    select#id_menu_location + .select2-container {
        min-width: 215px;
    }
}

@media (min-width: 1175px) {
    select#id_menu_location {
        height: 26px;
        max-width: 265px;
        width: 265px;
        min-width: 265px;
    }

    select#id_menu_location + .select2-container {
        min-width: 265px;
    }
}

@media (min-width: 1275px) {
    select#id_menu_location {
        height: 26px;
        max-width: 365px;
        width: 365px;
        min-width: 365px;
    }

    select#id_menu_location + .select2-container {
        min-width: 365px;
    }
}

@media screen and (min-width: 1024px) {
    .bd-navbar-search-icon:not(#notification-bell-container-mobile) {
        display: none;
    }

    /* Hide mobile notification bell on desktop when desktop version is available */
    #notification-bell-container-mobile {
        display: none;
    }
}

/* Remove caret/arrow from mobile and tablet notification bell */
@media screen and (max-width: 1023px) {
    #notification-bell-mobile.bu-navbar-link::after,
    #notification-bell-mobile::after {
        display: none !important;
    }

    /* Ensure no dropdown arrow styling */
    #notification-bell-container-mobile .bu-navbar-link::after {
        display: none !important;
    }
}

@media screen and (max-width: 1023px) {
    .bd-search {
        display: none;
        padding-top: 72px;
        margin: 0 auto;
    }
}


/*// Google Identity and Google+ Sign in buttons*/
/*// https://developers.google.com/+/branding-guidelines*/

.google-button {
    height: 40px;

    border-width: 0;
    background: white;
    color: #737373;
    border-radius: 5px;
    white-space: nowrap;
    box-shadow: 1px 1px 0px 1px rgba(0, 0, 0, 0.05);
    transition-property: background-color, box-shadow;
    transition-duration: 150ms;
    transition-timing-function: ease-in-out;
    padding: 0;

    &:focus,
    &:hover {
        box-shadow: 1px 4px 5px 1px rgba(0, 0, 0, 0.1);
    }

    &:active {
        background-color: #e5e5e5;
        box-shadow: none;
        transition-duration: 10ms;
    }
}

.google-button__icon {
    display: inline-block;
    vertical-align: middle;
    margin: 8px 0 8px 8px;
    width: 18px;
    height: 18px;
    box-sizing: border-box;
}

.google-button__icon--plus {
    width: 27px;
}

.google-button__text {
    display: inline-block;
    vertical-align: middle;
    padding: 0 24px;
    font-size: 14px;
    font-weight: bold;
    font-family: 'Roboto', arial, sans-serif;
}


/* Fix: Ensure Select2 multi-select shows selected chips in admin forms */
.select2-container--default .select2-selection--multiple {
  min-height: 32px;
  height: auto !important;
  overflow: visible !important;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  white-space: normal !important;
}

/* select2 */
form#id_search_mobile span.select2-container {
    min-width: auto;
}

/* product col in a list view */
.bd-link {
    border-radius: 6px;
    display: flex;
}

.bd-link-icon {

    flex-grow: 0;
    flex-shrink: 0;
    height: 1.5em;
    margin-right: .5em;
    width: 1.5em;
}

.bd-link-title {
    display: block;
    font-weight: 600;
    line-height: 1.5;
}

.bd-link-subtitle {
    font-size: 13px;
}

/* override label width for avery label printing */
.aligned div#id_size label {
    display: block;
    padding: 4px 10px 0 0;
     width: 100%;
    word-wrap: break-word;
    line-height: 1;
}

/* override driver.js for buttons only */
:not(body):has(> .addlink.driver-active-element) {
    overflow: visible !important;
}

/* Add colour to admin table rows */
#changelist tbody tr.danger {
    background-color: #f2dede;
}

table#result_list tbody tr.warning {
    background-color: #fcf8e3;
}

table#result_list tbody tr.ph-storage-mismatch {
    background-color: #ffc;
}

/* Notification Bell Mobile Responsiveness */

/* Desktop notification bell - visible by default */
#notification-bell-container {
    position: relative;
    display: flex !important;
    align-items: center;
}

/* Show notification dropdown when parent is active (click-based toggle) OR on hover (Bulma's native behavior) */
#notification-bell-container.bu-is-active .bu-navbar-dropdown,
#notification-bell-container.bu-is-hoverable:hover .bu-navbar-dropdown {
    display: block !important;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    max-width: 350px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    position: absolute;
    top: 100%;
    right: 0;
}

/* Ensure notification dropdown content is visible when active */
#notification-bell-container.bu-is-active .bu-navbar-dropdown .bu-navbar-item {
    color: #374151;
    background-color: transparent;
    padding: 0.75rem 1rem;
}

#notification-bell-container.bu-is-active .bu-navbar-dropdown .bu-navbar-item:hover {
    background-color: #f8fafc;
    color: #374151;
}

/*
 * django-reversion-compare diff readability (datasheet History "Compare").
 * reversion_compare.css sets del/ins backgrounds from its --del/--ins vars,
 * which resolve to dark red/green under prefers-color-scheme: dark, but it
 * leaves the diff text at the light-theme foreground colour - so the diff
 * renders dark text on a dark background and is unreadable. Pin readable
 * pastel backgrounds with matching dark text so it stays legible in both
 * light and dark mode. Scoped to reversion-compare's .highlight diff wrappers
 * (pre.highlight for text fields, p.highlight for m2m fields like locations)
 * so ordinary <del>/<ins> elsewhere are untouched.
 */
.highlight del {
    background-color: #fadddd;
    color: #8a1f1f;
}

.highlight ins {
    background-color: #d8f2d8;
    color: #1d6b2c;
}

/* Footer "Contact": spacing for the visible email address next to the link. */
#contact-email-address {
    margin-left: 0.25rem;
}

/* Dropdown "Contact Us": show the address on its own muted line so the */
/* mailto link is never a dead end; wraps instead of widening the menu. */
#nav-contact-email-address {
    display: block;
    font-size: 0.85em;
    opacity: 0.75;
    white-space: normal;
    overflow-wrap: anywhere;
}
