.menu .checkmark {
    margin-left: -13px;
    background: white;
    width: 5px;
    height: 20px;
    border-radius: 10%;
    float: left;
    content: "⬅";
    margin-top: -3px;
}

#contextslider {
    margin: 0px;
      -webkit-appearance: none;
      appearance: none;
      width: 130px;
      height: 14px;
      background-color: hsl(from var(--modal-background-color) h s calc(l - 2));
      outline: none;
      cursor: pointer;
      border-radius: 20px;
      padding: 0px !important;
      border-left: 1px solid hsl(from var(--modal-background-color) h s calc(l + 5));
      border-top: 1px solid hsl(from var(--modal-background-color) h s calc(l + 5));
      transition: all .3s ease;
      /* box-shadow: 2px 2px 3px hsl(from var(--modal-background-color) h s calc(l + 10)); */
      
  }

  #contextslider::-webkit-slider-track:active {
    background: hsl(from var(--modal-background-color) h s calc(l + 35));
  }
  
  #contextslider:hover {
    background: hsl(from var(--modal-background-color) h s calc(l - 5));
    
    /* box-shadow: 2px 2px 13px hsl(from var(--modal-background-color) h s calc(l + 5)); */
  }
  
  #contextslider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: hsl(from var(--accent-color) h s calc(l - 20));
    cursor: pointer;
    /* border-right: 1px solid #c7c7c7;
    border-bottom: 1px solid #c7c7c7; */
    /* box-shadow: 1px 2px 5px rgba(0,0,0,0.9); */
    transition: all .25s ease-out;
  }
  
  #contextslider::-webkit-slider-thumb:active {
    cursor: pointer;
  }
  
  #contextslider:hover::-webkit-slider-thumb,
  #contextslider::-webkit-slider-thumb:hover {
    background: var(--accent-color);
  }

.nodecontextmenu-attribution-image {
  float: right;
  padding: 2px;
}

/* GIF Search Modal Styles */
.gifsearch {
  min-width: 600px;
  max-width: 700px;
  width: auto;
  background: black;
}

.gifsearch-container {
  padding: 15px;
  /* background: #1a1a1a; */
  border-radius: 8px;
}

.gifsearch-loading {
  text-align: center;
  color: #ccc;
  padding: 20px;
  font-size: 14px;
}

.gifsearch-error {
  text-align: center;
  color: #ff6b6b;
  padding: 20px;
  font-size: 14px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.gifsearch-results {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-height: 300px;
  overflow-y: auto;
}

.gif-thumbnail {
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: #2a2a2a;
  position: relative;
  max-width: 150px;
  min-height: 120px;
}

.gif-thumbnail:hover,
.gif-thumbnail.hover {
  border-color: #6fc6a1;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(111, 198, 161, 0.3);
}

.gif-thumbnail img {
  display: block;
  width: auto;
  height: 120px;
  max-width: 150px;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.gif-thumbnail:hover img {
  opacity: 0.9;
}

/* Scrollbar styling for results */
.gifsearch-results::-webkit-scrollbar {
  width: 6px;
}

.gifsearch-results::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 3px;
}

.gifsearch-results::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

.gifsearch-results::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}
  
  #contextslider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: hsl(from var(--accent-color) h s calc(l - 30));
    cursor: pointer;
    /* border-right: 1px solid #c7c7c7;
    border-bottom: 1px solid #c7c7c7; */
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: background .25s ease-out;
  }
  
  #contextslider::-webkit-slider-thumb:hover {
    background:  var(--accent-color);
    /* border-right: 1px solid #c7ffe7;
    border-bottom: 1px solid #c7ffe7; */
  }
  
  #contextslider::-moz-range-thumb:hover {
    background: var(--accent-color);
    /* border-right: 1px solid #c7ffe7;
    border-bottom: 1px solid #c7ffe7; */
  }
  
  /* Scrolling state styles */
  #contextslider.scrolling::-webkit-slider-thumb {
    background: hsl(from var(--accent-color) h s calc(l - 30)) !important;
    /* border-right: 1px solid #c7ffe7 !important;
    border-bottom: 1px solid #c7ffe7 !important; */
  }
  
  #contextslider.scrolling::-moz-range-thumb {
    background:  hsl(from var(--accent-color) h s calc(l - 30)) !important;
    /* border-right: 1px solid #c7ffe7 !important;
    border-bottom: 1px solid #c7ffe7 !important; */
  }
  
  #contextslider::-webkit-slider-track {
    /* border-left: 1px inset #464545; */
    background: hsl(from var(--modal-background-color) h s calc(l - 20));
    border-radius: 3px;
    height: 4px;
    transition: background .5s ease-out;
  }
  
  #contextslider::-moz-range-track {
    /* border-left: 1px inset #464545; */
    background: #121212;
    border-radius: 3px;
    height: 4px;
    border: none;
    transition: background .5s ease-out;
  }
  
   /* Special styling for hue sliders */
   #contextslider.hue-slider {
    background: linear-gradient(to right, 
      hsl(0, 100%, 50%),
      hsl(60, 100%, 50%),
      hsl(120, 100%, 50%),
      hsl(180, 100%, 50%),
      hsl(240, 100%, 50%),
      hsl(300, 100%, 50%),
      hsl(360, 100%, 50%)
    ) !important;
    border-radius: 20px;
    height: 16px;
  }

  /* Special styling for hue sliders */
  #contextslider.hue-slider::-webkit-slider-track {
    background: linear-gradient(to right, 
      hsl(0, 100%, 50%),
      hsl(60, 100%, 50%),
      hsl(120, 100%, 50%),
      hsl(180, 100%, 50%),
      hsl(240, 100%, 50%),
      hsl(300, 100%, 50%),
      hsl(360, 100%, 50%)
    ) !important;
    border-radius: 20px;
    height: 16px;
  }
  
  #contextslider.hue-slider::-moz-range-track {
    background: linear-gradient(to right, 
      hsl(0, 100%, 50%),
      hsl(60, 100%, 50%),
      hsl(120, 100%, 50%),
      hsl(180, 100%, 50%),
      hsl(240, 100%, 50%),
      hsl(300, 100%, 50%),
      hsl(360, 100%, 50%)
    ) !important;
    border-radius: 20px;
    height: 16px;
    border: none;
  }
  
  #contextslider.hue-slider::-webkit-slider-thumb {
    background: #ffffff00 !important;
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5) !important;
  }
  
  #contextslider.hue-slider::-moz-range-thumb {
    background: #ffffff !important;
    border: 2px solid #333 !important;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5) !important;
  }

/* Context Menu Layout Classes */
.nodecontextmenu-mixed {
  display: flex;
  flex-direction: column;
  opacity: 1;
  top: 0;
  left: 0;
  pointer-events: auto;
  border: 1px solid var(--modal-primary-color);
  border-radius: 7px;
  overflow: visible;
  width: fit-content;
  max-width: 650px;
}

/* Wrapper for content that should appear side-by-side */
.nodecontextmenu-content-wrapper {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

.nodecontextmenu-sliders-container {
    text-align: center;
    overflow-x: scroll;
    display: flex
;
    flex-direction: row;
    padding: 11px;
    /* border-right: 1px solid hsl(from var(--modal-background-color) h s calc(l + 15)); */
    flex-shrink: 0;
    min-height: 200px;
    max-width: 600px;
    align-content: center;
    justify-content: center;
}

.nodecontextmenu-toggles-container {
   order: 2;
    margin: 11px 0px 0px;
    border-radius: 10px;
    display: block;
    /* padding: 5px 12px; */
    gap: 8px;
    min-width: 118px;

}
.nodecontextmenu-toggle-row {
    text-transform: capitalize;
    border-radius: 10px;
    text-align: center;
    border: 1px solid var(--modal-primary-color);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
    width: 85px;
  padding: 8px 12px;
  margin-bottom:10px;
}

.nodecontextmenu-toggle-label {
    /* width: 107px; */
    text-align: center;
    font-size: 12px;
    /* color: #ccc; */
    /* text-align: left; */
    white-space: nowrap;
    flex: 1;
}

.nodecontextmenu-text-container {
  flex-direction: column;
  margin: 0;
  padding: 6px;
  list-style: none;
  flex: 1 1 auto;
  flex-shrink: 0;
  width: auto;
  min-width: 140px;
}

.nodecontextmenu-slider-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.nodecontextmenu-slider-label {
  font-size: 10px;
  color: #ccc;
  margin-bottom: 4px;
  text-align: center;
  max-width: 51px;
    overflow: clip;
}

.nodecontextmenu-value-display {
  font-size: 11px;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 5px;
  font-weight: bold;
  background: transparent;
  border: 1px solid var(--modal-primary-color);
  border-radius: 3px;
  padding: 2px 4px;
  width: 45px;
  transition: all 0.2s ease;
}

.nodecontextmenu-value-display:hover {
  border-color: var(--modal-primary-color);
  background: hsl(from var(--modal-background-color) h s calc(l - 5));
}

.nodecontextmenu-value-display:focus {
  outline: none;
  /* border-color: var(--accent-color); */
  background: hsl(from var(--modal-background-color) h s calc(l - 5));
  box-shadow: 0 0 13px hsl(from var(--accent-color) h s calc(l - 25));
}

.nodecontextmenu-value-display:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  border-color: transparent;
}

.nodecontextmenu-value-display:disabled:hover {
  border-color: transparent;
  background: transparent;
}

.nodecontextmenu-value-display.input {
  background: #151515;
  border-radius: 4px;
  padding: 4px;
  color: #fff;
  margin-bottom: 4px;
  min-width: 30px;
  text-align: center;
  border: 1px solid #2e2e2e;
}

.nodecontextmenu-slider-wrapper {
  transform: rotate(-90deg) translateX(-70px);
  width: 60px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Special layout for Image node context menus */
.nodecontextmenu-image {
  flex-direction: column !important;
  align-items: stretch;
}

.nodecontextmenu-image .nodecontextmenu-sliders-container {
  border-right: none;
  border-bottom: 1px solid rgb(87, 87, 87);
}

.nodecontextmenu-image .nodecontextmenu-text-container {
  border-top: 1px solid rgb(87, 87, 87);
}

/* Search input for Image nodes */
.nodecontextmenu-search-container {
  /* width: 100%; */
  padding: 8px;
  /* border-top: 1px solid rgb(87, 87, 87); */
  /* background: rgba(0, 0, 0, 0.1); */
}

.nodecontextmenu-search-input {
  margin-top: 15px;
  width: 100%;
  padding: 12px 14px;
  background: #2a2a2a;
  border: 1px solid #555;
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.nodecontextmenu-search-input:focus {
  border-color: #6fc6a1;
  background: #333;
  box-shadow: 0 0 0 2px rgba(111, 198, 161, 0.2);
}

.nodecontextmenu-search-input::placeholder {
  color: #888;
}

.nodecontextmenu-cc-container {
  padding-left: 15px;
  padding-right: 15px;
}

.midi-settings-modal{
  min-width: 550px;
  /* height: 650px; */
}

.midi-console-textarea {
  color: #d1d1d1;
  font-size: 11px;
  border-radius: 11px;
  padding: 20px;
  background: #101010;
  width: -webkit-fill-available;
  width: 90%;
}

/* CC History Section */
.cc-history-section {
  max-height: 180px;
  max-width: 550px;
  /* overflow-x: auto; */
  /* border: 1px solid #333; */
  border-radius: 4px;
  /* padding: 15px; */
  /* background-color: #121212; */
}

.cc-columns-container {
  display: flex;
  /* flex-wrap: wrap; */
  padding: 6px;
  overflow: auto;
  gap: 15px;
  margin-bottom: 15px;
}

.cc-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
}

.cc-box {
  background-color: #101010;
  border-bottom: 2px solid #191919;
  border-right: 2px solid #272727;
  border-left: 2px solid black;
  border-top: 2px solid black;
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  text-align: center;
  min-width: 60px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cc-box:hover {
  /* background-color: #161918; */
  border-bottom: 2px solid rgba(55, 78, 70, 0.883);;
  border-right: 2px solid rgba(70, 98, 88, 0.883);;
  /* border-left: 4px solid black;
  border-top: 4px solid black; */
}

.cc-box-selected {
  background-color: #161918;
  border-bottom: 2px solid rgba(55, 78, 70, 0.883);
  border-right: 2px solid rgba(70, 98, 88, 0.883);
  border-left: 2px solid rgba(70, 98, 88, 0.883);
  border-top: 2px solid rgba(70, 98, 88, 0.883);
}

.menu-item.selected {
    /* background-color: var(--accent-color); */
    color: var(--background-color);
    border: 1px solid var(--accent-color);
    /* or add a checkmark via ::before pseudo-element */
}

.menu-item.selected::before {
    /* content: "✓ "; */
    /* or use any other visual indicator */
}

.cc-number {
  font-weight: bold;
    font-size: 12px;
    color: #fff;
    margin-bottom: 5px;
    margin-top: 5px;
}

.cc-min, .cc-max {
  font-size: 10px;
  color: #aaa;
  line-height: 1.2;
}

.cc-slider-container {
  margin-top: 10px;
  margin-left: 21px;
  height: 100px;
  display: flex;
  align-items: center;
}

.cc-slider {
  width: 20px;
  height: 100px;
  position: relative;
}

.cc-slider-track {
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, #555 0%, #222 100%);
  border-radius: 2px;
  position: relative;
  margin: 0 auto;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.cc-slider-thumb {
  width: 21px;
  height: 13px;
  background: linear-gradient(to bottom, #666 0%, #333 50%, #222 100%);
  border: 1px solid #111;
  border-radius: 3px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 
    0 1px 2px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(104, 148, 133, 0.883);
}

.cc-slider-thumb::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 2px;
  background: linear-gradient(to right, #17c096, #088360);
  border-radius: 1px;
}

.no-cc-message {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.clear-cc-button {
  /* background-color: #ff6b6b; */
  color: white;
  border: none;
  padding: 2px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  margin-top: 2px;
}

.clear-cc-button:hover {
  /* background-color: #ff5252; */
}

/* Custom Checkbox for MIDI Device Selection */
.radio-container {
  align-items: center;
  margin-bottom: 9px;
  margin-left: 0px;
}

.radio-label {
  display: block;
  position: relative;
  padding-left: 35px;
  margin-bottom: 12px;
}

.device-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.device-details{
  color: #4a4a4a;
}

.device-name{
  font-size: 13px;
  width: 190px;
}
.device-row {
  margin: 10px;
  border-radius: 10px;
  border: 1px solid #222;
  padding: 12px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

/* Full opacity for device row containing checked radio */
.device-row:has(.device-radio:checked) {
  opacity: 1;
}

.midi-devices-section {
    max-width: 550px;
    display: flex !important
;
    flex-direction: row;
    margin-bottom: 3px !important;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    align-items: flex-start;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: hsl(from var(--accent-color) h s calc(l - 25));
    /* border: 1px solid #555; */
    border-radius: 3px;
}

/* On mouse-over */
.radio-label:hover .checkmark {
    background-color: #444;
}

/* When the radio button is checked */
.radio-label input:checked ~ .checkmark {
    background-color:hsl(from var(--modal-background-color) h s calc(l - 5));
}

/* Create the checkmark/indicator (hidden when not checked) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the checkmark when checked */
.radio-label input:checked ~ .checkmark:after {
    display: block;
}

/* Style the checkmark/indicator */
.checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid var(--accent-color);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* BPM Display Section */
.bpm-section {
    padding: 15px;
    background-color: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.bpm-display {
    display: flex;
    align-items: center;
    gap: 20px;
}

.bpm-readout {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bpm-label {
    font-size: 14px;
    color: #a1a1a1;
    font-weight: 500;
}

.bpm-value {
    font-size: 24px;
    font-weight: bold;
    color: #6ec4a0;
    font-family: 'Courier New', monospace;
    min-width: 60px;
}

.bpm-indicator {
    width: 20px;
    height: 20px;
    background-color: #333;
    border: 2px solid #555;
    border-radius: 4px;
    transition: all 0.1s ease;
}

.bpm-indicator.flash {
    background-color: #6ec4a0;
    border-color: #6ec4a0;
    box-shadow: 0 0 10px rgba(110, 196, 160, 0.5);
}

/* Subtle MIDI button beat flash */
.midi-button.midi-beat-flash {
    background-color: rgba(110, 196, 160, 0.15);
    border-color: rgba(110, 196, 160, 0.3);
    transition: all 0.08s ease-out;
}

/* Inactive button state (grayed out) */
button.inactive {
    opacity: 0.4;
    cursor: default;
}

button.inactive:hover {
    opacity: 0.5;
}

/* Audio visualizer canvas */
.audio-visualizer-canvas {
    width:550px !important;
    height: 200px !important;
    display: block !important;
    /* background: #000000 !important; */
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    /* image-rendering: auto !important; */
    image-rendering:optimizeSpeed !important;
}

.audio-visualizer-section {
    margin-left: 10px;
    margin-right: 20px;
}

/* Delete Node Button */
.nodecontextmenu-delete-button {
    margin: 3px;
    flex-basis: 100%;
    width: 98%;
    color: var(--modal-primary-color);
    background-color: var(--modal-background-color);
    transition: all 0.2s 
ease;
    min-height: 30px !important;
    border-top: 1px solid var(--modal-primary-color);
    border-radius: 5px;
}

.nodecontextmenu-delete-button:hover {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.5);
    color: #ff4757 !important;
}

.nodecontextmenu-delete-button:active {
    background-color: rgba(220, 53, 69, 0.3);
    transform: scale(0.98);
}

#disconnect-item {
    color: hsl(from var(--modal-primary-color) h s calc(l + 25)) !important;
    background-color: var(--modal-background-color) !important;
    text-align: center;
    transition: all 0.2s ease;
    
}

#disconnect-item:hover {
  background-color: rgba(220, 53, 69, 0.2) !important;
    border-color: rgba(220, 53, 69, 0.5) !important;
    color: #ff4757 !important;
}