#toolbar {
    display: flex;
    flex-wrap: nowrap; /* no wrapping, force one line */
    justify-content: flex-start;
    padding: 2vh 0.714vh 2vh 0.714vh;
    background-color: var(--menu-background-color);
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    z-index: 1000;
    height: var(--toolbar-height);
    box-sizing: border-box;
    align-items: center;
}

#toolbarRightContainer {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 1;           /* take up remaining space */
    min-width: 140px;
    justify-content: flex-end; /* keep its content at the right edge */
}

.toolbar-contributor-header,
.toolbar-tag-header,
.toolbar-item-right-settings-items,
.toolbar-item-right-filter,
#rankBox .irs {
  flex: 0 1 auto;  /* allow shrinking (grow = 0, shrink = 1, base = auto) */
  min-width: 0;    /* CRITICAL: allows flex-shrink to actually reduce width */
  box-sizing: border-box;
}



#rightContainerGroup{
    display: flex;
    align-items: center;
    gap: var(--toolbar-right-items-gap);
    min-width: 0;         
}

.toolbar-item-right {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: calc(var(--toolbar-height) / 1.8);
    /* flex-shrink: 0;       */
    object-fit: contain;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0.1vh;
}
.toolbar-section-title {
    font-size: calc(var(--toolbar-height) / 2.4);
    line-height: 1;
    white-space: nowrap;
    align-items: center;
    font-family: 'Calibri', sans-serif;
    color: gray;
    display: flex;
    justify-content: center;
    display: none;
}

.wide-window .toolbar-section-title {
    display: block;
}

.toolbar-item-right-settings-items {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--toolbar-height) / 1.8);
    /* height: calc(var(--toolbar-height) / 1.8); */
    object-fit: contain;
}
#profile{
    width: calc((var(--toolbar-height) / 1.8) * 1.25);
}
#fontAdjust-Icon{
    width: calc((var(--toolbar-height) / 1.8) * 1.1);
}

.toolbar-item-right-filter {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px 0px 0px 1vh;
    height: calc(var(--toolbar-height) / 1.8);
    aspect-ratio: 10 / 1;
    /* width: 150px; */
    min-width: 0;  
    object-fit: contain;
    box-sizing: border-box;
}
#rankBox {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--toolbar-height) / 1.8); 
    width: calc(var(--toolbar-height) * 4); 
    box-sizing: border-box;
    padding: 0 1vh;
    min-width: 0;  
}
#rankBox .irs {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
    scale: 0.9;
    aspect-ratio: 7 / 1
}

.user-wrapper{
    display: inline-flex;
    align-items: center;
    position: relative;
}

.toolbar-item-right-submenu {
  display: none;              
  position: fixed;           
  flex-direction: column;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  padding: var(--toolbar-right-items-gap);
  gap: var(--toolbar-right-items-gap);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  width: calc(var(--toolbar-height) / 1.8);
}
.toolbar-item-right-submenu.open {
  display: flex;
}

.user-menu-item {  
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Calibri', sans-serif;
  font-size: calc(var(--toolbar-height) / 2.4);
}

#kanbanIcon{
    
    /* display: inline-block;
    vertical-align: middle;  */
    height: calc(var(--toolbar-height) / 1.4);
}

.kanban-details-view #overviewIconOn,
.overview-view #overviewIconOn,
.bubbles-view #overviewIconOff,
.details-view #overviewIconOff{
    display: block;   
}

.bubbles-view #overviewIconOn,
.details-view #overviewIconOn,
.kanban-details-view #overviewIconOff,
.overview-view #overviewIconOff{
    display: none;
}

.xray-on #xrayIconOn,
.xray-off #xrayIconOff {
    display: block;
}

.xray-off #xrayIconOn,
.xray-on #xrayIconOff {
    display: none;
}

.font-adjust-container{
    position: relative;
}
.font-adjust-menu{
    position: absolute;
    right: 100%;
    top: 0;
    background: white;
    border: 1px solid #ccc;
    z-index: 9999;
    flex-direction: column;
    align-items: center; 
}
.font-adjust-menu button {
  align-items: center;  
  border: 2px solid transparent; 
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.font-adjust-menu img.active-font-size {
    border: 2px solid #007BFF;
    box-sizing: border-box;
}

.scale-item-submenu {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--toolbar-height) / 1.8);
  width: calc(var(--toolbar-height) / 1.8 * 1.2);
  cursor: pointer;
  transition: border-color 0.2s ease;
  border: 2px solid transparent;
  box-sizing: border-box;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.scale-item-submenu.large-scale {
    background-image: var(--large-scale-not-active);
}
.large-scale .scale-item-submenu.large-scale {
    background-image: var(--large-scale-active);
}
.scale-item-submenu.medium-scale {
    background-image: var(--medium-scale-not-active);
    transform: translateX(-5%);
}
.medium-scale .scale-item-submenu.medium-scale {
    background-image: var(--medium-scale-active);
}
.scale-item-submenu.small-scale {
    background-image: var(--small-scale-not-active);
}
.small-scale .scale-item-submenu.small-scale {
    background-image: var(--small-scale-active);
}



.font-item-submenu.active-font-size {
  border: 2px solid #007bff;
}
.submenu-font-Medium {
  transform: translate(-5%);
}

/* 
.toolbar-item {
    border: 1px solid red;
}
.toolbar-item img, 
.toolbar-item svg {
    border: 1px solid blue;
} */

#toolbarBoardContainer{
    display: flex;
    align-items: center;
    justify-content: space-between; 
    width: 40%;
    min-width: 60px;
    background-color: var(--light-blue);
    border-radius: 45px;
    padding: 0.55vh 1.65vh; /* 4px 12px */
    flex-wrap: nowrap;
    overflow: hidden;           /* prevents content overflow */
}

#rightGroup{
    display: flex;
    align-items: center;
    gap: 0.7vh;
    flex-shrink: 0;             /* icons should not shrink */
}

#leftGroup{
    display: flex;
    align-items: center;
    gap: 1.4vh;
    min-width: 0;               /* allow shrinking */
}

.toolbar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(var(--toolbar-height) / 2.4);
    /* flex-shrink: 0;       */
}

#bookmarkIcon{
    height: calc((var(--toolbar-height) / 2.4));
}

#share-icon{
    height: calc((var(--toolbar-height) / 2.4) * 1.2);
}

.board-title-text {
    display: flex;
    font-family: 'Calibri', sans-serif;
    font-weight: bold;
    font-size: calc(var(--toolbar-height) / 2.4);
    line-height: 1;
    min-width: 0;    
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--dark-gray-font-color);
}

.vertical-divider {
    width: 1px;
    align-self: stretch; 
    background-color: #ccc;
    opacity: 1;
    flex-shrink: 0;     
}

.horizontal-divider{
    height: 1px;
    width: calc(100% + 20px);;
    min-width: 28px;
    background-color: #ccc;
    opacity: 0.6;
    align-self: center;  
    flex-shrink: 0;      
}

#rankBox .irs::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 20%;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgb(221, 232, 238);
  z-index: 1;
  pointer-events: none;        
}

#rankBox .irs-bar {
    height: 20%;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 999px;
    background-color: rgb(6, 113, 171) !important;
    z-index: 2;
}


#rankBox .irs-handle {
    height: calc(var(--toolbar-height) / 1.8);
    width: calc(var(--toolbar-height) / 1.8);
    padding: calc(1.25 * var(--toolbar-right-items-gap));
    aspect-ratio: unset;
    top: 50%;
    transform: translateY(-50%);
    background-color: #255992;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

#rankBox .irs-handle > i {
    color: black;
    font-size: clamp(0.65rem, 0.9vw, 0.9rem);
    font-style: normal;
    font-weight: normal;
    font-family: 'Calibri', sans-serif;
    line-height: 1;
    padding: 4px 5px; 
    text-align: center;
    pointer-events: none;
}

#rankBox .irs-bar--single,
#rankBox .irs-bar--from,
#rankBox .irs-bar--to {
    background-color: #255992 !important;
}

#rankBox .irs-from,
#rankBox .irs-to,
#rankBox .irs-single {
    display: none !important;
}

.i,
#rankBox > span > span.irs-handle.from > i,
#rankBox > span > span.irs-handle.to > i,
#rankBox > span > span.irs-handle.single > i {
    font-style: normal !important;
    font-family: 'Calibri', sans-serif;
    font-weight: normal !important;
    color: white;
    font-size: calc(var(--toolbar-height) / 2.4);;
}

#rankBox .irs-line {
    height: 20%;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 999px;
    z-index: 233223;
    background-color: #b6124e;
}

.shortcuts-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.shortcuts-content {
    background: #fff;
    color: #333;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    font-family: 'Calibri', sans-serif;
}
.shortcuts-content table {
    width: 100%;
    border-spacing: 10px;
}
.shortcuts-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
}
#close-shortcuts {
    margin-top: 15px;
    padding: 6px 12px;
    cursor: pointer;
}
.shortcuts-modal {
    display: flex;
    justify-content: center; 
    align-items: center;     
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
}
.shortcuts-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 500px;
    width: auto;
    box-sizing: border-box;        
    display: flex;
    flex-direction: column;
    align-items: center;         
    text-align: center;
}
.shortcuts-title {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: center;
}
.shortcuts-table {
    border-spacing: 10px 6px;
    margin: 0 auto; 
}
.shortcuts-table td {
    white-space: nowrap;    
}
.shortcuts-action {
    text-align: right;
    padding-right: 12px;
}
.shortcuts-close-wrapper {
    display: flex;
    justify-content: center;   /* center under the action end line */
    margin-top: 15px;
    width: 100%;
}
.shortcuts-key {
    text-align: left;
    padding-left: 12px;
}
.shortcuts-table td.shortcuts-action {
    font-weight: bold;
    color: #333;
    cursor: pointer;
    font-family: Calibri, sans-serif;
    font-size: 14px;
    user-select: none;
    align-items: end;
    text-align: end;
}
.shortcuts-close {
    padding: 6px 12px;
    cursor: pointer;
    align-items: center;
}
.shortcuts-close-wrapper {
    text-align: center;
    margin-top: 15px;
}
.shortcuts-key{
    font-size: 12px;
    color: #888;
    user-select: none;
    font-family: Calibri, sans-serif;
}

.contributor-drag .bubble.target,
.contributor-drag .bubble.target * {
    cursor: var(--dropping-contributor-on-bubble-cursor) 8 8, auto !important;
}
body:has(.contributor-drag .bubble.target){
    
}

.tag-drag .bubble.target,
.tag-drag .bubble.target * {
    cursor: var(--dropping-tag-on-bubble-cursor) 8 8, auto !important;
}

.bubble-drag .bubble.target,
.bubble-drag .bubble.target * {
    cursor: var(--dropping-bubble-on-bubble-cursor) 8 8, auto !important;
}

.bubble-drag .icon-cell.target,
.bubble-drag .icon-cell.target * {
    cursor: var(--dropping-bubble-on-state-cursor) 8 8, auto !important;
}

.bubble.target {
    box-shadow: #007BFF 0 0 0 2px;
}

.tag-drag .sticky-note.target,
.tag-drag .sticky-note.target * {
    cursor: var(--dropping-tag-on-sticky-note-cursor) 8 8, auto !important;
}

.contributor-drag .sticky-note.target,
.contributor-drag .sticky-note.target * {
    cursor: var(--dropping-contributor-on-sticky-note-cursor) 8 8, auto !important;
}

.sticky-note.target {
    box-shadow: #007BFF 0 0 0 2px;
}

/* contributor */

.toolbar-contributor-container {
    max-height: calc(var(--toolbar-height) / 1.3);
    max-width: calc(var(--toolbar-height) / 1.3 + 16px);
    z-index: 1000;
    display: block;
    position: relative;
}

.toolbar-contributor-header {
    display: flex;
    gap: 4px;
    min-width: fit-content;
    padding-left: 6px;
    padding-right: 6px;
    background-color: var(--menu-background-color);
    max-width: min-content;
    justify-content: flex-start;
    transform: translateY(-5%);
}


.toolbar-contributor-title {
    font-weight: bold;
    font-family: 'Calibri', sans-serif;
    height: fit-content;
    width: fit-content;
    width: calc(var(--toolbar-height) / 2.25);
    height: calc(var(--toolbar-height) / 2.25);
    /* margin-right: 1px; */
    background-color: #255992;
    border-radius: 20%;
    transform: translateY(10%);
    border: 1px solid black;
}

.toolbar-contributor-close {
    background-image: url('./icons/dropdown.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: calc(var(--toolbar-height) / 2.5);
    height: calc(var(--toolbar-height) / 2.5);
    padding-top: 2px;
    padding-bottom: 0px;
    cursor: pointer;
    transform: rotate(180deg);
}

.toolbar-contributor-scroller {
    position: absolute;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 3px;
    padding: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    top: calc(var(--toolbar-height) - 0.71vh);
    right: calc(-1 * var(--toolbar-right-items-gap));
    width: max-content;
}

.toolbar-contributor-container.closed .toolbar-contributor-scroller {
    display: none;
}

.toolbar-contributor-container.closed .toolbar-contributor-close {
    transform: rotate(0deg) translateY(calc(var(--toolbar-height) / 7));
}

.toolbar-contributor-scroller::-webkit-scrollbar {
  width: 6px;   
  transition: width 0.2s;
}

.toolbar-contributor-scroller::-webkit-scrollbar-track {
  background: transparent;
}

.toolbar-contributor-scroller::-webkit-scrollbar-thumb {
  background: #b7b7b7;
  border-radius: 10px;
}

.toolbar-contributor-scroller::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

body:has(.toolbar-contributor-container:not(.closed)) .tooltip {
  display: none !important;
}




/* Tag */

.toolbar-tag-container {
    max-height: calc(var(--toolbar-height) / 1.3);
    max-width: calc(var(--toolbar-height) / 1.3 + 16px);
    z-index: 1000;
    display: block;
    position: relative;
}

.toolbar-tag-header {
    display: flex;
    gap: 4px;
    min-width: fit-content;
    padding-left: 6px;
    padding-right: 6px;
    background-color: var(--menu-background-color);
    max-width: min-content;
    justify-content: flex-start;
    transform: translateY(-5%);
}


.toolbar-tag-title {
    font-weight: bold;
    font-family: 'Calibri', sans-serif;
    height: fit-content;
    width: fit-content;
    width: calc(var(--toolbar-height) / 2);
    height: calc(var(--toolbar-height) / 2);
    /* margin-right: 1px; */
    background-image: url('./icons/tags-icon-on.png');
    background-repeat: no-repeat;
    background-size: contain;
    border-radius: 20%;
    transform: translateY(10%);
}

.toolbar-tag-close {
    background-image: url('./icons/dropdown.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: calc(var(--toolbar-height) / 2.5);
    height: calc(var(--toolbar-height) / 2.5);
    padding-top: 2px;
    padding-bottom: 0px;
    cursor: pointer;
    transform: rotate(180deg);
}

.toolbar-tag-scroller {
    position: absolute;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: left;
    gap: 3px;
    padding: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    top: calc(var(--toolbar-height) - 0.71vh);
    right: calc(-1 * var(--toolbar-right-items-gap));
    width: max-content;
}

.toolbar-tag-container.closed .toolbar-tag-scroller {
    display: none;
}

.toolbar-tag-container.closed .toolbar-tag-close {
    transform: rotate(0deg) translateY(calc(var(--toolbar-height) / 7));
}

.toolbar-tag-scroller::-webkit-scrollbar {
  width: 6px;
  transition: width 0.2s;
}

.toolbar-tag-scroller::-webkit-scrollbar-track {
  background: transparent;
}

.toolbar-tag-scroller::-webkit-scrollbar-thumb {
  background: #b7b7b7;
  border-radius: 10px;
}

.toolbar-tag-scroller::-webkit-scrollbar-thumb:hover {
  background: #999999;
}

body:has(.toolbar-tag-container:not(.closed)) .tooltip {
  display: none !important;
}

.profile-menu-container {
  position: relative;
  display: flex;
  align-items: center;
}

.profile-submenu {
  position: absolute;
  top: 100%;
  right: 0;
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 4px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
}

.profile-submenu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.profile-submenu-item:hover {
  background: #f0f0f0;
}

.profile-submenu-item img {
  width: 16px;
  height: 16px;
}
