:root {
  --toolbar-chatbot-width: 21rem;
}

/* Chatbot positioning */
.block-ai-deepchat-block {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  opacity: 0;
  transition: width var(--admin-toolbar-transition), var(--admin-toolbar-transition);
  z-index: calc(var(--admin-toolbar-z-index-top-bar, 505) + 1);
  pointer-events: none;
}
body.ai-chatbot-opened .block-ai-deepchat-block {
  opacity: 1;
  width: var(--toolbar-chatbot-width);
  pointer-events: all;
  z-index: calc(var(--admin-toolbar-z-index-admin-toolbar-control-bar, 505) + 1);
}

.block-ai-deepchat-block deep-chat {
  margin: 16px 0;
  border: 0 !important;
  box-shadow: none !important;
}

/* Chatbot styles */
.chat-container {
  padding: 0 16px;
  background-color: white;
  height: 100vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgb(0, 0, 0, 0.2);
}

/* Header */
.sidebar-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.sidebar-header--icon {
  padding-inline: 10px;
  padding-block: calc(var(--gin-spacing-xs) + 1px);
  margin-block-end: var(--gin-spacing-xxxs);
  height: 38px;
  width: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 6px;
  display: inline-flex;
}
.sidebar-header--icon::before {
  mask-size: 18px;
  background-color: black;
  mask-repeat: no-repeat;
  mask-position: center;
  content: ' ';
  width: 38px;
  height: 38px;
}
.sidebar-header--icon.close::before {
  mask-image: url('../assets/close.svg');
}
.sidebar-header--icon.expand::before {
  mask-image: url('../assets/expand.svg');
}
.sidebar-header--icon:hover {
  color: var(--gin-color-primary);
  background-color: var(--gin-bg-item-hover);
}

.sidebar-header--title {
  margin-right: auto;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-header--title::before {
  background-image: url(../assets/ai-star-avatar.svg);
  background-size: 18px;
  background-repeat: no-repeat;
  background-position: center;
  content: ' ';
  width: 18px;
  height: 18px;
}

@media (min-width: 1024px) { 
  /* Page positioning */
  body.ai-chatbot-opened  {
    --drupal-displace-offset-left: 25rem;
  }

  body.ai-chatbot-opened .gin--navigation-top-bar {
    --admin-toolbar-sidebar-width: 24rem;
    z-index: 1;
  }

  body.ai-chatbot-opened .admin-toolbar {
    margin-left: var(--toolbar-chatbot-width);
    transition: margin var(--admin-toolbar-transition);
  }

  body.ai-chatbot-opened [data-toolbar-popover-control][aria-expanded="true"] + [data-toolbar-popover-wrapper] {
    transform: translateX(calc(var(--admin-toolbar-sidebar-width) + var(--toolbar-chatbot-width)));
  }

  body:not(.ai-chatbot-opened) .admin-toolbar ~ .dialog-off-canvas-main-canvas {
    --drupal-displace-offset-left: var(--admin-toolbar-sidebar-width);
  }

  .admin-toolbar__content,
  .admin-toolbar__footer {
    border-inline-start: 1px solid var(--admin-toolbar-color-gray-100);
  }

  .gin--core-navigation .chat-container {
    box-shadow: none;
  }
}