/* Right Bar Core Styles */
#right-bar {
  position: fixed !important;
  right: 0 !important;
  width: 340px !important;
  height: calc(100% - 63px);
  transition: transform 0.5s ease;
  z-index: 999 !important;
}

[rightbar="show"] #right-bar {
  transform: translate(0, 0) !important;
}

[rightbar="hide"] #right-bar {
  transform: translate(100%, 0);
}

/* Content Div Adjustments */
div#content-div {
  transition: margin 0.4s ease;
}

html[rightbar="show"] #content-wrapper:has(#right-bar) #content-div {
  margin-right: 340px !important;
}

[rightbar="hide"] #content-div {
  margin-right: 0 !important;
}

/* Collapse Button Styles */
.rightbar-collapse {
  position: fixed;
  top: 52%;
  right: 312px;
  transform: translate(-50%, -50%);
  z-index: 9;
  padding: 8px;
  border-radius: 50px;
  display: flex;
  background-color: #424242;
  transition: all 0.5s ease;
  cursor: pointer;
}

[rightbar="hide"] .rightbar-collapse {
  right: 10px !important;
  transform: translate(-50%, -50%) rotate(180deg) !important;
}

div#rightbar-close-btn svg {
  border-radius: 50px;
  padding: 8px;
  background: var(--secondary);
  width: 35px;
  height: 35px;
}

/* Tablet View (768px - 991px) */
@media screen and (max-width: 991px) and (min-width: 768px) {
  div#right-bar {
    width: 100% !important;
    height: 100%;
    top: 0;
    bottom: 0;
    overflow: auto;
    background-color: var(--primary);
    z-index: 999;
  }

html[rightbar="show"] #content-wrapper:has(#right-bar) #content-div {
    margin-right: 0px !important;
}
  
  [rightbar="show"] div#content-div {
    margin-right: 0 !important;
  }
  
  div#rightbar-close-btn {
    display: flex;
  }
}

/* Mobile View (<=767px) */
@media screen and (max-width: 767px) {
  #right-bar {
    z-index: 999999;
    transition: all 0.5s ease;
    background: var(--primary);
    top: 0;
  }
  
  [rightbar="show"] #right-bar,
  [rightbar="hide"] #right-bar {
    position: fixed;
    width: 100% !important;
    display: flex !important;
  }
  
  [rightbar="show"] #right-bar {
    transform: translate(0, 0) !important;
  }
  
  [rightbar="hide"] #right-bar {
    transform: translate(100%, 0) !important;
    padding: 20px !important;
  }
  
  [rightbar="show"] div#content-div,
  [rightbar="hide"] div#content-div {
    transition: margin-right 0.5s ease;
    overflow: hidden;
  }
  
  [rightbar="show"] div#content-div {
    margin-right: 338px !important;
  }
  
  [rightbar="hide"] div#content-div {
    margin-right: 0 !important;
  }
  
  [rightbar="hide"] .rightbar-collapse {
    transform: translate(-50%, -50%) rotate(0deg) !important;
  }
  
  div#right-bar {
    height: 100% !important;
  }
}


@media screen and (min-width: 992px){
div#rightbar-collapse {
    z-index: 9999;
}
}