/* static/css/roi.css */

/* ##########################
        Color Setting
########################## */
:root {
  --bg-roi-container:   rgb(23,23,23);
  --bg-roi-item: rgb(70,70,70);
  --bg-roi-item-hover: rgb(120,120,120);
  --text-roi-item: rgb(255,255,255);
  --text-roi-menu-btn: rgb(255,255,255);
  --bg-roi-action-menu: rgb(120,120,120);
  --bg-roi-action-menu-hover: rgb(70,70,70);
  --text-roi-action-menu: rgb(255,255,255);
}

[data-theme="light"] {
  --bg-roi-container:   rgb(255,255,255);
  --bg-roi-item: rgb(180,180,180);
  --bg-roi-item-hover: rgb(225,225,225);
  --text-roi-item: rgb(0,0,0);
  --text-roi-menu-btn: rgb(0,0,0);
  --bg-roi-action-menu: rgb(225,225,225);
  --bg-roi-action-menu-hover: rgb(180,180,180);
  --text-roi-action-menu: rgb(0,0,0);
}



/* ##########################
        ROI Item
########################## */ 
.roi-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 211px;
  max-height: 211px;
  overflow-y: auto;
  margin: 15px 15px 15px 15px;
  background: var(--bg-roi-container);
  border-radius: 15px;
}
.roi-entry {
  position: relative;
  width: 100%;
  box-sizing: border-box;
  padding: 0 5px;
}
.roi-item {
  display: flex;
  align-items: center;
  text-align: left;
  font-size: 14px;
  width: 100% !important;
  height: 30px !important;
  margin: 5px 0 5px 0;
  padding: 0 28px 0 5px;
  background: var(--bg-roi-item);
  color: var(--text-roi-item);
  border: none;
  border-radius: 15px;
  cursor: pointer;
}
.roi-rename-input{
  font: inherit;
  width: 100%;
  padding: 2px 6px;
  margin: 0;                   
  background: transparent;
  color: var(--text-roi-item);
  border: none;
  caret-color: currentColor;
}
.roi-item.editing{
  cursor: text;
  background: var(--bg-roi-item-hover);
}
.roi-item .roi-label{
  flex: 1;
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.roi-item-selected{
  background: var(--bg-roi-item-hover) !important;
}
.roi-menu-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  z-index: 2;
  color: var(--text-roi-menu-btn);
  line-height: 1;
}
.roi-action-menu {
  position: absolute;
  background: var(--bg-roi-action-menu);
  border-radius: 6px;
  box-shadow: 0px 2px 6px rgba(0,0,0,0.25);
  padding: 4px 0;
  z-index: 9999;
  min-width: 120px;
}
.roi-action-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 12px;
  text-align: left;
  color: var(--text-roi-action-menu);
}
.roi-action-menu button:hover {
  background: var(--bg-roi-action-menu-hover);
}





/* --- Scrollbar --- */
/* Firefox */
.roi-container {
  /* thumb color / track color */
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;                 /* auto | thin | none */
  overflow-y: auto;
  scrollbar-gutter: stable;        /* Keep scrollbar space stable to prevent layout shift when scrollbar appears/disappears */
  --sbw: 10px;                     /* Scrollbar width, should match the webkit setting */
}
/* Chrome / Edge / Safari */
.roi-container::-webkit-scrollbar {
  width: 10px;
  width: var(--sbw);           
}
.roi-container::-webkit-scrollbar-track {
  background: var(--scrollbar-track);    
  border-radius: 10px;
}
.roi-container::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
  border-radius: 10px;
  border: 2px solid var(--scrollbar-track);
}
.roi-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}
.roi-container::-webkit-scrollbar-button {
  display: none;
}
