/**
 * Bootstrap Overrides - UCB Branding
 * University of Colorado Boulder styling for Bootstrap 5.3.2
 * Maintains WCAG AA Accessibility Standards
 *
 * NOTE: CSS variables (including Bootstrap overrides) now defined in theme-consolidated.css
 * This file contains ONLY component style overrides for Bootstrap
 */

/* ==========================================================================
   Typography - Roboto Font Family
   ========================================================================== */

html {
    height: 100%;
}

/* Override Bootstrap's :root defaults */
:root {
    scroll-behavior: auto;
    --bs-body-color: var(--text-secondary);
    --bs-secondary-color: var(--text-tertiary);
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    height: 100%;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Roboto Condensed', 'Roboto', sans-serif;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================================
   UCB Header Styles (matching REFERENCE)
   ========================================================================== */

header.ucb {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 20px;
    padding: 15px 0;
    font-weight: 750;
    font-family: "Roboto Condensed", sans-serif;
    line-height: 1.1;
}

header.ucb a {
    text-decoration: none;
}

header.ucb.black {
    background: var(--header-bg);
    color: var(--header-text);
}

header.ucb.black a:link,
header.ucb.black a:visited,
header.ucb.black a:hover {
    color: var(--header-text);
}

.affiliation {
    text-transform: uppercase;
    font-size: 50%;
    padding-top: 5px;
    font-weight: bold;
}

header.ucb.black .affiliation,
header.ucb.black .affiliation a:link,
header.ucb.black .affiliation a:visited {
    color: var(--text-tertiary);
}

@media screen and (min-width: 768px) {
    header.ucb {
        font-size: 30px;
    }
}

/* ==========================================================================
   REFERENCE Utility Classes
   ========================================================================== */

/* Updated to use theme CSS variables for dark mode support */
.background-white {
    background-color: var(--bg-primary);
    color: var(--text-secondary);
}
.background-black {
    background-color: var(--ucb-black);
    color: var(--ucb-white);
}
.background-color-dark-gray-dark {
    background-color: var(--nav-bg); /* Uses #424242 in light mode, #1a1a1a in dark mode */
    overflow: visible; /* Allow dropdowns to extend beyond navbar container */
}
.background-color-gold {
    background-color: var(--ucb-gold);
}

.padding-small { padding: 10px 0; }
.padding-xs-bottom { padding-bottom: 4px; }
.padding-medium-top { padding-top: 1rem; }
.padding-medium-bottom { padding-bottom: 2rem; }
.padding-top { padding-top: 1rem; }
.padding-bottom { padding-bottom: 1rem; }

/* Margin utility classes */
.margin-bottom { margin-bottom: 1rem; }
.margin-top { margin-top: 1rem; }

@media (min-width: 768px) {
    .padding-medium-top { padding-top: 1rem; }
    .padding-medium-bottom { padding-bottom: 3rem; }
    .padding-top { padding-top: 1.5rem; }
    .padding-bottom { padding-bottom: 1.5rem; }
}

.brand-bar {
    padding: 10px 0 10px 0 !important;
}

.brand-bar-white {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* UCB Brand Bar Styling */
.ucb-brand-bar {
    padding: 10px 0;
    width: 100%;
}

.ucb-brand-bar .container-lg {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ucb-brand-bar-white {
    background-color: var(--ucb-white);
    border-bottom: 1px solid var(--border-color);
}

.ucb-brand-bar-black {
    background-color: var(--ucb-black);
}

.ucb-home-link {
    display: inline-flex;
    align-items: center;
}

.ucb-logo {
    height: 24px;
    width: auto;
}

.ucb-search-link {
    display: inline-flex;
    align-items: center;
}

.ucb-search {
    height: 20px;
    width: 20px;
}

/* Mobile brand bar and header dimensions (match colorado.edu) */
@media (max-width: 767px) {
    .ucb-brand-bar {
        padding: 10px 0;
    }

    header.ucb {
        padding: 6px 0;
    }

    .ucb-logo {
        height: 18px;
    }

    .ucb-search {
        height: 16px;
        width: 16px;
    }
}

/* Dark mode brand bar: show/hide variants based on theme */
/* Light mode: show white variant, hide black variant */
.brand-bar-light-mode {
    display: flex;
}

.brand-bar-dark-mode {
    display: none;
}

/* Dark mode: hide white variant, show black variant */
[data-theme="dark"] .brand-bar-light-mode {
    display: none !important;
}

[data-theme="dark"] .brand-bar-dark-mode {
    display: flex !important;
}

/* Bootstrap Button Overrides - Use theme variables */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-success,
.btn-info {
    font-weight: 600 !important; /* Bold text for all buttons */
    /* Fix sub-pixel rendering artifacts at rounded corners */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn-primary {
    background-color: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
    border-color: var(--btn-primary-border) !important;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background-color: var(--btn-primary-hover-bg) !important;
    color: var(--btn-primary-hover-text) !important;
    border-color: var(--btn-primary-hover-border) !important;
}

.btn-primary:active {
    background-color: var(--btn-primary-active-bg) !important;
}

.btn-secondary {
    background-color: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-text) !important;
    border-color: var(--btn-secondary-border) !important;
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background-color: var(--btn-secondary-hover-bg) !important;
    color: var(--btn-secondary-hover-text) !important;
}

.btn-secondary:active {
    background-color: var(--btn-secondary-active-bg) !important;
}

.btn-danger {
    background-color: var(--btn-danger-bg) !important;
    color: var(--btn-danger-text) !important;
    border-color: var(--btn-danger-border) !important;
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background-color: var(--btn-danger-hover-bg) !important;
    color: var(--btn-danger-hover-text) !important;
}

.btn-danger:active {
    background-color: var(--btn-danger-active-bg) !important;
}

.btn-success {
    background-color: var(--btn-success-bg) !important;
    color: var(--btn-success-text) !important;
    border-color: var(--btn-success-border) !important;
}

.btn-success:hover,
.btn-success:focus-visible {
    background-color: var(--btn-success-hover-bg) !important;
    color: var(--btn-success-hover-text) !important;
}

.btn-success:active {
    background-color: var(--btn-success-active-bg) !important;
}

.btn-info {
    background-color: var(--btn-info-bg) !important;
    color: var(--btn-info-text) !important;
    border-color: var(--btn-info-border) !important;
}

.btn-info:hover,
.btn-info:focus-visible {
    background-color: var(--btn-info-hover-bg) !important;
    color: var(--btn-info-hover-text) !important;
}

.btn-info:active {
    background-color: var(--btn-info-active-bg) !important;
}

.btn-warning {
    background-color: var(--btn-warning-bg) !important;
    color: var(--btn-warning-text) !important;
    border-color: var(--btn-warning-border) !important;
    /* Fix sub-pixel rendering artifacts at rounded corners */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn-warning:hover,
.btn-warning:focus-visible {
    background-color: var(--btn-warning-hover-bg) !important;
    color: var(--btn-warning-text) !important;
}

.btn-warning:active {
    background-color: var(--btn-warning-active-bg) !important;
}

.text-nav { font-weight: 600; font-family: "Roboto", sans-serif; }

.background-black a:link,
.background-black a:visited {
    color: var(--ucb-white);
}

/* Page wrapper */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content spacing before footer */
main#main-content {
    margin-bottom: 4rem; /* Add spacing before footer */
    flex: 1; /* Allow main to grow and push footer down */
}

/* Main content area - grow to fill available space, pushing footer to bottom */
/* Target only the main content wrapper, not the brand bar */
.page > .background-white.padding-medium-top {
    flex: 1 0 auto;
}

/* ==========================================================================
   Navbar - UCB Custom Navigation (matching REFERENCE implementation)
   ========================================================================== */

.ucb-navbar {
    font-weight: 600;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    position: relative;
    overflow: visible; /* Allow dropdowns to extend beyond navbar */
}

.ucb-navbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* Prevent wrapping on desktop and tablet - keep navbar on one row */
@media (min-width: 768px) {
    .ucb-navbar ul {
        flex-wrap: nowrap;
    }
}

.ucb-navbar ul li {
    margin: 0;
    padding: 0;
    display: inline-block;
}

.ucb-navbar a:link,
.ucb-navbar a:visited {
    display: inline-block;
    padding: 10px;
    color: var(--nav-text) !important;
    text-decoration: none !important;
    border-bottom: none !important;
    transition: background-color 0.2s, color 0.2s;
}

.ucb-navbar a:visited {
    color: var(--nav-text) !important;
}

/* Dark grey navbar variant */
.ucb-navbar.ucb-navbar-dark-grey {
    background: var(--nav-bg); /* Uses theme variable: #424242 in light, #1a1a1a in dark */
}

.ucb-navbar.ucb-navbar-dark-grey a:link,
.ucb-navbar.ucb-navbar-dark-grey a:visited {
    color: var(--nav-text) !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Desktop-only: active/hover states with gold background badges */
@media (min-width: 768px) {
    .ucb-navbar.ucb-navbar-dark-grey a:link.active,
    .ucb-navbar.ucb-navbar-dark-grey a:visited.active {
        color: var(--nav-active-text) !important;
        font-weight: bold;
        background: var(--nav-active-bg);
        text-decoration: none !important;
        border-bottom: none !important;
    }

    .ucb-navbar.ucb-navbar-dark-grey a:hover {
        color: var(--nav-text-hover) !important;
        background: var(--nav-dropdown-hover-bg);
        text-decoration: none !important;
        border-bottom: none !important;
    }

    /* Dropdown trigger span - persistent gold background when active */
    .ucb-navbar.ucb-navbar-dark-grey .dropdown > span.active {
        color: var(--nav-active-text) !important;
        font-weight: bold;
        background: var(--nav-active-bg);
    }

    .ucb-navbar.ucb-navbar-dark-grey .dropdown > span.active:hover {
        color: var(--nav-active-text) !important;
        background: var(--nav-active-bg);
    }

    /* Dropdown trigger link - persistent gold background when active */
    .ucb-navbar.ucb-navbar-dark-grey .dropdown > a.active {
        color: var(--nav-active-text) !important;
        font-weight: bold;
        background: var(--nav-active-bg);
    }

    .ucb-navbar.ucb-navbar-dark-grey .dropdown > a.active:hover {
        color: var(--nav-active-text) !important;
        background: var(--nav-active-bg);
    }

    .ucb-navbar.ucb-navbar-dark-grey .dropdown > span:hover {
        color: var(--nav-text-hover) !important;
        background: var(--nav-dropdown-hover-bg);
    }

    /* Align home icon with text baseline in desktop navbar */
    .ucb-navbar .nav-home-icon {
        position: relative;
        top: -2px;
    }
}

/* Dropdown navigation - Matching REFERENCE implementation */
.ucb-navbar .dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown trigger - span element (non-clickable) */
.ucb-navbar .dropdown > span {
    display: inline-block;
    padding: 10px;
    color: var(--nav-text) !important;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.ucb-navbar.ucb-navbar-dark-grey .dropdown > span {
    color: var(--nav-text) !important;
}

.ucb-navbar .dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--nav-dropdown-bg);
    min-width: 220px;
    width: max-content;
    max-height: 80vh; /* Use viewport-based height - simpler and more reliable */
    overflow-y: auto; /* Enable vertical scrolling when content is too tall */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.3);
    z-index: 10000; /* Must be higher than sticky-header-container (z-index: 1000) */
    left: 0;
    top: 100%;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: thin; /* Firefox thin scrollbar */
    scrollbar-color: var(--ucb-gold) var(--nav-dropdown-bg); /* Firefox scrollbar colors */
    /* Fix sub-pixel rendering artifacts at rounded corners */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Webkit scrollbar styling for dropdown (Chrome, Safari, Edge) */
.ucb-navbar .dropdown-content::-webkit-scrollbar {
    width: 6px;
}

.ucb-navbar .dropdown-content::-webkit-scrollbar-track {
    background: var(--nav-dropdown-bg);
}

.ucb-navbar .dropdown-content::-webkit-scrollbar-thumb {
    background: var(--ucb-gold);
    border-radius: 3px;
}

.ucb-navbar .dropdown-content::-webkit-scrollbar-thumb:hover {
    background: var(--ucb-gold-dark);
}

/* Right-aligned dropdowns (for user menu) */
.right-links .dropdown .dropdown-content {
    left: auto;
    right: 0;
}

.ucb-navbar .dropdown-content a {
    color: var(--nav-text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    border-bottom: none !important;
    transition: all 0.2s;
    white-space: nowrap;
}

/* Desktop-only: dropdown content hover/active gold styles */
@media (min-width: 768px) {
    .ucb-navbar .dropdown-content a:hover {
        background-color: var(--nav-dropdown-hover-bg);
    }

    .ucb-navbar .dropdown-content a.active {
        background-color: var(--nav-active-bg);
        color: var(--nav-active-text) !important;
        font-weight: bold;
    }
}

.ucb-navbar .dropdown-content hr {
    margin: 8px 0;
    border: 0;
    border-top: 1px solid var(--border-color);
}

/* Desktop-only: show dropdowns on hover and keyboard focus */
@media (min-width: 768px) {
    .ucb-navbar .dropdown:hover .dropdown-content {
        display: block;
    }

    /* Keyboard navigation support for dropdown */
    .ucb-navbar .dropdown:focus-within .dropdown-content {
        display: block;
    }
}

.ucb-navbar .dropdown-content a:focus-visible {
    outline: 3px solid var(--ucb-gold);
    outline-offset: -3px;
}

/* Mobile responsive dropdown */
@media (max-width: 768px) {
    .ucb-navbar .dropdown-content {
        position: static;
        display: none;
        background-color: var(--nav-dropdown-bg);
        box-shadow: none;
    }

    .ucb-navbar .dropdown.mobile-open .dropdown-content {
        display: block;
    }
}

/* Logout button in navbar */
.logout-link-button {
    background: transparent;
    border: none;
    color: var(--nav-text) !important;
    cursor: pointer;
    padding: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: inherit;
    font-weight: 600;
    text-decoration: none;
}

.logout-link-button:hover {
    color: var(--nav-text-hover) !important;
    background: var(--nav-dropdown-hover-bg);
}

.logout-link-button:active {
    color: var(--nav-active-text) !important;
    font-weight: bold;
    background: var(--nav-active-bg);
}

/* Right-aligned links */
.right-links {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%; /* Full navbar height */
    display: flex;
    align-items: stretch; /* Stretch children to full height */
}

.right-links li {
    display: flex;
    align-items: stretch; /* Stretch children to full height */
}

/* Responsive styles for mobile - only apply when mobile menu is active */
@media (max-width: 767px) {
    .ucb-navbar ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .right-links {
        position: static;
    }

    .right-links li {
        display: block;
    }
}

/* ==========================================================================
   Skip Links - Accessibility
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--ucb-gold);
    color: var(--ucb-black);
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 700;
    z-index: 100;
    border-radius: 0 0 4px 0;
}

.skip-link:focus-visible {
    top: 0;
    outline: 3px solid var(--ucb-black);
    outline-offset: 2px;
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    background: var(--ucb-dark-gray);
    color: var(--ucb-white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
    z-index: var(--z-sticky);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: bold;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover,
.back-to-top:focus-visible {
    background: var(--ucb-gold);
    color: var(--ucb-black);
    outline: 2px solid var(--ucb-gold);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.main-content {
    min-height: 60vh;
    padding: 2rem 0;
}

@media (min-width: 768px) {
    .main-content {
        padding: 3rem 0;
    }
}

/* ==========================================================================
   Footer Styles (matching goal-footer.png)
   ========================================================================== */

footer.background-black {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    border-top: var(--border-3) solid var(--ucb-gold);
}

/* Force left alignment on all footer columns */
footer.background-black [class*="col-"] {
    text-align: left !important;
}

footer.background-black [class*="col-"] > * {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.footer-heading {
    color: var(--ucb-gold);
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.footer-subheading {
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    margin-top: 0;
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-link {
    color: var(--ucb-gold) !important;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--footer-text) !important;
    text-decoration: none;
}

/* UCB Footer "Be Boulder" Column */
.ucb-footer {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.ucb-footer p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.ucb-footer a {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

.ucb-footer-be-boulder {
    display: block;
    max-width: 240px;
    height: auto;
    margin-bottom: 1rem;
    margin-left: 0 !important;
    margin-right: auto;
    text-align: left !important;
}

.ucb-footer img {
    margin-left: 0 !important;
    margin-right: auto;
    text-align: left !important;
}

.ucb-home-link {
    color: var(--ucb-white) !important;
    text-decoration: underline;
    font-weight: normal;
    display: inline;
    text-align: left !important;
}

.ucb-home-link:hover {
    color: var(--ucb-white) !important;
    text-decoration: none !important;
}

.ucb-info-footer-links {
    font-size: 0.85rem;
    text-align: left !important;
}

.ucb-info-footer-links a {
    text-align: left !important;
}

.footer-link-small {
    color: var(--ucb-white) !important;
    text-decoration: none;
}

.footer-link-small:hover {
    color: var(--ucb-white) !important;
    text-decoration: none;
}

/* Footer left column styling */
footer.background-black .content {
    text-align: left !important;
}

footer.background-black .block-title {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

footer.background-black .block-title strong {
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

footer.background-black .block-title a {
    color: var(--ucb-gold);
    text-decoration: none;
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
}

footer.background-black .block-title a:hover {
    color: var(--footer-link-hover);
    text-decoration: none;
}

/* Footer widget - ensure left alignment for Be Boulder column */
footer.background-black #ucb-footer-embed,
footer.background-black [id^="ucb-footer"] {
    text-align: left;
}

/* Override any center alignment from widget */
footer.background-black [id^="ucb-footer"] p,
footer.background-black [id^="ucb-footer"] div {
    text-align: left !important;
}

/* Override widget link colors to gold - multiple selectors to ensure override */
footer.background-black a,
footer.background-black a:link,
footer a,
footer a:link {
    color: var(--ucb-gold) !important;
    text-decoration: none !important;
}

footer.background-black a:visited,
footer a:visited {
    color: var(--ucb-gold) !important;
    text-decoration: none !important;
}

footer.background-black a:hover,
footer.background-black a:focus-visible,
footer a:hover,
footer a:focus-visible {
    color: var(--footer-link-hover) !important;
    text-decoration: none !important;
}

/* Specific overrides for any widget-generated content */
footer [class*="ucb"] a,
footer [id*="ucb"] a,
footer div a,
footer p a {
    color: var(--ucb-gold) !important;
}

footer [class*="ucb"] a:hover,
footer [id*="ucb"] a:hover,
footer div a:hover,
footer p a:hover {
    color: var(--footer-link-hover) !important;
    text-decoration: none !important;
}

/* ==========================================================================
   Nav Tabs - Use site text colors instead of Bootstrap link blue
   ========================================================================== */

.nav-tabs .nav-link {
    color: var(--text-secondary);
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary);
}

.nav-tabs .nav-link.active {
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   Buttons - UCB Gold Accent and Consistent Vertical Alignment
   ========================================================================== */

/* Ensure consistent vertical alignment for all buttons */
.btn,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    vertical-align: middle;
    /* Fix sub-pixel rendering artifacts at rounded corners */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn-ucb-gold {
    background-color: var(--ucb-gold);
    border-color: var(--ucb-gold);
    color: var(--ucb-black);
    font-weight: 600;
    /* Fix sub-pixel rendering artifacts at rounded corners */
    transform: translateZ(0);
    backface-visibility: hidden;
}

.btn-ucb-gold:hover,
.btn-ucb-gold:focus-visible {
    background-color: var(--ucb-gold-dark);
    border-color: var(--ucb-gold-dark);
    color: var(--ucb-black);
}

/* ==========================================================================
   Alert/Message Overrides
   ========================================================================== */

.alert {
    border-left: 4px solid;
    border-radius: 0.375rem;
    position: relative;
}

.alert .btn-close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
}

.alert-success {
    border-left-color: var(--alert-success-border);
}

.alert-danger, .alert-error {
    background-color: var(--alert-danger-bg) !important;
    color: var(--alert-danger-text) !important;
    border-left-color: var(--alert-danger-border) !important;
}

.alert-warning {
    border-left-color: var(--alert-warning-border);
}

.alert-info {
    border-left-color: var(--alert-info-border);
}

/* ==========================================================================
   Form Focus States - UCB Gold
   ========================================================================== */

.form-control:focus-visible,
.form-select:focus-visible {
    border-color: var(--ucb-gold);
    box-shadow: 0 0 0 0.25rem rgba(207, 184, 124, 0.25);
}

/* ==========================================================================
   Badge Overrides
   ========================================================================== */

.badge {
    font-weight: 600;
}

/* ==========================================================================
   Accessibility - Focus States
   NOTE: Focus styles defined in accessibility.css per DESIGN_SYSTEM.md
   This file only contains Bootstrap-specific focus overrides
   ========================================================================== */

/* Remove Bootstrap's default blue box-shadow on focus */
.btn:focus-visible,
.btn:active:focus-visible,
.btn.active:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    box-shadow: none !important;
}

/* Allow accessibility.css focus styles to take precedence */

/* ==========================================================================
   Loading States
   ========================================================================== */

.spinner-border-ucb {
    border-color: var(--ucb-gold);
    border-right-color: transparent;
}

/* ==========================================================================
   Breadcrumbs - Matching REFERENCE Design (ucb-styles.css)
   ========================================================================== */

/* Breadcrumb container - matching REFERENCE */
nav ol.breadcrumbs {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Breadcrumb items - inline display */
nav ol.breadcrumbs li {
    display: inline;
    margin: 0;
    padding: 0;
}

/* Chevron separator after each item (except last) - matching REFERENCE */
nav ol.breadcrumbs li:after {
    padding: 0 5px 0 8px;
    content: "\203A";  /* › character */
    opacity: 0.6;
}

/* No separator after last item */
nav ol.breadcrumbs li:last-child:after {
    content: none;
    padding: 0;
}

/* Remove any default breadcrumb separators that might be added by Bootstrap or other frameworks */
nav[aria-label="breadcrumb" i]::before,
nav ol.breadcrumbs::before,
nav ol.breadcrumbs li:first-child::before {
    content: none !important;
    display: none !important;
}

/* Override Bootstrap's breadcrumb-item divider (Bootstrap adds "/" by default) */
nav ol.breadcrumbs .breadcrumb-item::before {
    content: none !important;
    display: none !important;
}

/* Ensure our chevron separator is used instead for breadcrumb-item class */
nav ol.breadcrumbs li.breadcrumb-item:after {
    padding: 0 5px 0 8px;
    content: "\203A";  /* › character */
    opacity: 0.6;
}

/* No separator after last breadcrumb-item */
nav ol.breadcrumbs li.breadcrumb-item:last-child:after {
    content: none;
    padding: 0;
}

/* Breadcrumb links - blue color */
nav ol.breadcrumbs li a {
    color: var(--color-link);
    text-decoration: none;
}

nav ol.breadcrumbs li a:hover {
    color: var(--color-link-hover);
    text-decoration: underline;
}

nav ol.breadcrumbs li a:visited {
    color: var(--color-link-visited);
}

/* Active/current page - consistent styling for both .active and .breadcrumb-item.active */
nav ol.breadcrumbs li.active,
nav ol.breadcrumbs li.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: normal;
    text-decoration: none;
    border-bottom: none;
}

/* Remove Bootstrap's breadcrumb-item underline/border */
nav ol.breadcrumbs .breadcrumb-item.active {
    border-bottom: none;
}

/* Responsive breadcrumbs */
@media (max-width: 768px) {
    nav ol.breadcrumbs {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   Responsive Utilities
   ========================================================================== */

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--ucb-dark-gray);
        padding: 1rem;
        margin-top: 0.5rem;
        border-radius: 0.375rem;
    }
}

/* ==========================================================================
   Form Controls - Checkboxes
   ========================================================================== */

/* Ensure checkbox checkmarks are visible in dark mode */
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--ucb-gold) !important;
    border-color: var(--ucb-gold) !important;
}

[data-theme="dark"] .form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e") !important;
}

/* ==========================================================================
   DARK MODE OVERRIDES
   ========================================================================== */

/* Breadcrumbs in dark mode - consistent styling */
[data-theme="dark"] nav ol.breadcrumbs li.active,
[data-theme="dark"] nav ol.breadcrumbs li.breadcrumb-item.active {
    color: var(--text-primary) !important;
    font-weight: normal !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

[data-theme="dark"] .breadcrumbs .breadcrumb-item.active,
[data-theme="dark"] .breadcrumbs .active {
    color: var(--text-primary) !important;
    font-weight: normal !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

[data-theme="dark"] nav ol.breadcrumbs .breadcrumb-item.active {
    border-bottom: none !important;
}

/* Keyboard shortcut indicators */
kbd {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    padding: 0.15em 0.4em;
    font-size: 0.875em;
    font-family: inherit;
    box-shadow: inset 0 -1px 0 var(--border-color);
    white-space: nowrap;
}

/* Theme-aware links - explicit class for guaranteed styling */
.theme-link {
    color: var(--color-link) !important;
}

.theme-link:visited {
    color: var(--color-link-visited) !important;
}

.theme-link:hover {
    color: var(--color-link-hover) !important;
    text-decoration: underline;
}

.theme-link:active {
    color: var(--color-link-active) !important;
}

/* ==========================================================================
   Dropdown Menu - Accessible Action Buttons
   Mobile-friendly dropdown for equipment instance actions
   ========================================================================== */

.action-dropdown {
    position: relative;
    display: inline-block;
}

/* Action button trigger */
.action-dropdown-toggle {
    background-color: var(--ucb-gold);
    border: 1px solid var(--ucb-gold-dark);
    color: var(--ucb-black);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-dropdown-toggle:hover {
    background-color: var(--ucb-gold-dark);
    text-decoration: none;
    color: var(--ucb-black);
}

.action-dropdown-toggle:focus-visible {
    outline: 2px solid var(--ucb-gold);
    outline-offset: 2px;
}

/* Dropdown menu */
.action-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: var(--z-dropdown);
    width: 160px;
    padding: 0 !important;
    margin: 0 !important;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: none !important;
    flex-direction: column !important;
    gap: 0 !important;
    overflow: visible !important;
}

.action-dropdown-menu.show {
    display: flex !important;
}

/* Dark mode dropdown styling */
[data-theme="dark"] .action-dropdown-menu {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

/* Dropdown menu items */
.action-dropdown-item {
    flex: 0 0 auto !important;
    padding: 0.75rem 1rem !important;
    font-weight: 400;
    color: var(--text-primary) !important;
    text-align: left !important;
    background-color: transparent !important;
    border: none !important;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.875rem;
    margin: 0 !important;
    line-height: 1.4 !important;
    white-space: nowrap;
    appearance: none;
    -webkit-appearance: none;
}

.action-dropdown-item:hover {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.action-dropdown-item:focus-visible {
    outline: 2px solid var(--ucb-gold);
    outline-offset: -2px;
}

/* Separator in dropdown */
.action-dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .action-dropdown-divider {
    border-top-color: var(--border-color);
}

/* Danger action item (Delete) */
.action-dropdown-item.action-danger {
    color: var(--color-danger);
}

.action-dropdown-item.action-danger:hover {
    background-color: var(--alert-danger-bg);
    color: var(--alert-danger-text);
}

[data-theme="dark"] .action-dropdown-item.action-danger:hover {
    background-color: var(--color-danger-dark);
    color: var(--alert-danger-bg);
}

/* Ensure links and buttons in dropdown display correctly */
.action-dropdown-menu a,
.action-dropdown-menu button {
    display: block !important;
    width: 100% !important;
    padding: 0.5rem 1rem !important;
    text-align: left !important;
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    margin: 0 !important;
    font-size: 0.875rem;
    cursor: pointer;
}

/* ==========================================================================
   Markdown List Styling - AI Cart Chat Messages
   Override Bootstrap's list resets for markdown-rendered content
   ========================================================================== */

/* Override Bootstrap's list-style reset for markdown content */
.chat-message-content ul,
.chat-message-content ol {
    margin: 0.5em 0 !important;
    padding-left: 1.5em !important;
    display: block !important;
}

.chat-message-content ul {
    list-style-type: disc !important;
    list-style-position: outside !important;
}

.chat-message-content ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
}

.chat-message-content li {
    margin: 0.25em 0 !important;
    display: list-item !important;
}

/* Ensure proper paragraph spacing in markdown content */
.chat-message-content p {
    margin: 0.5em 0;
}

.chat-message-content p:first-child {
    margin-top: 0;
}

.chat-message-content p:last-child {
    margin-bottom: 0;
}
