/* Base alert styles shared across themes */
/* --- Notification Audio Unlock Styles --- */
.notification-audio-unlock-icon {
  margin-left: 10px;
  cursor: pointer;
  color: #ffcc00;
  vertical-align: middle;
  animation: pulse-notification 1.5s infinite;
  font-size: 16px;
  display: inline-flex;
  align-items: center;

}

@keyframes pulse-notification {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.notification-audio-unlock-icon:hover {
  color: #fff;
  animation: none;
  transform: scale(1.2);
}

/* Buttons row for price adjustments */
.price-adjustment-buttons {
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.price-adjustment-buttons .spacer {
  flex-grow: 1;
}

.price-adjustment-buttons .btn {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  padding: 2px 5px;
  margin: 0 1px;
}

/* Preset inputs in Options */
/* Preset inputs in Options */
#preset-neg-input,
#preset-pos-input,
.preset-input {
  width: 140px;
  padding: 4px 6px;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  background: var(--modal-input-bg);
  border: var(--modal-input-border);
  color: var(--modal-input-color);
  border-radius: 4px;
  box-shadow: var(--modal-input-shadow);
}

#preset-neg-input::placeholder,
#preset-pos-input::placeholder,
.preset-input::placeholder {
  color: var(--modal-label-color);
}

/* Align alert icon and price nicely on one line */
.alert-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.alert-info .iconify {
  line-height: 1;
  vertical-align: middle;
  position: relative;
  top: 0;
}

.alert-price {
  line-height: 1;
}

/* Delta percentage next to alert price */
.alert-delta {
  margin-left: 10%;
  font-size: 13px;
  /* match latest price */
  font-weight: 400;
  opacity: 0.95;
}

/* Active tab: increase space between icon and price */
#alertsModal #active-alerts-list .alert-info {
  gap: 12px;
  /* more breathing room between icon and price */
}

/* Bell badge in portfolio table */
/* Position the badge on the alert button */
.btn-action {
  position: relative;
}

.btn-action .alert-badge {
  position: absolute;
  top: -3px;
  right: -14px;
  /* shifted a bit further right to avoid overlapping the bell icon */
  min-width: 15px;
  height: 13px;
  padding: 0 2px;
  box-sizing: border-box;
  border-radius: 50%;
  /* square-ish */
  /* background: var(--accent-color, #577ccd); */
  color: #c7c7c7;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  line-height: 14px;
  text-align: center;
  pointer-events: none;
  /* border: 1px solid rgba(0,0,0,0.2); */
}

/* Only color mapping for the alert price slider thumb
   Maps existing UI state classes to the slider thumb color.
   No shape/position changes. */
#alertsModal .positive-change #alert-price-slider::-webkit-slider-thumb,
.positive-change #alert-price-slider::-webkit-slider-thumb,
#alertsModal .positive #alert-price-slider::-webkit-slider-thumb,
.positive #alert-price-slider::-webkit-slider-thumb {
  background: var(--positive-change-color) !important;
  border-color: var(--positive-change-color) !important;
}

#alertsModal .negative-change #alert-price-slider::-webkit-slider-thumb,
.negative-change #alert-price-slider::-webkit-slider-thumb,
#alertsModal .negative #alert-price-slider::-webkit-slider-thumb,
.negative #alert-price-slider::-webkit-slider-thumb {
  background: var(--negative-change-color) !important;
  border-color: var(--negative-change-color) !important;
}

#alertsModal .positive-change #alert-price-slider::-moz-range-thumb,
.positive-change #alert-price-slider::-moz-range-thumb,
#alertsModal .positive #alert-price-slider::-moz-range-thumb,
.positive #alert-price-slider::-moz-range-thumb {
  background: var(--positive-change-color) !important;
  border-color: var(--positive-change-color) !important;
}

#alertsModal .negative-change #alert-price-slider::-moz-range-thumb,
.negative-change #alert-price-slider::-moz-range-thumb,
#alertsModal .negative #alert-price-slider::-moz-range-thumb,
.negative #alert-price-slider::-moz-range-thumb {
  background: var(--negative-change-color) !important;
  border-color: var(--negative-change-color) !important;
}


/* Slider thumb shape variables (can be changed here) */
:root {
  --alert-slider-thumb-width: 22px;
  --alert-slider-thumb-height: 12px;
  --alert-slider-thumb-radius: 2px;
  --alert-slider-track-height: 6px;
}

/* Square thumb shape only (no color or layout changes) */
#alertsModal #alert-price-slider::-webkit-slider-thumb {
  width: var(--alert-slider-thumb-width, 22px) !important;
  height: var(--alert-slider-thumb-height, 12px) !important;
  border-radius: var(--alert-slider-thumb-radius, 2px) !important;
  margin-top: calc((var(--alert-slider-track-height, 6px) - var(--alert-slider-thumb-height, 12px)) / 2) !important;
}

#alertsModal #alert-price-slider::-moz-range-thumb {
  width: var(--alert-slider-thumb-width, 22px) !important;
  height: var(--alert-slider-thumb-height, 12px) !important;
  border-radius: var(--alert-slider-thumb-radius, 2px) !important;
}

/* Frequency toggle (replaces radio buttons) */
.freq-toggle-container {
  margin: 8px 0 8px 0;
  /* give breathing room so it doesn't touch other controls */
}

.freq-toggle {
  --toggle-height: 28px;
  --toggle-padding: 2px;
  --toggle-radius: 4px;
  /* smaller radius per request */
  /* The next vars allow theme overrides via theme CSS */
  --alert-toggle-bg: var(--modal-input-bg);
  --alert-toggle-border: var(--modal-input-border);
  --alert-toggle-active-bg: var(--accent-color, #577ccd);
  /* Lighter, more contrasty defaults */
  --alert-toggle-active-text: #fff;
  --alert-toggle-inactive-text: var(--modal-text-color);
  position: relative;
  display: inline-flex;
  align-items: center;
  height: var(--toggle-height);
  padding: 0 var(--toggle-padding);
  border: 1px solid var(--alert-toggle-border);
  background: var(--alert-toggle-bg);
  border-radius: var(--toggle-radius);
  user-select: none;
  width: 200px;
  /* fixed width to prevent layout collapse/overlap */
  max-width: 100%;
  /* don’t overflow narrow containers */
  box-sizing: border-box;
  /* include padding/border in width */
  line-height: 1;
  /* avoid baseline shift inside wrapper */
}

.freq-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.freq-toggle-track {
  position: absolute;
  top: var(--toggle-padding);
  bottom: var(--toggle-padding);
  left: var(--toggle-padding);
  width: calc(50% - var(--toggle-padding));
  background: var(--alert-toggle-active-bg);
  border-radius: var(--toggle-radius);
  transition: transform 200ms ease;
}

.freq-toggle input:checked~.freq-toggle-track {
  transform: translateX(100%);
}

.freq-toggle-labels {
  position: relative;
  z-index: 1;
  display: grid;
  /* precise centering */
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 100%;
  /* match the fixed wrapper width */
  height: calc(var(--toggle-height) - (2 * var(--toggle-padding)) - 2px);
  /* inner height minus border */
  padding: 0 var(--toggle-padding);
  text-align: center;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
}

.freq-toggle-labels span {
  color: var(--alert-toggle-inactive-text);
  opacity: .85;
  /* lighter to be more visible */
  display: grid;
  place-items: center;
  /* center text exactly */
  height: 100%;
  margin: 0;
  line-height: 1;
  /* avoid baseline offset */
}

.freq-toggle.is-one-time .label-single,
.freq-toggle:not(.is-persistent) .label-single {
  color: var(--alert-toggle-active-text);
  font-weight: 600;
  opacity: 1;
}

.freq-toggle.is-persistent .label-persistent,
.freq-toggle input:checked~.freq-toggle-labels .label-persistent {
  color: var(--alert-toggle-active-text);
  font-weight: 600;
  opacity: 1;
}

/* de-emphasize the inactive side slightly */
.freq-toggle.is-one-time .label-persistent,
.freq-toggle:not(.is-persistent) .label-persistent,
.freq-toggle.is-persistent .label-single,
.freq-toggle input:checked~.freq-toggle-labels .label-single {
  opacity: .7;
}

/* --- Frequency segmented control (pure CSS on radios) --- */
/* Theme variables */
:root {
  --alert-segment-radius: 4px;
  --alert-segment-height: 28px;
  --alert-segment-min-width: 96px;
  --alert-segment-active-bg: var(--accent-color, #577ccd);
  --alert-segment-active-text: #fff;
  --alert-segment-inactive-bg: var(--modal-input-bg);
  --alert-segment-inactive-text: var(--modal-text-color);
  --alert-segment-border: var(--modal-input-border);
}

/* Hide radios visually, keep accessible */
#alertsModal .form-group input[type="radio"][name="frequency"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Base labels as segments */
#alertsModal .form-group input[type="radio"][name="frequency"]+label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--alert-segment-min-width);
  height: var(--alert-segment-height);
  padding: 0 10px;
  margin: 0;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  line-height: 1;
  background: var(--alert-segment-inactive-bg);
  color: var(--alert-segment-inactive-text);
  border: 1px solid var(--alert-segment-border);
  cursor: pointer;
  user-select: none;
}

#alertsModal .form-group #freq-one-time+label {
  border-radius: var(--alert-segment-radius) 0 0 var(--alert-segment-radius);
}

#alertsModal .form-group #freq-persistent+label {
  border-left: none;
  /* share the seam */
  margin-left: -1px;
  /* visually merge borders */
  border-radius: 0 var(--alert-segment-radius) var(--alert-segment-radius) 0;
}

/* Active */
#alertsModal .form-group input[type="radio"][name="frequency"]:checked+label {
  background: var(--alert-segment-active-bg);
  color: var(--alert-segment-active-text);
  font-weight: 600;
}

/* Horizontal title for Add Alert slider */
#alertsModal .add-alert-title {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--modal-text-color);
  padding: 6px 0 8px;
  margin: 0 0 8px 0;
  border-bottom: 1px solid var(--modal-input-border);
  text-align: center;
  text-transform: none;
  /* keep horizontal look, no rotation */
}

/* Condition field with arrow icon/text inside the select */
#alertsModal .condition-field {
  position: relative;
  display: inline-block;
  width: auto;
}

#alertsModal .condition-field .condition-arrow-text {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  min-width: 1em;
}

/* Alerts Modal Header with Audio Status */
.alerts-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
  padding-right: 30px;
  /* space for close btn */
}

.alerts-modal-header h3 {
  margin: 0;
  flex-grow: 1;
}

.audio-status-icon {
  cursor: pointer;
  font-size: 20px;
  transition: all 0.2s ease;
  padding: 5px;
  border-radius: 4px;
}

.audio-status-icon.blocked {
  color: var(--negative-change-color);
  opacity: 0.7;
}

.audio-status-icon.active {
  color: var(--positive-change-color);
  opacity: 1;
}

.audio-status-icon:hover {
  background: var(--modal-input-bg);
  opacity: 1;
}

#alertsModal .condition-field select {
  padding-left: 28px;
  /* space for the arrow */
}

#alertsModal .condition-field .condition-arrow-text.positive-change {
  color: var(--positive-change-color);
}

#alertsModal .condition-field .condition-arrow-text.negative-change {
  color: var(--negative-change-color);
}

/* Inline row: price (left) + condition (right) */
#alertsModal .price-row-inline {
  display: flex;
  /* more predictable vertical centering */
  align-items: center;
  /* center controls on the same baseline */
  gap: 10px;
  justify-content: center;
  /* center the pair as a group */
  margin: 0 0 6px 0;
}

#alertsModal .price-row-inline>* {
  margin: 0;
}

/* Default dimensions (overridable by theme) */
:root {
  --alert-control-height: 32px;
  --alert-control-width: 150px;
}

/* Equal size: price input */
#alertsModal .price-row-inline #alert-price {
  width: var(--alert-control-width);
  height: var(--alert-control-height);
  box-sizing: border-box;
}

/* Equal size: condition drop-down with arrow wrapper */
#alertsModal .price-row-inline .condition-field {
  width: var(--alert-control-width);
}

#alertsModal .price-row-inline .condition-field #alert-condition {
  width: 100%;
  height: var(--alert-control-height);
}

#alertsModal .add-alert-container {
  display: grid;
  grid-template-columns: 1fr;
  /* full width when only Add Alert is present */
  align-items: stretch;
  /* ensure equal heights for children */
  gap: 10px;
  width: 100%;
  /* use full width of the block */
  margin-left: auto;
  margin-right: auto;
}

#alertsModal .add-alert-container.has-reset {
  grid-template-columns: 1fr 1fr;
  /* split when RESET is visible */
}

/* Make Add Alert and RESET buttons equal size */
#alertsModal #add-alert-btn,
#alertsModal #reset-alerts-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: var(--alert-btn-height, 32px);
  width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
  margin: 0;
  line-height: 1;
  font-size: var(--alert-btn-font-size, 12px);
  font-weight: 500;
  border-width: 1px;
  border-radius: 4px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

/* Coloris Picker Overlay Fixes - SCOPED to Alerts Modal */
body.alerts-open .clr-picker {
  z-index: 200000 !important;
  /* Removed all positional overrides to let Coloris calc coordinates natively */
}

/* Removed size overrides to let 'nano' theme handle layout */

.clr-field button {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 4px;
}

/* Save / Cancel buttons in Add Alert form: same style and 50/50 split */
#alertsModal .form-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* two equal columns */
  align-items: stretch;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#alertsModal .form-buttons .btn,
#alertsModal .form-buttons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: var(--alert-btn-height, 32px);
  width: 100%;
  /* fill its grid cell */
  padding: 0 12px;
  box-sizing: border-box;
  margin: 0;
  line-height: 1;
  font-size: var(--alert-btn-font-size, 12px);
  font-weight: 500;
  border-width: 1px;
  border-radius: 4px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

/* Icon Size Slider Styling (matching alert-price-slider) */
#alertsModal #alert-icon-size {
  background: var(--modal-input-bg);
  border: var(--modal-input-border);
  color: var(--modal-input-color);
  border-radius: 4px;
  box-shadow: var(--modal-input-shadow);
}

#alertsModal #alert-icon-size::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: var(--alert-slider-thumb-width, 22px);
  height: var(--alert-slider-thumb-height, 12px);
  border-radius: var(--alert-slider-thumb-radius, 2px);
  background: var(--accent-color, #577ccd);
  cursor: pointer;
  border: none;
}

#alertsModal #alert-icon-size::-moz-range-thumb {
  width: var(--alert-slider-thumb-width, 22px);
  height: var(--alert-slider-thumb-height, 12px);
  border-radius: var(--alert-slider-thumb-radius, 2px);
  background: var(--accent-color, #577ccd);
  cursor: pointer;
  border: none;
}

/* Segmented Radio Control for Position */
/* Segmented Radio Control for Position */
.radio-label-segment {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 12px;
  /* Compact padding */
  background: var(--modal-input-bg);
  color: var(--modal-label-color);
  border: 1px solid var(--modal-input-border);
  cursor: pointer;
  font-size: 11px !important;
  font-family: 'Poppins', sans-serif;
  transition: all 0.2s;
  user-select: none;
  border-radius: 4px;
}

.radio-label-segment:hover {
  border-color: var(--accent-color);
  color: var(--modal-text-color);
}

input[name="icon-position"]:checked+.radio-label-segment {
  background: var(--accent-color, #577ccd) !important;
  /* Active: Blue (Accent) */
  color: #fff !important;
  /* Active: White */
  border-color: var(--accent-color, #577ccd) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}

/* Coloris Customization for Style Tab - Block Only */
#style-tab .clr-field {
  width: 20px;
  /* Reduced from 60px per user request */
  height: 19px;
  border-radius: 4px;
  border: 1px solid var(--modal-input-border);
  overflow: hidden;
  display: flex !important;
  /* Ensure flex to hold button */
}

/* Hide the text input inside the Coloris wrapper visually, but keep it accessible for events */
#style-tab .clr-field input {
  display: block !important;
  opacity: 0 !important;
  position: absolute !important;
  width: 100% !important;
  height: 100% !important;
  top: 0;
  left: 0;
  z-index: 20 !important;
  /* Forces click to hit input */
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Make the Coloris button (the swatch) fill the container */
#style-tab .clr-field button {
  width: 100% !important;
  height: 100% !important;
  border-radius: 4px !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  transform: none !important;
  position: absolute !important;
  z-index: 10;
  /* Above visible input */
  cursor: pointer !important;
}

/* Editable Alert Price Input */
.alert-price-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  width: 80px;
  padding: 2px 4px;
  transition: all 0.2s;
  cursor: text;
}

.alert-price-input:hover {
  border-color: var(--input-border);
  background: var(--bg-tertiary);
}

.alert-price-input:focus {
  border-color: var(--accent-color);
  background: var(--bg-secondary);
  outline: none;
}

/* Hide spinners in number input */
.alert-price-input::-webkit-inner-spin-button,
.alert-price-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Quick Alert Ghost Button Group */
.chart-quick-alert-group {
  position: absolute;
  display: none;
  /* Hidden by default */
  align-items: center;
  z-index: 2147483647;
  transform: translateZ(0);
  /* Force stacking context always */
  pointer-events: none;
  gap: 8px;
  flex-direction: row;
  /* Button on left, Price label on right */
  right: 0;
  /* Align to the right edge (price scale area) */
}

.chart-quick-alert-btn {
  width: 20px;
  height: 20px;
  background-color: transparent;
  border-radius: 0;
  color: var(--accent-color, #2962ff);
  text-align: center;
  font-size: 20px;
  /* Icon size */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  box-shadow: none;
  user-select: none;
  transition: color 0.1s;
  z-index: 2147483647;
  transform: scale(1);
  /* Matches hover state's stacking context */
}

.chart-quick-alert-btn:hover {
  color: var(--positive-change-color, #10b981);
}

.chart-quick-alert-btn .icon-hover {
  display: none;
}

.chart-quick-alert-btn:hover .icon-normal {
  display: none;
}

.chart-quick-alert-btn:hover .icon-hover {
  display: block;
}

.chart-quick-alert-price {
  background: var(--chart-draw-tools-toggle-bg);
  /* TradingView style axis background */

  font-size: 11px;
  padding: 4px 6px;
  border-radius: 0;
  /* Native look usually has no radius on scale labels */
  font-family: 'Poppins', sans-serif;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  min-width: 60px;
  /* Space for the price axis */
  text-align: center;
}

/* Segmented Radio Control for Position (Legacy - Removed/Replaced) */

/* --- Custom Admin-Style Dropdowns (Ported from auth.css) --- */
.admin-custom-select {
  position: relative;
  min-width: 100%;
  /* Full width in form group */
  user-select: none;
}

.admin-custom-select.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.admin-select-trigger {
  background: var(--modal-input-bg);
  border: 1px solid var(--modal-input-border);
  color: var(--modal-text-color);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 14px;
  /* Matches form inputs */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
  height: 38px;
  /* Standardize height */
  box-sizing: border-box;
}

.admin-select-trigger:hover {
  border-color: var(--accent-color);
  background: var(--hover-bg);
}

.admin-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--modal-input-bg);
  /* Match modal input bg */
  border: 1px solid var(--modal-input-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 9999;
  /* Above other elements */
  display: none;
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
}

.admin-select-dropdown.visible {
  display: block;
  animation: authFadeIn 0.2s ease;
}

.admin-select-item {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--modal-text-color);
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-select-item:hover {
  background: var(--hover-bg);
  color: var(--modal-title-color);
}

.admin-select-item.active {
  background: rgba(var(--auth-accent-rgb, 61, 148, 255), 0.1);
  color: var(--accent-color);
  font-weight: 500;
  border-left-color: var(--accent-color);
}

/* Alert Alignment Buttons (Mirrors Watermark Settings) */
.alert-align-group {
  display: flex;
  background: var(--input-bg, #2a2e39);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color, #444);
  margin-top: 5px;
  /* Spacing for the label above */
}

.alert-align-btn {
  padding: 5px 10px;
  cursor: pointer;
  font-size: 11px;
  color: #888;
  border: none;
  background: transparent;
  transition: all 0.2s;
  flex: 1;
  /* Make them equal width */
}

.alert-align-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.alert-align-btn.active {
  background: var(--accent-color, #2962ff);
  color: white;
}

[data-theme='light'] .alert-align-btn {
  background: #f0f0f0;
  color: #333;
  border-right: 1px solid #ccc;
}

[data-theme='light'] .alert-align-btn:last-child {
  border-right: none;
}

[data-theme='light'] .alert-align-btn.active {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

[data-theme='light'] .alert-align-btn:hover:not(.active) {
  background: #e0e0e0;
}

/* Same style as horizontal line labels */
.chart-alert-price-label {
  position: absolute;
  top: 0;
  right: 0;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--primary-font-family, monospace);
  font-weight: 400;
  color: white;
  background-color: #4CAF50;
  border-radius: 4px;
  pointer-events: auto;
  z-index: 11;
  transform: translateY(-50%);
  white-space: nowrap;
  opacity: 0.95;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Edit and Delete buttons for alerts */
.edit-alert-btn,
.delete-alert-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
}

.edit-alert-btn {
  color: var(--accent-color, #577ccd);
}

.edit-alert-btn:hover {
  background: rgba(var(--accent-color-rgb, 87, 124, 205), 0.2);
  color: var(--accent-color, #577ccd);
}

.delete-alert-btn {
  color: var(--negative-change-color, #ef4444);
}

.delete-alert-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
}

/* Copy exact style from cancel button but with red hover effect */
#delete-alert-btn {
  background-color: var(--chart-cancel-btn-bg);
  width: auto; /* let flex handle width */
  font-size: 0.85rem;
  color: var(--chart-cancel-btn-color);
  font-weight: 700;
  letter-spacing: 0.5px;
  height: 30px;
  border-radius: 2px;
  box-shadow: inset 0 0 10px rgb(255 255 255 / 50%);
  transition: opacity 0.3s ease-out;
}

#delete-alert-btn:hover {
  opacity: 0.7;
  /* Add red indicator to show it's a delete button */
  filter: brightness(0.9) saturate(1.2);
}

/* Adjust the grid layout to have all three buttons in one row when delete is visible */
#alertsModal .add-alert-container {
  display: flex !important;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#alertsModal .add-alert-container.has-delete {
  grid-template-columns: repeat(3, 1fr);
}

/* Make all buttons equal size when in the same row */
#alertsModal #add-alert-btn,
#alertsModal #delete-alert-btn,
#alertsModal #reset-alerts-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: var(--alert-btn-height, 32px);
  padding: 0 12px;
  box-sizing: border-box;
  margin: 0;
  line-height: 1;
  font-size: var(--alert-btn-font-size, 12px);
  font-weight: 500;
  border-width: 1px;
  border-radius: 4px;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}