html {
    font-size: 16px;
}

:root {
    /* Light theme variables */
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f5f5;
    --text-primary: #000000;
    --text-secondary: #333333;
    --text-muted: #666666;
    --border-color: #e0e0e0;
    --card-bg: #ffffff;
    --card-border: 2px solid lightslategray;
    --card-border-current: 2px solid #614bb4;
    --card-bg-current: #f8f9ff;
    --scrollbar-track: #f0f0f0;
    --scrollbar-thumb: #614BB4;
    --scrollbar-thumb-hover: #4B37A4;
    --link-hover-color: #0058dc;
    --link-color: #0724ff;
    --primary-purple: #614BB4; 
    --secondary-purple: #aea2d6;
    --tertiary-purple: #9383c9;
    --ripple-color: #ffd700;
    --success: green;
    --danger: red;
    --warning: #ffa500;
  }
  
  [data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --bg-tertiary: #2d2d2d;
    --bg-light: #2d2d2d;
    --text-primary: #D7DADC;
    --text-secondary: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-color: #404040;
    --card-bg: #1e1e1e;
    --card-border: 2px solid #404040;
    --card-border-current: 2px solid #b0b0b0;
    --card-bg-current: #2d2d2d;
    --scrollbar-track: #2d2d2d;
    --scrollbar-thumb: #404040;
    --scrollbar-thumb-hover: #b0b0b0;
    --link-hover-color: #a5c8ff;
    --link-color: #82aaff;
    --primary-purple: #2a3236;
    --secondary-purple: #8a8a8a;
    --tertiary-purple: #757575;
    --ripple-color: #ffd700;
    --success: #029209;
    --danger: #d93f29;
    --warning: #db8e00;
  }
  
  /* Update existing styles to use CSS variables */
body {
    overflow-x: hidden;
    padding-right: 0px !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.01em !important;
    line-height: 1.43 !important;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] a {
    color: #82aaff;
    text-decoration: none;
    transition: color 0.2s;
  }
  [data-theme="dark"] a:hover {
    color: #a5c8ff;
  }

/* Ensure html also has dark background with comprehensive coverage */
[data-theme="dark"] html {
    background-color: var(--bg-primary) !important;
    min-height: 100% !important;
    height: 100% !important;
}

[data-theme="dark"] body {
    background-color: var(--bg-primary) !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure root element and any potential white backgrounds are dark */
[data-theme="dark"] #root:not(.login-card) {
    background-color: var(--bg-primary) !important;
    min-height: 100vh !important;
}

[data-theme="dark"] * {
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track) !important;
}

/* Fix any potential viewport or container backgrounds */
[data-theme="dark"] .container,
[data-theme="dark"] .container-fluid {
    background-color: transparent !important;
}

/* Targeted fixes for white background when dropdown opens */
[data-theme="dark"] .react-select__menu-portal {
    background-color: transparent !important;
}

/* Ensure body stays dark when react-select dropdown is open */
[data-theme="dark"] body:has(.react-select__menu--is-open) {
    background-color: var(--bg-primary) !important;
}

/* Alternative fix for browsers that don't support :has() */
[data-theme="dark"] body.react-select-menu-open {
    background-color: var(--bg-primary) !important;
}

/*Create a dark backdrop behind everything */
[data-theme="dark"]::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: -999999;
    pointer-events: none;
}

/* Light mode backdrop to ensure consistent background */
[data-theme="light"]::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: -999999;
    pointer-events: none;
}
  
  /* Material-UI component dark mode overrides */
[data-theme="dark"] .MuiPaper-root {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}


[data-theme="dark"] .MuiCard-root:not(.product-info-panel):not(.availableCashbackButton):not(.single-reverse-search-card) {
    background-color: var(--card-bg) !important;
    color: var(--text-primary);
}

[data-theme="dark"] .MuiTextField-root .MuiInputBase-root {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: #D7DADC !important;
}

[data-theme="dark"] .MuiTextField-root .MuiOutlinedInput-notchedOutline {
    border-color: #D7DADC!important;
}

[data-theme="dark"] .MuiTextField-root .MuiInputBase-root:hover .MuiOutlinedInput-notchedOutline {
    border-color: #D7DADC !important;
}

[data-theme="dark"] .MuiTextField-root .MuiInputBase-root.Mui-focused .MuiOutlinedInput-notchedOutline {
    border-color: white !important;
}

[data-theme="dark"] .MuiInputLabel-root {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .MuiInputLabel-root.Mui-focused {
    color: white !important;
}

/* Custom TextField styling - border with label positioned in border */
.custom-textfield {
    position: relative;
    margin-top: 8px;
    margin-bottom: 16px;
}

/* Ensure no Material-UI styles interfere with custom textfield */
.custom-textfield * {
    box-sizing: border-box !important;
}

.custom-textfield fieldset {
    display: none !important;
}

.custom-textfield .MuiOutlinedInput-notchedOutline {
    display: none !important;
}

.custom-textfield .custom-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #D7DADC;
    border-radius: 0px;
    background-color: white;
    font-size: 16px;
    color: var(--text-primary);
    transition: none;
    height: 48px;
    box-sizing: border-box;
    /* Ensure no Material-UI interference */
    font-family: inherit !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.custom-textfield .custom-input:focus {
    outline: none;
    border-color: #1976d2;
    border-width: 2px;
}

.custom-textfield .custom-label {
    position: absolute;
    top: -5.75px;
    left: 16px;
    background: linear-gradient(var(--bg-primary) 50%, #ffffff 50%);
    padding: 0 8px;
    font-size: 13px;
    color: #757575;
    transition: none;
    pointer-events: none;
    z-index: 3;
    line-height: 1;
    font-weight: 400;
}

.custom-textfield:focus-within .custom-label {
    color: #1976d2 !important;
}

/* Dark mode custom TextField */
[data-theme="dark"] .custom-textfield .custom-input {
    border-color: var(--text-secondary);
    color: var(--text-primary);
    background-color: var(--bg-tertiary)
}

[data-theme="dark"] .custom-textfield .custom-input:focus {
    border-color: #ffffff;
}

[data-theme="dark"] .custom-textfield .custom-label {
    color: var(--text-secondary);
    background: linear-gradient(#121212 50%, #2d2d2d 50%);
}

[data-theme="dark"] .custom-textfield .custom-label:focus {
    color: var(--text-primary);
}

[data-theme="dark"] .custom-textfield:focus-within .custom-label {
    color: #ffffff !important;
}

[data-theme="dark"] .MuiSelect-root {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiSelect-select {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: #D7DADC !important;
}

[data-theme="dark"] .MuiOutlinedInput-notchedOutline {
    border-color: #D7DADC !important;
}

[data-theme="dark"] .MuiSelect-root:hover .MuiOutlinedInput-notchedOutline {
    border-color: #D7DADC !important;
}

[data-theme="dark"] .MuiSelect-root.Mui-focused .MuiOutlinedInput-notchedOutline {
    border-color: white !important;
}

/* Text field underlines for standard/filled variants */
[data-theme="dark"] .MuiInput-underline:before {
    border-bottom-color: #D7DADC !important;
}

[data-theme="dark"] .MuiInput-underline:hover:not(.Mui-disabled):before {
    border-bottom-color: #D7DADC !important;
}

[data-theme="dark"] .MuiInput-underline:after {
    border-bottom-color: #1e252c !important;
}

[data-theme="dark"] .MuiFilledInput-underline:before {
    border-bottom-color: #D7DADC !important;
}

[data-theme="dark"] .MuiFilledInput-underline:hover:not(.Mui-disabled):before {
    border-bottom-color: #D7DADC !important;
}

[data-theme="dark"] .MuiFilledInput-underline:after {
    border-bottom-color: #1e252c !important;
}

/* Dropdown arrows */
[data-theme="dark"] .MuiSelect-icon {
    color: #D7DADC !important;
}

[data-theme="dark"] .MuiSelect-iconOpen {
    color: var(--text-muted) !important;
}

/* Input adornments (£, %, etc.) */
[data-theme="dark"] .MuiInputAdornment-root {
    color: #D7DADC !important;
}

[data-theme="dark"] .MuiInputAdornment-root .MuiTypography-root {
    color: #D7DADC !important;
}

[data-theme="dark"] .InputAdornment {
    color: #D7DADC !important;
}

/* Any text inside input fields */
[data-theme="dark"] .MuiInputBase-input::placeholder {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

/* Input field text content */s
[data-theme="dark"] .MuiInputBase-input {
    color: var(--text-primary) !important;
}

/* Disabled input field text content (for SAS Key, etc.) */
[data-theme="dark"] .MuiInputBase-input.Mui-disabled {
    color: #919191 !important;
    -webkit-text-fill-color: #919191 !important; /* Override browser default */
}

/* Accordion arrows and expansion icons */
[data-theme="dark"] .MuiAccordion-root {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiAccordionSummary-expandIconWrapper {
    color: #D7DADC !important;
}

[data-theme="dark"] .MuiExpandMoreIcon-root {
    color: #D7DADC !important;
}

/* More specific SVG icon styling - exclude sliders and colored icons */
[data-theme="dark"] .MuiAccordionSummary-root .MuiSvgIcon-root:not(.dashboardQuickLinkIcon),
[data-theme="dark"] .MuiIconButton-root .MuiSvgIcon-root:not(.dashboardQuickLinkIcon),
[data-theme="dark"] .MuiListItemIcon-root .MuiSvgIcon-root:not(.dashboardQuickLinkIcon),
[data-theme="dark"] .MuiButton-root .MuiSvgIcon-root:not(.dashboardQuickLinkIcon) {
    color: #D7DADC !important;
}

 .MuiIconButton-root.sourcing-list-active .MuiSvgIcon-root {
    color: var(--success) !important;
}

/* Override for sourcing list active state */
[data-theme="dark"] .MuiIconButton-root.sourcing-list-active .MuiSvgIcon-root {
    color: var(--success) !important;
}

/* Override for mismatch reported state */
.MuiIconButton-root.mismatch-reported .MuiSvgIcon-root {
    color: var(--danger) !important;
}

/* Override for mismatch reported state */
[data-theme="dark"] .MuiIconButton-root.mismatch-reported .MuiSvgIcon-root {
    color: var(--danger) !important;
}

/* Preserve thumbs up/down icons colors */
[data-theme="dark"] .text-success .MuiSvgIcon-root {
    color: inherit !important;
}

[data-theme="dark"] .text-danger .MuiSvgIcon-root {
    color: inherit !important;
}

[data-theme="dark"] .text-warning .MuiSvgIcon-root {
    color: inherit !important;
}

/* Deal Score Settings and help icons - reduced specificity to allow inline styles to override */
[data-theme="dark"] h1:not([style*="color"]), 
[data-theme="dark"] h2:not([style*="color"]), 
[data-theme="dark"] h3:not([style*="color"]), 
[data-theme="dark"] h4:not([style*="color"]), 
[data-theme="dark"] h5:not([style*="color"]), 
[data-theme="dark"] h6:not([style*="color"]) {
    color: var(--text-primary);
}

/* Preserve colors for headings inside divs with inline color styling (profit/ROI) */
[data-theme="dark"] div[style*="color"] h6,
[data-theme="dark"] div[style*="color"] h5 {
    color: inherit !important;
}



/* Help/tooltip icons should be white */
[data-theme="dark"] .MuiSvgIcon-root[data-testid="HelpOutlineIcon"]:not(.dashboardQuickLinkIcon),
[data-theme="dark"] .MuiTooltip-root .MuiSvgIcon-root {
    color: #D7DADC !important;
}

/* Collapse/Expand arrows in custom components */
[data-theme="dark"] .MuiCollapse-root {
    background-color: var(--card-bg) !important;
}

/* Welcome Guide section overrides */
[data-theme="dark"] .MuiPaper-root.welcome-section {
    background-color: #ccd2de !important;
}

[data-theme="dark"] .welcome-section .MuiCollapse-root,
[data-theme="dark"] .welcome-section .MuiCollapse-wrapper,
[data-theme="dark"] .welcome-section .MuiCollapse-wrapperInner {
    background-color: #ccd2de !important;
}

/* Bottom border lines */
[data-theme="dark"] .MuiDivider-root {
    border-color: #D7DADC !important;
}

/* Custom multiselect dropdown styling */
[data-theme="dark"] .react-select__control {
    background-color: var(--bg-secondary) !important;
    border-color: #D7DADC !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__control:hover {
    border-color: #D7DADC !important;
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .react-select__control--is-focused {
    border-color: var(--bg-tertiary) !important;
    box-shadow: 0 0 0 1px var(--bg-tertiary) !important;
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .react-select__single-value {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__placeholder {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__input-container {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__input-container input {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__value-container {
    color: var(--text-primary) !important;
}

/* Ensure the displayed value in the control is white */
[data-theme="dark"] .react-select__value-container > div {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__indicator-separator {
    background-color: #D7DADC !important;
}

[data-theme="dark"] .react-select__dropdown-indicator {
    color: #D7DADC !important;
}

[data-theme="dark"] .react-select__clear-indicator {
    color: #D7DADC !important;
}

[data-theme="dark"] .react-select__menu {
    background-color: var(--bg-secondary) !important;
    border: 1px solid #D7DADC !important;
    z-index: 9999 !important;
}

[data-theme="dark"] .react-select__menu-list {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .react-select__option {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__option--is-focused {
    background-color: #614bb4 !important;
    color: #D7DADC !important;
}

[data-theme="dark"] .react-select__option--is-selected {
    background-color: #614bb4 !important;
    color: #D7DADC !important;
}

[data-theme="dark"] .react-select__multi-value {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .react-select__multi-value__label {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .react-select__multi-value__remove {
    color: var(--text-primary) !important;
    background-color: transparent !important;
}

[data-theme="dark"] .react-select__multi-value__remove:hover {
    background-color: #ff6b6b !important;
    color: white !important;
}

/* Fix floating label background */
[data-theme="dark"] .mui-floating-label {
    background: var(--bg-secondary) !important;
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .MuiMenuItem-root {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiMenuItem-root:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .MuiMenuItem-root.Mui-selected {
    background-color: #2a3236 !important;
    color: #D7DADC !important;
}

[data-theme="dark"] .MuiMenuItem-root.Mui-selected:hover {
    background-color: #2a3236 !important;
    color: #D7DADC !important;
}

/* Account page sidebar styling */
[data-theme="dark"] .accountSettingsBar {
    background-color: #1e1e1e !important;
    border-right: solid 1px var(--border-color) !important;
    margin-left: -5px !important;
}

/* Material-UI List components */
[data-theme="dark"] .MuiList-root {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .MuiListItem-root {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiListItemButton-root:hover {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .MuiListItemIcon-root {
    color: var(--text-secondary) !important;
}

/* Filter Settings Accordion colors */
[data-theme="dark"] .MuiAccordion-root, [data-theme="dark"] .MuiAccordionDetails-root {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .MuiButtonBase-root[aria-pressed="false"] {
    color: var(--text-muted) !important;
}

/* Bootstrap cards */
[data-theme="dark"] .card:not(.login-card) {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Apply border color to cards except scan result cards and login card */
[data-theme="dark"] .card:not(.scan-type-card):not(.login-card) {
    border-color: var(--border-color) !important;
}

/* Fix card border-radius for child elements in dark mode */
[data-theme="dark"] .card .card-body {
    background-color: var(--card-bg) !important;
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
}

[data-theme="dark"] .card .result-card-collapse {
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
    overflow: hidden !important;
}

[data-theme="dark"] .card .productPaneMain {
    background-color: var(--card-bg) !important;
    border-bottom-left-radius: inherit !important;
}

[data-theme="dark"] .card .productPaneOptions {
    border-bottom-right-radius: inherit !important;
    border-bottom-left-radius: inherit !important;
}

/* Vault category card hover effect in dark mode */
[data-theme="dark"] .vault-category-card:hover {
    background-color: #2d2d2d !important;
}

/* Light mode hover effect */
.vault-category-card:hover {
    background-color: #AEA2D633 !important;
}

/* Material-UI Card borders in dark mode */
[data-theme="dark"] .MuiCard-root:not(.login-card):not(.availableCashbackButton):not(.single-reverse-search-card) {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .MuiCard-outlined {
    border-color: var(--border-color) !important;
}

/* Specific styling for availableCashbackButton to override global Card rules */
[data-theme="dark"] .availableCashbackButton {
    background-color: #2d2d2d !important;
}

.availableCashbackButton {
    background-color: #f8f9fa !important;
}

[data-theme="dark"] .availableCashbackButton:hover {
    background-color: #404040 !important;
}

.availableCashbackButton:hover {
    background-color: #f0f0f0 !important;
}

/*[data-theme="dark"] .card-header {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}*/

[data-theme="dark"] .card-body {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Bootstrap table styling */
[data-theme="dark"] .table {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--bg-tertiary) !important;
}

/* Form controls */
[data-theme="dark"] .form-control {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: #D7DADC !important;
}

[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: #614bb4 !important;
    box-shadow: 0 0 0 0.2rem rgba(97, 75, 180, 0.25) !important;
}

/* Horizontal rules */
[data-theme="dark"] hr {
    border-color: var(--border-color) !important;
}

/* Text colors */
[data-theme="dark"] .text-dark {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-secondary {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-muted {
    color: var(--text-muted) !important;
}

/* Navbar styling */
[data-theme="dark"] .MuiAppBar-root {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiToolbar-root {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .MuiDrawer-paper {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Dialog components */
[data-theme="dark"] .MuiDialog-paper {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiDialogTitle-root:not(.newCustomScanTitle) {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiDialogContent-root {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Button hover states */
[data-theme="dark"] .MuiButton-outlined:not(.dashboardQuickLink):not(.scan-type-button) {
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .MuiButton-outlined:not(.dashboardQuickLink):not(.scan-type-button):hover {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--text-secondary) !important;
}

/* Tooltip styling */
[data-theme="dark"] .MuiTooltip-tooltip {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

/* Icon button styling */
[data-theme="dark"] .MuiIconButton-root {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .MuiIconButton-root:hover {
    background-color: var(--bg-tertiary) !important;
}

/* Tab styling */
[data-theme="dark"] .MuiTabs-root {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .MuiTab-root {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .MuiTab-root.Mui-selected {
    color: var(--text-primary) !important;
}

/* Dashboard and scan result specific styling */
[data-theme="dark"] .bg-white {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Modal styling */
[data-theme="dark"] .modal-content {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-header {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .modal-body {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .modal-footer {
    background-color: var(--bg-tertiary) !important;
    border-top-color: var(--border-color) !important;
}

.alert-modal-footer {
    border-top: none !important;
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .alert-modal-footer {
    background-color: var(--bg-secondary) !important;
}

/* Select dropdown styling - removed duplicate, handled above */

[data-theme="dark"] .MuiMenu-paper {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Popover styling */
[data-theme="dark"] .MuiPopover-paper {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

/* Border colors */
[data-theme="dark"] .border {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .border-top {
    border-top-color: var(--border-color) !important;
}

[data-theme="dark"] .border-bottom {
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .border-left {
    border-left-color: var(--border-color) !important;
}

/* Simple fix: add borders that match toolbar background to hide the lines */
.scan-type-card .border-left {
    border-top: 2px solid #f5f5f5 !important;
    border-right: 2px solid #f5f5f5 !important;
    border-bottom: 2px solid #f5f5f5 !important;
    border-top-right-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

/* Dark mode toolbar borders */
[data-theme="dark"] .scan-type-card .border-left {
    border-color: #2a3236 !important;
}


[data-theme="dark"] .border-right {
    border-right-color: var(--border-color) !important;
}

/* Shadow override for dark mode */
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow-lg {
    box-shadow: 0 0.125rem 0.25rem rgba(255, 255, 255, 0.075) !important;
}


.gradientBackground {
    background: linear-gradient(-45deg, #614bb4, #4b9eb4, #c69dd2, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 10s ease infinite;
    width: 100%;
    min-height: 100%;
    height: auto;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.force-scrollbar {
    overflow-x: scroll !important;
}

.force-scrollbar::-webkit-scrollbar {
    height: 8px;
}

.force-scrollbar::-webkit-scrollbar-thumb {
    background-color: rgba(100, 100, 100, 0.4);
    border-radius: 4px;
}

.MuiInputLabel-outlined {
    line-height: 0.7em !important;
}

.MuiTooltip-tooltip {
    background-color: #616161 !important;
}

.button-col {
    width: 100px;
    text-align: center;
}

.MuiTableCell-head {
    line-height: 0.6rem !important;
}

.desc-col {
    width: 300px;
    text-align: left;
}

.MuiInputBase-input.MuiSelect-select {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.MuiInputBase-input {
    padding-top: 0.5em !important;
    padding-bottom: 0.5em !important;
}

table {
    counter-reset: tableCount;
}

.enlargedChart {
    width: 90vw !important;
    max-width: 90vw !important;
}

.counterCell:before {
    content: counter(tableCount);
    counter-increment: tableCount;
}

.sellerHistoryPopover {
    width: 20vw !important;
    max-width: 20vw !important;
}

[data-theme="dark"] .sellerHistoryPopover {
    background-color: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.counterCell {
    text-align: center;
    width: 50px;
}

.button-center {
    text-align: center;
}

.InputAdornment {
    font-size: 0.4rem;
    padding-top: 1px;
}

.BorderedToggleButton {
    background-color: rgba(0, 0, 0, 0.1);
    color: black !important;
}

.BorderedToggleButtonRight {
    border-top-right-radius: 50px !important;
    border-bottom-right-radius: 50px !important;
}

.BorderedToggleButtonLeft {
    border-top-left-radius: 50px !important;
    border-bottom-left-radius: 50px !important;
}

/* ColouredToggleButton styling for light mode only */
[data-theme="light"] .ColouredToggleButton,
.ColouredToggleButton {
    background-color: var(--secondary-purple) !important;
    color: white !important;
}

/* ColouredToggleButton now uses global toggle button styling in dark mode */
.ColouredToggleButton:hover {
    background-color: var(--tertiary-purple) !important;
    color: white !important;
}

.ColouredToggleButton[aria-pressed="true"] {
    background-color: var(--primary-purple) !important;
    color: white !important;
}

/* Global toggle button consistency - match StoreScan styling */
[data-theme="dark"] .MuiToggleButton-root {
    background-color: black !important;
    color: gray !important;
    border-color: #333333 !important;
}

[data-theme="dark"] .MuiToggleButton-root:hover {
    background-color: #333333 !important;
    color: white !important;
}

[data-theme="dark"] .MuiToggleButton-root.Mui-selected {
    background-color: var(--primary-purple) !important;
    color: white !important;
}

[data-theme="dark"] .MuiToggleButton-root.Mui-selected:hover {
    background-color: var(--primary-purple) !important;
    color: white !important;
}

/* High specificity rules to ensure text inside toggle buttons follows the color scheme */
[data-theme="dark"] .MuiToggleButton-root h6,
[data-theme="dark"] .MuiToggleButton-root h5,
[data-theme="dark"] .MuiToggleButton-root h4,
[data-theme="dark"] .MuiToggleButton-root h3,
[data-theme="dark"] .MuiToggleButton-root h2,
[data-theme="dark"] .MuiToggleButton-root h1,
[data-theme="dark"] .MuiToggleButton-root p {
    color: inherit !important;
}

[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) {
    color: gray !important;
}

[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) h6,
[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) h5,
[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) h4,
[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) h3,
[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) h2,
[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) h1,
[data-theme="dark"] .MuiToggleButton-root:not(.Mui-selected) p {
    color: gray !important;
}

#refreshIcon {
    font-size: 1.25em !important;
}

.result-card {
    margin: 24px 0;
    padding: 16px;
    border-radius: 0.5em !important;
    position: relative;
    border: var(--card-border);
    background-color: var(--card-bg);
    color: var(--text-primary);
}

.result-card--current {
    background-color: var(--card-bg-current);
    border: var(--card-border-current);
    border-radius: 0.5em !important;
}

/* Current result floating label */
.result-card--current::before {
    content: "Current Result";
    position: absolute;
    top: -0.8em;
    left: 16px;
    background-color: white;
    padding: 0 8px;
    color: #614bb4;
    font-size: 0.7em;
    font-weight: bold;
    line-height: 1.2;
}

[data-theme="dark"] .result-card--current::before {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

.current-result-badge {
    background-color: #614bb4;
    color: white;
    border-radius: 20px;
    display: inline-block;
    padding: 4px 12px;
}

[data-theme="dark"] .current-result-badge {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

@keyframes shake-side-to-side {
    0% {
        transform: translateX(0);
    }
    3.33% {
        transform: translateX(-3px);
    }
    6.66% {
        transform: translateX(3px);
    }
    10% {
        transform: translateX(-3px);
    }
    13.33% {
        transform: translateX(3px);
    }
    16.66% {
        transform: translateX(-3px);
    }
    20% {
        transform: translateX(3px);
    }
    23.33% {
        transform: translateX(-3px);
    }
    26.66% {
        transform: translateX(3px);
    }
    30% {
        transform: translateX(-3px);
    }
    33.33% {
        transform: translateX(0);
    } /* Stop shaking */
    100% {
        transform: translateX(0);
    }
}

.shake-icon {
    animation: shake-side-to-side 3s ease infinite;
}

.Modal {
    position: relative;
    top: 250px;
    left: 400px;
    right: 20px;
    bottom: 20px;
    background-color: #f5f5f5;
    width: 500px;
    border: 1px solid #000;
    border-radius: 4px;
    padding: 20px;
}

.Overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rebeccapurple;
}

.button-center {
    text-align: center;
}

.MuiTabScrollButton-root {
    background-color: #614bb4 !important;
    color: white !important;
}

[data-theme="dark"] .MuiTabScrollButton-root {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
}

fieldset {
    border: none;
    margin: 0px auto;
}

.accountSettingsBar {
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    margin-left: -5px !important;
}

.accountSettingsBar .MuiList-root {
    padding: 8px !important;
}


.closebtn {
    float: right;
}

.excludeKeywordsBtnText {
    text-transform: none;
}

body,
html,
#root {
    height: 100%;
    margin: 0;
    font-family: "Exo 2";
}

.result-enter {
    opacity: 0.01;
    transform: translate(-40px, 0);
}

.result-enter-active {
    opacity: 1;
    transform: translate(0, 0);
    transition: all 500ms ease-in;
}

.result-exit {
    opacity: 1;
    transform: translate(0, 0);
}

.result-exit-active {
    opacity: 0.01;
    transform: translate(40px, 0);
    transition: all 500ms ease-in;
}

.infinite-scroll-component {
    overflow: hidden !important;
}

*,
*:active,
*:focus {
    outline: none !important;
}

.price-drop-container {
    display: grid;
    gap: 1rem;
}

.empty-column {
    grid-column: span 1;
}

.page-item.active > a {
    background-color: #614bb4 !important;
    border-color: #614bb4 !important;
    color: white !important;
}

.page-item > a {
    color: #614bb4 !important;
}

.MuiCollapse-wrapper {
    width: 100%;
}

.noHistoryContainer {
    flex-basis: auto !important;
}

.gradient-text {
    background-image: linear-gradient(45deg, #614bb4, #04b6ab);
    background-size: 100%;
    background-repeat: repeat;

    /* Use the text as a mask for the background. */
    /* This will show the gradient as a text color rather than element bg. */
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
    text-decoration: none !important;
}

.gradient-text:hover {
    text-shadow: 1px 1px 2px rgba(4, 182, 171, 0.4);
    text-decoration: none !important;
}

a:hover {
    text-decoration: none !important;
}

.dashboardProductPane {
    height: 45vh !important;
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 100px) {
    html {
        font-size: calc(2em + 1vw);
    }

    .price-drop-sticker {
        position: absolute;
        top: 0;
        left: 0;
        background-color: #614bb4;
        color: white;
        padding: 5px;
        font-size: 1em;
        font-weight: bold;
        z-index: 10;
        clip-path: polygon(0 0, 100% 0, 0 100%);
        width: 15vw;
        height: 15vw;
        display: flex;
    }

    [data-theme="dark"] .price-drop-sticker {
        background-color: #364153 !important;
    }

    .price-drop-text {
        transform: rotate(-45deg);
        position: absolute;
        bottom: 8.25vw;
        right: 8vw;
    }

    .login-logo {
        width: 30vw;
    }

    .dashboardProductPane {
        height: 45vh !important;
    }

    .storeLogo {
        max-width: 25vw;
        max-height: 25vw;
    }

    .storeLogo-small {
        max-width: 15vw;
        max-height: 15vw;
    }

    .vaultStoreLogo {
        max-width: 20vw;
    }

    .dashboardReplenImage {
        max-width: 25vw;
        max-height: 25vw;
    }

    .productImage {
        max-width: 20vw !important;
        display: block !important;
        margin: 0 auto !important;
        object-fit: contain;
        aspect-ratio: 1/1;
    }

    .productImageZoom {
        max-width: 40vw !important;
    }

    .productHistoryChart {
        height: 4em !important;
        width: 85% !important;
    }

    .selection-chip {
        width: 48% !important;
    }

    .rec-arrow {
        width: 5vw !important;
        height: 5vw !important;
        font-size: 0.7em !important;
    }

    .productPaneOptionsContainer {
        flex-direction: row;
        flex-wrap: wrap;
    }

    [data-theme="dark"] .productPaneOptionsContainer {
        background-color: var(--primary-purple) !important;
        border-bottom-left-radius: inherit !important;
        border-bottom-right-radius: inherit !important;
    }

    [data-theme="dark"] .customButtonsContainer {
        border-bottom-left-radius: 0.5em !important;
    }

    .productPaneMain {
        max-width: 100% !important;
    }

    .a2aPanelMain {
        max-width: 100% !important;
    }

    .productPaneOptions {
        max-width: 100% !important;
    }

    .magnifier {
        display: none !important;
    }

    .SaSExTaP5Dc32-container {
        display: none !important;
    }

    .calcHistContainer {
        display: flex;
        flex-direction: row;
    }

    .largeBorder {
        border-right: 1px solid gray;
    }

    h1 {
        font-size: 0.8em !important;
        margin-bottom: 0px !important;
    }

    h2 {
        font-size: 0.75em !important;
        margin-bottom: 0px !important;
    }

    h3 {
        font-size: 0.6em !important;
        margin-bottom: 0px !important;
    }

    h4 {
        font-size: 0.5em !important;
        margin-bottom: 0px !important;
    }

    h5 {
        font-size: 0.4em !important;
        margin-bottom: 0px !important;
    }

    h6 {
        font-size: 0.35em !important;
        margin-bottom: 0px !important;
    }

    p {
        font-size: 0.3em !important;
        margin-bottom: 0px !important;
    }

    svg {
        font-size: 0.65em !important;
    }

    .discordIcon {
        font-size: 1.5em !important;
    }

    input {
        font-size: 0.4em !important;
        margin-bottom: 0px !important;
    }

    button {
        line-height: 0.5em !important;
    }

    .MuiIconButton-root {
        font-size: 1em !important;
    }

    .MuiSlider-valueLabel {
        font-size: 0.3em !important;
    }

    .MuiSelect-selectMenu {
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }

    .MuiInputBase-root {
        font-size: 1em !important;
    }

    .MuiTab-wrapper {
        align-items: start !important;
    }

    .modal-title {
        font-size: 0.6em !important;
        margin-bottom: 0px !important;
    }

    .small-text {
        font-size: 0.25em !important;
        margin-bottom: 0px !important;
    }

    .medium-text {
        font-size: 0.4em !important;
        margin-bottom: 0px !important;
    }

    .large-text {
        font-size: 2em !important;
        margin-bottom: 0px !important;
    }

    .large-input {
        font-size: 0.8em !important;
    }

    .large-icon {
        font-size: 1.2em !important;
    }

    .loginTitle {
        display: none;
    }

    .MuiToolbar-regular,
    .makeStyles-toolbar-12,
    .jss12 {
        min-height: 1em !important;
        height: 1em !important;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .dashboardProductPane {
        height: 78vh !important;
    }

    .price-drop-sticker {
        position: absolute;
        top: 0;
        left: 0;
        background-color: #614bb4;
        color: white;
        padding: 5px;
        font-size: 1em;
        font-weight: bold;
        z-index: 10;
        clip-path: polygon(0 0, 100% 0, 0 100%);
        width: 10vw;
        height: 10vw;
        display: flex;
    }

    [data-theme="dark"] .price-drop-sticker {
        background-color: #364153 !important;
    }

    .price-drop-text {
        transform: rotate(-45deg);
        position: absolute;
        bottom: 5.5vw;
        right: 5.5vw;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    html {
        font-size: calc(1em + 1vw);
    }

    .selection-chip {
        width: 24% !important;
    }

    .accountSettingsBar {
        height: 100vh;
    }

    .price-drop-sticker {
        position: absolute;
        top: 0;
        left: 0;
        background-color: #614bb4;
        color: white;
        padding: 5px;
        font-size: 1em;
        font-weight: bold;
        z-index: 10;
        clip-path: polygon(0 0, 100% 0, 0 100%);
        width: 5vw;
        height: 5vw;
        display: flex;
    }

    [data-theme="dark"] .price-drop-sticker {
        background-color: #364153 !important;
    }

    .price-drop-text {
        transform: rotate(-45deg);
        position: absolute;
        bottom: 2.75vw;
        right: 2vw;
    }

    .SaSExTaP5Dc32-container {
        display: flex !important;
    }

    .login-logo {
        width: 15vw;
    }

    .storeLogo {
        max-width: 8vw;
        max-height: 8vw;
    }

    .storeLogo-small {
        max-width: 8vw;
        max-height: 8vw;
    }

    .vaultStoreLogo {
        max-width: 10vw;
        max-height: 10vw;
    }

    .dashboardReplenImage {
        max-width: 8vw;
        max-height: 8vw;
    }

    .productImage {
        max-width: 10vw !important;
        object-fit: contain;
        aspect-ratio: 1/1;
    }

    .productImageZoom {
        width: 20vw !important;
    }

    .magnifier {
        display: block !important;
        position: absolute;
        bottom: 10px;
        right: 10px;
        cursor: pointer;
        color: #000;
    }

    .cursor-pointer {
        cursor: pointer;
    }

    .productHistoryChart {
        height: 5em !important;
        width: 95% !important;
    }

    .productPaneMain {
        max-width: 94% !important;
    }

    .a2aPanelMain {
        max-width: 97% !important;
    }

    .productPaneOptions {
        max-width: 3% !important;
    }

    .dashboardProductPane {
        height: 44vh !important;
    }

    .rec-arrow {
        width: 2.5vw !important;
        height: 2.5vw !important;
        font-size: 1em !important;
    }

    .productPaneOptionsContainer {
        flex-direction: column;
    }

    .calcHistContainer {
        display: flex;
        flex-direction: column;
    }

    .largeBorder {
        border-right: 1px solid gray;
    }

    h1 {
        font-size: 1.1em !important;
        margin-bottom: 0px !important;
    }

    h2 {
        font-size: 0.9em !important;
        margin-bottom: 0px !important;
    }

    h3 {
        font-size: 0.8em !important;
        margin-bottom: 0px !important;
    }

    h4 {
        font-size: 0.7em !important;
        margin-bottom: 0px !important;
    }

    h5 {
        font-size: 0.6em !important;
        margin-bottom: 0px !important;
    }

    h6 {
        font-size: 0.5em !important;
        margin-bottom: 0px !important;
    }

    p {
        font-size: 0.4em !important;
        margin-bottom: 0px !important;
    }

    svg {
        font-size: 0.9em !important;
    }

    .discordIcon {
        font-size: 1.5em !important;
    }

    input {
        font-size: 0.6em !important;
        margin-bottom: 0px !important;
    }

    button {
        line-height: 0.8em !important;
    }

    .MuiIconButton-root {
        font-size: 1em !important;
    }

    .MuiSlider-valueLabel {
        font-size: 0.5em !important;
    }

    .MuiSelect-selectMenu {
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }

    .MuiInputBase-root {
        font-size: 1em !important;
    }

    .MuiTab-wrapper {
        align-items: start !important;
    }

    .modal-title {
        font-size: 0.8em !important;
        margin-bottom: 0px !important;
    }

    .small-text {
        font-size: 0.35em !important;
        margin-bottom: 0px !important;
    }

    .medium-text {
        font-size: 0.5em !important;
        margin-bottom: 0px !important;
    }

    .large-text {
        font-size: 2em !important;
        margin-bottom: 0px !important;
    }

    .large-icon {
        font-size: 1.2em !important;
    }

    .loginTitle {
        display: block;
        font-size: 4em !important;
        background: linear-gradient(90deg, #614bb4, #4b9eb4, #c69dd2, #23d5ab);
        background-size: 200% auto;

        color: #000;
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;

        animation: gradient 8s ease infinite;
    }

    .MuiToolbar-regular,
    .makeStyles-toolbar-12,
    .jss12 {
        min-height: 1em !important;
        height: 1.5em !important;
    }
}

/* Extra large devices (large desktops, 1350px and up) */
@media (min-width: 1350px) {
    .dashboardProductPane {
        height: 49vh !important;
    }

    .rec-arrow {
        width: 2.5vw !important;
        height: 2.5vw !important;
    }

    html {
        font-size: calc(1em + 1vw);
    }

    .login-logo {
        width: 8vw;
    }

    .vaultStoreLogo {
        max-width: 10vw;
        max-height: 10vw;
    }

    .dashboardReplenImage {
        max-width: 8vw;
        max-height: 8vw;
    }

    .productImage {
        max-width: 10vw !important;
        object-fit: contain;
        aspect-ratio: 1/1;
    }

    .productImageZoom {
        width: 20vw !important;
    }

    .productHistoryChart {
        height: 6.5em !important;
        width: 90% !important;
    }

    .calcHistContainer {
        display: flex;
        flex-direction: column;
    }

    .productPaneOptionsContainer {
        flex-direction: column;
    }

    .largeBorder {
        border-right: 1px solid gray;
    }

    h1 {
        font-size: 1.25em !important;
        margin-bottom: 0px !important;
    }

    h2 {
        font-size: 1em !important;
        margin-bottom: 0px !important;
    }

    h3 {
        font-size: 0.9em !important;
        margin-bottom: 0px !important;
    }

    h4 {
        font-size: 0.8em !important;
        margin-bottom: 0px !important;
    }

    h5 {
        font-size: 0.7em !important;
        margin-bottom: 0px !important;
    }

    h6 {
        font-size: 0.55em !important;
        margin-bottom: 0px !important;
    }

    p {
        font-size: 0.45em !important;
        margin-bottom: 0px !important;
    }

    svg {
        font-size: 0.8em !important;
    }

    .discordIcon {
        font-size: 1.5em !important;
    }

    input {
        font-size: 0.6em !important;
        margin-bottom: 0px !important;
    }

    button {
        line-height: 0.8em !important;
    }

    .MuiIconButton-root {
        font-size: 1em !important;
    }

    .MuiSlider-valueLabel {
        font-size: 0.4em !important;
    }

    .MuiSelect-selectMenu {
        padding-top: 0px !important;
        padding-bottom: 0px !important;
    }

    .MuiInputBase-root {
        font-size: 1em !important;
    }

    .MuiTab-wrapper {
        align-items: start !important;
    }

    .modal-title {
        font-size: 0.8em !important;
        margin-bottom: 0px !important;
    }

    .small-text {
        font-size: 0.4em !important;
        margin-bottom: 0px !important;
    }

    .medium-text {
        font-size: 0.6em !important;
        margin-bottom: 0px !important;
    }

    .large-text {
        font-size: 2em !important;
        margin-bottom: 0px !important;
    }

    .large-input {
        font-size: 0.8em !important;
    }

    .large-icon {
        font-size: 1.2em !important;
    }

    .loginTitle {
        display: block;
        font-size: 6em !important;
        background: linear-gradient(90deg, #614bb4, #4b9eb4, #c69dd2, #23d5ab);
        background-size: 200% auto;

        color: #000;
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;

        animation: gradient 8s ease infinite;
    }
}

/* Extra-extra large devices (1900px and up) */
@media (min-width: 1900px) {
    .productPaneMain {
        max-width: 94% !important;
    }

    .a2aPanelMain {
        max-width: 97% !important;
    }

    .productPaneOptions {
        max-width: 3% !important;
    }

    .storeLogo {
        max-width: 6vw;
        max-height: 6vw;
    }

    .storeLogo-small {
        max-width: 6vw;
        max-height: 6vw;
    }
}

.scan-result-toolbar {
    border-left: 1px solid #e0e0e0;
    min-height: 200px;
    width: 50px;
    padding: 1rem 0;
}

.scan-result-tooltip {
    font-size: 1.1rem !important;
}

.scan-result-tooltip .MuiTooltip-tooltip {
    font-size: 0.6rem !important;
}

/* ---------- Falling Shapes ---------- */
.falling-shapes-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1; /* behind the login form */
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(120vh) rotate(360deg);
        opacity: 0.5;
    }
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.spinning {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.tightening {
    animation: tighten 1s infinite ease-in-out;
}

.scan-result-toolbar-width {
    width: 100%;
}

@media (min-width: 768px) {
    .scan-result-toolbar-width {
        width: 60px !important;
    }
}

@keyframes tighten {
    0% {
        transform: rotate(0deg);
    }
    6.25% {
        transform: rotate(-5deg);
    }
    12.5% {
        transform: rotate(-10deg);
    }
    18.75% {
        transform: rotate(-15deg);
    }
    25% {
        transform: rotate(-20deg);
    }
    31.25% {
        transform: rotate(-15deg);
    }
    37.5% {
        transform: rotate(-10deg);
    }
    43.75% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(0deg);
    }
    56.25% {
        transform: rotate(5deg);
    }
    62.5% {
        transform: rotate(10deg);
    }
    68.75% {
        transform: rotate(15deg);
    }
    75% {
        transform: rotate(20deg);
    }
    81.25% {
        transform: rotate(15deg);
    }
    87.5% {
        transform: rotate(10deg);
    }
    93.75% {
        transform: rotate(5deg);
    }
    100% {
        transform: rotate(0deg);
    }
}

.scan-radar {
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.dragging * {
    cursor: grabbing !important;
}

.dragging {
    cursor: grabbing !important;
}

.drag-overlay,
.drag-overlay * {
    cursor: grabbing !important;
}

:root:has(.dragging),
:root:has(.drag-overlay) {
    cursor: grabbing !important;
}

.custom-scan-component {
    @media (max-width: 768px) {
        .col-12 {
            max-width: 100% !important;
            width: 100% !important;
        }

        .d-flex.flex-column.flex-md-row > div:first-child {
            height: 25vh !important;
            max-height: 25vh !important;
            min-height: 25vh !important;
            overflow: hidden !important;
        }

        .d-flex.flex-column.flex-md-row > div:nth-child(3) {
            height: 47vh !important;
            max-height: 47vh !important;
            min-height: 47vh !important;
            overflow: hidden !important;
        }

        .d-flex.flex-column.flex-md-row > div:last-child {
            height: 28vh !important;
            max-height: 28vh !important;
            min-height: 28vh !important;
            overflow: hidden !important;
        }

        .d-flex.flex-column.flex-md-row {
            overflow: hidden !important;
            height: 100vh !important;
            max-height: 100vh !important;
            min-height: 100vh !important;
            display: flex !important;
            flex-direction: column !important;
        }

        .position-fixed {
            position: fixed !important;
            top: 70px !important;
            left: 0 !important;
            right: 0 !important;
        }

        .overflow-hidden {
            overflow: hidden !important;
        }
    }
}

.virtualized-container {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #614BB4 #f0f0f0;
}

.virtualized-container::-webkit-scrollbar {
    width: 8px;
}

.virtualized-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

.virtualized-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

.virtualized-container::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.custom-scan-card {
    min-height: 210px !important;
    max-height: 210px !important;
    height: 210px !important;
    margin-bottom: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    width: 95% !important;
    margin-left: 5px !important;
}

.custom-scan-card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-top: 8px;
}

.virtualized-container .row {
    margin-bottom: 13px !important;
}

.virtualized-container .col-12.col-lg-4 {
    display: flex;
    align-items: stretch;
    padding-top: 12px !important;
}

.custom-scan-card * {
    pointer-events: auto;
}

.custom-scan-card.dragging * {
    pointer-events: none;
}

/* Reduce reflow during scrolling */
.virtualized-container .row {
    will-change: transform;
}

/* Wrapper for floating label */
.mui-dropdown-wrapper {
    position: relative;
    font-family: "Roboto", "Helvetica", "Arial", sans-serif;
    margin-top: 1px;
  }
  
  /* Floating label */
  .mui-floating-label {
    position: absolute;
    top: -8px;
    left: 12px;
    background: #f9fafb;
    padding: 0 4px;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.6);
    z-index: 1;
  }

  .react-select__indicator-separator {
    display: none;
  }

  .react-select__dropdown-indicator {
    padding: 0 6px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
  }
  
  /* Base dropdown styling */
  .react-select__control {
    top: -2px !important;
    background-color: #f9fafb !important;
    border: 1px solid rgba(0, 0, 0, 0.23);
    border-radius: 4px;
    min-height: 3.21em !important;
    height: 3.21em !important;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.4rem;
    color: #000 !important;    
  }
  
  .react-select__control--is-focused {
    border-color: #3f51b5;
    box-shadow: 0 0 0 2px rgba(63, 81, 181, 0.2);
  }
  
  /* Placeholder & selected value */
  .react-select__placeholder,
  .react-select__single-value {
    color: #000 !important;
    font-size: 1em;
  }
  
  /* Dropdown arrow and icons */
  .react-select__indicator {
    color: rgba(0, 0, 0, 0.54);
    padding: 4px;
  }
  
  /* Menu */
  .react-select__menu {
    border-radius: 4px;
    font-size: 0.5em;
    box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2),
                0px 6px 10px 0px rgba(0,0,0,0.14),
                0px 1px 18px 0px rgba(0,0,0,0.12);
    z-index: 1000 !important;
    min-width: max-content !important;
    width: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    max-height: none !important;
  }
  
  .react-select__menu-list {
    max-height: none !important;
    overflow-y: visible !important;
  }
  
  /* Options */
  .react-select__option {
    padding: 6px 6px;
    color: rgba(0, 0, 0, 0.87);
    font-size: 0.4rem;
    cursor: pointer;
  }
  
  .react-select__option--is-focused {
    background-color: #f5f5f5 !important;
  }
  
  .react-select__option--is-selected {
    background-color: #edf4fb!important;
  }
  
  /* Clear icon (if needed) */
  .react-select__clear-indicator {
    color: rgba(0, 0, 0, 0.54);
  }
  
  /* Multi-value (optional) */
  .react-select__multi-value {
    background-color: rgba(63, 81, 181, 0.08);
  }
  
  .react-select__multi-value__label {
    color: #3f51b5;
  }
  
  .react-select__multi-value__remove {
    color: #3f51b5;
  }

  .mfsb-option .d-flex.align-items-center span:last-child {
    margin-right: 12px;
  }

  .mfsb-option-focused {
    background-color: #f5f5f5 !important;
  }
  
  .mfsb-option-selected {
    background-color: #edf4fb !important;
  }
  
  /* Dark mode styles for mfsb options */
  [data-theme="dark"] .mfsb-option-focused {
    background-color: #2d2d2d !important;
    color: #D7DADC !important;
  }
  
  [data-theme="dark"] .mfsb-option-selected {
    background-color: #2a3236 !important;
    color: #D7DADC !important;
  }
  
  /* Ensure text color for all mfsb options in dark mode */
  [data-theme="dark"] .mfsb-option {
    color: #D7DADC !important;
  }
  
  .mfsb-option {
    cursor: pointer;
  }

.mfsb-arrow-icon {
  font-size: 1.2em !important;
}

/* Additional dark mode fixes for MultiFieldSortBy */
[data-theme="dark"] .mfsb-select .react-select__placeholder {
    color: #D7DADC !important;
}

[data-theme="dark"] .mfsb-select .react-select__single-value {
    color: #D7DADC !important;
}

[data-theme="dark"] .mfsb-select .react-select__value-container {
    color: #D7DADC !important;
}

/* Mobile fix for Sort By dropdown menu positioning */
@media (max-width: 768px) {
    /* Override the centering transform on mobile */
    .mfsb-select .react-select__menu {
        left: 0 !important;
        transform: none !important;
        right: auto !important;
        width: auto !important;
        min-width: auto !important;
        max-width: calc(100vw - 2rem) !important;
        margin-left: 0 !important;
    }
    
    /* Ensure the menu container doesn't overflow */
    .mfsb-select .react-select__menu-list {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Ensure options don't overflow */
    .mfsb-select .react-select__option {
        white-space: normal !important;
        word-wrap: break-word !important;
        max-width: 100% !important;
    }
    
    /* A2A - stack all selects vertically on mobile */
    .col-4.d-flex.flex-row.align-items-center {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .col-4.d-flex.flex-row.align-items-center > div,
    .col-4.d-flex.flex-row.align-items-center > span {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.5rem !important;
    }
    
    .col-4.d-flex.flex-row.align-items-center > div:first-child,
    .col-4.d-flex.flex-row.align-items-center > span:first-child {
        margin-top: 0 !important;
    }
    
    .col-4.d-flex.flex-row.align-items-center .MuiFormControl-root {
        width: 100% !important;
    }
}

@media (min-width: 100px) {
    .price-drop-standard-columns {
        grid-template-columns: repeat(1, 1fr);
    }
    .price-drop-sas-columns {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (min-width: 700px) {
    .price-drop-standard-columns {
        grid-template-columns: repeat(2, 1fr);
    }
    .price-drop-sas-columns {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (min-width: 992px) {
    .price-drop-standard-columns {
        grid-template-columns: repeat(3, 1fr);
    }
    .price-drop-sas-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1350px) {
    .price-drop-standard-columns {
        grid-template-columns: repeat(4, 1fr);
    }
    .price-drop-sas-columns {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1700px) {
    .price-drop-standard-columns {
        grid-template-columns: repeat(4, 1fr);
    }
    .price-drop-sas-columns {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1368px) {

    .selected-scan-card img {
        max-width: 60px !important;
        max-height: 60px !important;
    }
    
    /* Compact folder header styles */
    .folder-title-compact {
        font-size: 0.45rem !important;
        line-height: 1.1 !important;
        font-weight: normal !important;
    }
    
    .folder-delete-btn-compact {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        color: #d32f2f !important;
    }
    
    .folder-delete-icon-compact {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
    }

    .selected-scans-header {
        background-color: white !important;
        z-index: 1000 !important;
    }
    
    .selected-scans-header h5 {
        margin-bottom: 0 !important;
    }
    
    .selected-scans-header + .flex-grow-1 {
        background-color: white !important;
        z-index: 1000 !important;
    }

    .d-flex.flex-column.flex-md-row > div:last-child .flex-grow-1 {
        padding-bottom: 60px !important;
    }
    
    .d-flex.flex-column.flex-md-row > div:nth-child(3) .flex-shrink-0 {
        padding-top: 0.15rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .d-flex.flex-column.flex-md-row > div:nth-child(3) .d-flex.justify-content-between {
        margin-bottom: 0.25rem !important;
    }
    
    .virtualized-container {
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        overscroll-behavior: contain !important;
    }

    .custom-scan-card {
        touch-action: manipulation !important;
        pointer-events: auto !important;
    }
}

/* Scan type selection buttons dark mode styling */
[data-theme="dark"] .MuiButton-outlined.scan-type-button:not(:disabled) {
    background-color: var(--bg-secondary) !important;
 /*   border-color: var(--text-secondary) !important;*/
 color: var(--text-secondary) !important;
}

[data-theme="dark"] .MuiButton-outlined.scan-type-button:not(:disabled):hover {
    background-color: var(--bg-tertiary) !important;
   /* border-color: var(--text-secondary) !important;*/
   color: var(--text-secondary) !important;
}

/* Disabled scan type buttons in dark mode */
[data-theme="dark"] .MuiButton-outlined.scan-type-button:disabled {
    background-color: var(--bg-secondary) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .MuiButton-outlined.scan-type-button:disabled:hover {
    background-color: #FC4A30 !important;
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

/* Scan type label background fix */
.scan-type-label {
    background: linear-gradient(to bottom, #f9fafb 50%, white 50%) !important;
}

[data-theme="dark"] .scan-type-label {
    background: linear-gradient(to bottom, #121212 50%, #1e1e1e 50%) !important;
}

[data-theme="dark"] .number-of-results-link {
    color: var(--primary-purple) !important;
}

[data-theme="dark"] .MuiAlert-root {
    background-color: #fff4e5 !important;
}

[data-theme="dark"] .MuiAlert-root {
    background-color: var(--border-color) !important;
}

/* Fix autocomplete suggestions background in dark mode */
[data-theme="dark"] .MuiInputBase-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiInputBase-input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiInputBase-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* Fix for custom textfield autocomplete */
[data-theme="dark"] .custom-textfield .custom-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-theme="dark"] .custom-textfield .custom-input:-webkit-autofill:hover {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-theme="dark"] .custom-textfield .custom-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-tertiary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

[data-theme="dark"] .wholsale-adjust-table {
    border-color: var(--border-color) !important;
}

.results-within-filters-number {
    color: white !important;
}

[data-theme="dark"] .category-scan-category-button {
    background-color: black !important;
    color: gray !important;
    border-color: #333333 !important;
}

[data-theme="dark"] .category-scan-category-button:hover {
    background-color: #333333 !important;
    color: white !important;
}

[data-theme="dark"] .category-scan-category-button[aria-pressed="true"] {
    background-color: var(--primary-purple) !important;
    color: white !important;
}

[data-theme="dark"] .MuiButton-outlined {
    background-color: var(--primary-purple) !important;
}

[data-theme="dark"] .selected-scan-card {
    background-color: var(--bg-light) !important;
}

[data-theme="dark"] .MuiFormControlLabel-label {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .MuiSwitch-switchBase {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .MuiSwitch-switchBase.Mui-checked {
    color: #145699 !important;
}

[data-theme="dark"] .MuiSwitch-switchBase.Mui-disabled {
    color: #575656 !important;
}

/* Remove focus outline from modal close button*/
.modal-header .btn-close:focus,
.modal-header .close:focus,
.modal .btn-close:focus,
.modal .close:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Realistic ripple pulse animation for deal score indicator */
@keyframes ripple-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.deal-score-ripple {
    position: relative;
    display: inline-block;
}

.deal-score-ripple::before,
.deal-score-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--ripple-color);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.deal-score-ripple::before {
    animation: ripple-pulse 3s ease-out infinite;
    animation-delay: 0s;
}

.deal-score-ripple::after {
    animation: ripple-pulse 3s ease-out infinite;
    animation-delay: 1s;
}

.deal-score-ripple .ripple-third {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: var(--ripple-color);
    transform: translate(-50%, -50%);
    animation: ripple-pulse 3s ease-out infinite;
    animation-delay: 2s;
    pointer-events: none;
}

[data-theme="dark"] .modal {
    background-color: transparent !important;
}

/* Store Selection toggle button overrides - now consistent with global styling */
[data-theme="dark"] .MuiDialog-paper .MuiToggleButton-root {
    background-color: black !important;
    color: gray !important;
    border-color: #333333 !important;
}

[data-theme="dark"] .MuiDialog-paper .MuiToggleButton-root:hover {
    background-color: #333333 !important;
    color: white !important;
}

[data-theme="dark"] .MuiDialog-paper .MuiToggleButton-root.Mui-selected {
    background-color: var(--primary-purple) !important;
    color: white !important;
}

[data-theme="dark"] .MuiDialog-paper .MuiToggleButton-root.Mui-selected:hover {
    background-color: var(--primary-purple) !important;
    color: white !important;
}

.popover .popover-arrow {
    display: none !important;
}
/* Bootstrap Popover dark mode styling */
[data-theme="dark"] .popover {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .popover .popover-header {
    background-color: var(--bg-tertiary) !important;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

[data-theme="dark"] .popover .popover-body {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .popover .arrow::before {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .popover .arrow::after {
    border-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .popover li:hover:not(.mismatchPopoverHeader) {
    background-color: var(--bg-tertiary) !important;
}

.emailIcon, .facebookIcon, .alert-icon {
    font-size: 1.5rem !important;
}

.modal-body .MuiTextField-root .MuiInputBase-root {
    border-radius: 4px !important;
}

.modal-body .MuiTextField-root .MuiOutlinedInput-notchedOutline {
    border-radius: 4px !important;
}

.modal-body.bg-light.p-1 {
    overflow: hidden !important;
    border-radius: inherit !important;
}

/* ProductPane header corner styling - only for collapsible panels */
.card.pane-collapsed .card-header {
    border-radius: 0.5rem !important;
}

.card.pane-expanded .card-header {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

/* Ensure the card itself has proper border radius */
.card {
    border-radius: 0.5rem !important;
}

/* A2A Panel bottom corner rounding fixes */
.card.pane-expanded .card-body {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    overflow: hidden !important;
}

.card.pane-expanded .a2aPanelMain {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    overflow: hidden !important;
}

/* Ensure Collapse component doesn't override border radius */
.card.pane-expanded .MuiCollapse-root {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    overflow: hidden !important;
}

/* Fix any child elements that might have sharp corners */
.card.pane-expanded .card-body > div:last-child {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

/* Replenishable Panes corner rounding fixes */
/* Fix the main card structure inside Paper wrapper */
.MuiPaper-root .card {
    border-radius: inherit !important;
}

/* Header should have straight bottom corners when expanded */
.MuiPaper-root .card-header {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Content area should have straight top corners and rounded bottom corners */
.MuiPaper-root .MuiCollapse-root {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

/* Override inline styles on the inner card */
.MuiPaper-root .MuiCollapse-root .card {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

/* When collapsed, header should have rounded bottom corners */
.MuiPaper-root .card .card-header:last-child {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    border-bottom: none !important;
}

/* FAQ and Guides Help Panel corner rounding fixes */
/* Default state: collapsed with rounded bottom corners */
.help-panel-collapsed .card-header {
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
}

/* Expanded state: straight bottom corners on header */
.help-panel-expanded .card-header {
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Content area should have rounded bottom corners */
.help-panel-expanded .MuiCollapse-root {
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
    overflow: hidden !important;
}

/* Content container should also inherit rounding */
.help-panel-expanded .MuiCollapse-root .container-fluid {
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
}

/* Replenishable Panel corner rounding fixes - same pattern as help panels */
/* Default state: collapsed with rounded bottom corners */
.replenishable-collapsed .card-header {
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
}

/* Expanded state: straight bottom corners on header */
.replenishable-expanded .card-header {
    border-top-left-radius: inherit !important;
    border-top-right-radius: inherit !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Content area should have rounded bottom corners */
.replenishable-expanded .MuiCollapse-root {
    border-bottom-left-radius: inherit !important;
    border-bottom-right-radius: inherit !important;
}

.modal-body .MuiTextField-root .MuiInputBase-root {
    border-radius: 4px !important;
}

[data-theme="dark"] .single-reverse-search-card {
    background-color: var(--bg-tertiary) !important;
}

.MuiAccordionDetails-root .card.rounded {
    border-radius: 0.375rem !important;
    border-top-left-radius: 0.375rem !important;
    border-top-right-radius: 0.375rem !important;
    border-bottom-left-radius: 0.375rem !important;
    border-bottom-right-radius: 0.375rem !important;
}

.MuiAccordionDetails-root .card.rounded .card-body {
    border-radius: inherit !important;
}

[data-theme="dark"] .page-item > a {
    background-color: var(--bg-tertiary) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .page-item > a:hover {
    background-color: var(--bg-secondary) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .page-item.active > a {
    background-color: #364153 !important;
    border-color: var(--text-muted) !important;
    color: #ffffff !important;
}

/* Custom card background color for specific card types only */
[data-theme="dark"] .product-pane-container .card,
[data-theme="dark"] .product-pane-container .card-body,
[data-theme="dark"] .replenishable-collapsed,
[data-theme="dark"] .replenishable-expanded,
[data-theme="dark"] .replenishable-collapsed .card,
[data-theme="dark"] .replenishable-expanded .card,
[data-theme="dark"] .replenishable-collapsed .card-body,
[data-theme="dark"] .replenishable-expanded .card-body,
[data-theme="dark"] .unmatched-price-drop-panel,
[data-theme="dark"] .unmatched-price-drop-panel .card,
[data-theme="dark"] .unmatched-price-drop-panel .card-body,
[data-theme="dark"] .MuiPaper-root .pane-collapsed,
[data-theme="dark"] .MuiPaper-root .pane-expanded,
[data-theme="dark"] .MuiPaper-root .pane-collapsed .card-body,
[data-theme="dark"] .MuiPaper-root .pane-expanded .card-body,
[data-theme="dark"] .MuiPaper-root .a2aPanelMain {
    background-color: #282828 !important;
}

[data-theme="dark"] .MuiCollapse-root:not(.help-panel-expanded .MuiCollapse-root),
[data-theme="dark"] .productPaneMain,
[data-theme="dark"] .a2aPanelMain {
    background-color: #282828 !important;
}

[data-theme="dark"] .page-item.disabled > a {
    background-color: var(--bg-secondary) !important;
    border-color: var(--text-muted) !important;
    color: var(--text-muted) !important;
}

.page-item > a:focus {
    outline: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .page-item > a:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Replicate Material-UI Paper elevation 3 bottom border effect */
.product-pane-container {
    box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),
            0px 2px 2px 0px rgba(0,0,0,0.14),
            0px 1px 5px 0px rgba(0,0,0,0.12);
    border-radius: 0.5rem !important;
}

.replenishable-collapsed,
.replenishable-expanded,
 .card.pane-collapsed,
 .card.pane-expanded {
    box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),
    0px 2px 2px 0px rgba(0,0,0,0.14),
    0px 1px 5px 0px rgba(0,0,0,0.12);
    border-radius: 0.5rem !important;
}

[data-theme="dark"] .replenishable-collapsed,
[data-theme="dark"] .replenishable-expanded,
[data-theme="dark"] .card.pane-collapsed,
[data-theme="dark"] .card.pane-expanded {
    box-shadow: 0px 3px 1px -2px rgba(255, 255, 255, 0.2),
            0px 2px 2px 0px rgba(255, 255, 255, 0.14),
            0px 1px 5px 0px rgba(255, 255, 255, 0.12) !important;
}

/* Override Bootstrap card default border-radius for ToggleButtons */
.MuiToggleButton-root.card {
    border-radius: 0.5em !important;
}

[data-theme="dark"] .unmatched-price-drop-panel .bg-light {
    border-top-right-radius: 0.5em !important;
    border-bottom-right-radius: 0.5em !important;
    overflow: hidden !important;
    background-clip: padding-box !important;
}

[data-theme="dark"] .mt-2.product-pane-container {
    background-color: #282828 !important;
}

[data-theme="dark"] .w-100.productPaneOptions {
    background-color: #282828 !important;
}

.result-card-collapse:has(.productPaneOptions.arbisense-panel-open) {
    overflow: visible !important; /* stop clipping the inner straight edge */
}

.productPaneOptions.arbisense-panel-open,
.productPaneOptions.arbisense-panel-open .productPaneOptionsContainer {
    border-bottom-right-radius: 0 !important;
}

.replenishable-card {
    margin: 24px 0;
    border-radius: 0.5em !important;
    position: relative;
    border: 1px solid var(--border-color);
}

.replenishable-card .card {
    border: none !important;
}

/* Ensure parent elements have rounded corners to prevent sharp corners showing through */
.replenishable-card,
.replenishable-card .collapse,
.replenishable-card .collapse .card {
    border-radius: 0.5em !important;
    overflow: hidden !important;
}

.replenishable-expanded:has(.arbisense-panel-open) .card,
.replenishable-expanded:has(.arbisense-panel-open) .card-body {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-bottom: none !important;
}

/* ===============================================
   Alert Component Styles
   =============================================== */

/* Alert Badge Styles */
.alert-badge {
    font-weight: 600;
    font-size: 0.6rem;
    width: 1rem;
    height: 1rem;
    padding: 0;
}

.alert-tab-badge {
    font-size: 0.5rem;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Alert Status Bar */
.alert-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745 0%, rgba(40, 167, 69, 0.8) 50%, #28a745 100%);
}

/* Management Status Bar */
.management-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #6c757d 0%, rgba(108, 117, 125, 0.8) 50%, #6c757d 100%);
}

/* Alert Condition Box */
.alert-condition-box {
    background-color: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

[data-theme="dark"] .alert-condition-box {
    background-color: rgba(40, 167, 69, 0.15);
    border: 1px solid rgba(40, 167, 69, 0.3);
}

/* Alert Action Buttons */
.alert-action-btn {
    min-width: 40px !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
}

.alert-action-btn-danger:hover {
    background-color: var(--danger) !important;
    color: white !important;
}

/* Alert Card Styles */
.alert-management-card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.alert-triggered-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.alert-triggered-card h6,
.alert-management-card h6 {
    min-height: 2em;
    line-height: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .alert-management-card,
[data-theme="dark"] .alert-triggered-card {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .alert-management-card:hover,
[data-theme="dark"] .alert-triggered-card:hover {
    box-shadow: 0 6px 18px rgba(255, 255, 255, 0.08) !important;
}

@keyframes alertPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
        border-color: #28a745 !important;
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 24px rgba(40, 167, 69, 0.5);
        border-color: #20c997 !important;
    }
}

.alert-new-alert {
    animation: alertPulse 2s ease-in-out;
    border-width: 3px !important;
}

.alert-removing {
    animation: alertFadeOut 0.3s ease-out forwards;
}

@keyframes alertFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
        max-height: 200px;
        margin-bottom: 1rem;
    }
    to {
        opacity: 0;
        transform: scale(0.95);
        max-height: 0;
        margin-bottom: 0;
        padding: 0;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        transform: translateY(100%) scale(0.3);
        opacity: 0;
    }
    25% {
        transform: translateY(-15px) scale(1.1);
        opacity: 1;
    }
    40% {
        transform: translateY(8px) scale(0.9);
    }
    55% {
        transform: translateY(-8px) scale(1.05);
    }
    70% {
        transform: translateY(3px) scale(0.98);
    }
    85% {
        transform: translateY(-2px) scale(1.01);
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.alert-tab-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 4px;
    gap: 0;
    display: flex;
}

.alert-tab-button {
    font-weight: 500;
    font-size: 0.75rem;
    min-width: 120px;
    transition: all 0.2s ease;
    border: none;
    border-radius: 6px;
    position: relative;
    padding: 6px 12px;
}

.alert-tab-button:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 60%;
    background-color: #dee2e6;
}

.alert-tab-button.active {
    background-color: #6c757d;
    color: white;
    box-shadow: 0 2px 4px rgba(108, 117, 125, 0.3);
}

.alert-tab-button:not(.active) {
    background-color: transparent;
    color: #6c757d;
}

.alert-tab-button:not(.active):hover {
    background-color: #e9ecef;
    color: #495057;
}

[data-theme="dark"] .alert-tab-container {
    background-color: #343a40;
    border-color: #495057;
}

[data-theme="dark"] .alert-tab-button:not(:last-child)::after {
    background-color: #495057;
}

[data-theme="dark"] .alert-tab-button.active {
    background-color: #495057;
    color: #f8f9fa;
}

[data-theme="dark"] .alert-tab-button:not(.active) {
    color: #adb5bd;
}

[data-theme="dark"] .alert-tab-button:not(.active):hover {
    background-color: #495057;
    color: #f8f9fa;
}

.alert-tab-badge {
    font-size: 0.7rem !important;
    min-width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.alert-triggered-card .productImage,
.alert-management-card .productImage {
    display: block !important;
    margin: 0 auto !important;
    text-align: center !important;
}

.alert-triggered-card .text-center,
.alert-management-card .text-center {
    width: 100% !important;
    max-width: none !important;
}

.alert-triggered-card .text-center,
.alert-management-card .text-center {
    width: 70% !important;
    max-width: 70% !important;
}

@media (max-width: 991px) {
    .alert-management-card .border-end,
    .alert-triggered-card .border-end {
        border-right: none !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-right: 0 !important;
        padding-bottom: 1rem !important;
        margin-bottom: 1rem !important;
    }
}

[data-theme="dark"] .alert-status-bar {
    background: linear-gradient(90deg, #4caf50 0%, rgba(76, 175, 80, 0.8) 50%, #4caf50 100%);
}

[data-theme="dark"] .alert-badge,
[data-theme="dark"] .alert-tab-badge {
    background-color: #dc3545 !important;
}

/* ===============================================
   ArbiSense Panel Styles
   =============================================== */

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@media (max-width: 768px) {
    .arbisense-panel {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .arbisense-wrapper {
        padding-right: 0.5rem !important;
    }
    
    .arbisense-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        min-height: auto !important;
    }
    
    .arbisense-badge {
        height: 20px !important;
        padding: 0.15rem 0.4rem !important;
        font-size: 0.45rem !important;
        letter-spacing: 0.1px !important;
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .arbisense-icon {
        font-size: 0.5rem !important;
        margin-right: 0.25rem !important;
    }
    
    .arbisense-text {
        font-size: 0.45rem !important;
    }
    
    .arbisense-content {
        width: 100% !important;
    }
}

/* ===============================================
   Delete Confirmation (Alerts) Styles
   =============================================== */

.delete-confirmation-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-color: #f5f5f5;
}

.delete-confirmation-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
    padding: 20px;
    text-align: center;
}

.delete-confirmation-content .logo {
    margin-bottom: 20px;
}

.delete-confirmation-content .logo img {
    height: 120px;
    width: auto;
}

.delete-confirmation-content .warning-icon,
.delete-confirmation-content .error-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.delete-confirmation-content h2 {
    color: #1d1b1b !important;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
}

.delete-confirmation-content h2.success-title {
    color: #28a745 !important;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
}

.delete-confirmation-content h2.error-title {
    color: #dc3545 !important;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 600;
}

.delete-confirmation-content .warning-text {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.delete-confirmation-content .irreversible-text {
    color: #dc3545;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 30px;
}

.delete-confirmation-content .alert-info {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    text-align: left;
}

.delete-confirmation-content .alert-info-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14px;
}

.delete-confirmation-content .alert-info-label {
    color: #666;
}

.delete-confirmation-content .alert-info-value {
    color: #333;
    font-weight: 500;
}

.delete-confirmation-content .buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.delete-confirmation-content .btn-cancel {
    background-color: #6c757d !important;
    color: white !important;
    font-size: 20px !important;
    text-transform: none !important;
    padding: 8px 20px !important;
}

.delete-confirmation-content .btn-delete {
    background-color: #dc3545 !important;
    color: white !important;
    font-size: 20px !important;
    text-transform: none !important;
    padding: 8px 20px !important;
}

.delete-confirmation-content .btn-primary {
    background-color: #614bb4 !important;
    color: white !important;
    font-size: 20px !important;
    text-transform: none !important;
    padding: 8px 20px !important;
}

.delete-confirmation-content .error-text {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}