/* Apply Font */
body {
  font-family: "Poppins", sans-serif;
}

/* Remove Icon */
#storybook-explorer-menu
  .sidebar-item[data-parent-id]
  > button
  > div
  > svg[type],
#storybook-explorer-menu .sidebar-item[data-parent-id] > a > div > svg[type],
#storybook-explorer-menu
  .sidebar-item[data-parent-id="foundation"]
  > a
  > div
  > svg,
#storybook-explorer-menu
  .sidebar-item:not([data-parent-id])
  :not([data-nodetype="story"], [data-nodetype="document"])
  svg[type] {
  display: none;
}

/* Remove default padding */
.sidebar-container [data-radix-scroll-area-viewport] > div,
.sidebar-container [data-radix-scroll-area-content] > div {
  padding: 0 !important;
}

/* Root level background */
#storybook-explorer-tree .sidebar-subheading[data-nodetype="root"] {
  background: #f5f8fa;
  padding: 4px 8px;
  margin: 0;
}

/* Root Level Font */
#storybook-explorer-tree
  .sidebar-subheading[data-nodetype="root"]
  > button[data-action="collapse-root"] {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: normal;
}

/* Re apply the padding each content */
.sidebar-container [data-radix-scroll-area-content] .sidebar-header {
  padding: 16px 12px 0;
}

label[for="storybook-explorer-searchfield"] + div {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Padding Introduction */
#introduction-welcome--docs,
#foundation-color--docs {
  margin-left: 32px !important;
  padding: 4px 8px;
}

/* Target ONLY the Groups (like 'Action / Navigation') inside 'component' */
.sidebar-item[data-parent-id][data-nodetype="group"],
.sidebar-item[data-parent-id][data-nodetype="component"] {
  padding-left: 20px !important;
}

/* When hover not the leaf, don't apply anything */
.sidebar-item[data-parent-id][data-nodetype="group"]:hover,
.sidebar-item[data-parent-id][data-nodetype="component"]:hover {
  --tree-node-background-hover: transparent !important;
  --tree-node-background-selected: transparent !important;
}

.sidebar-item[data-item-id="introduction-welcome--docs"][data-selected="true"],
.sidebar-item[data-parent-id][data-nodetype="document"][data-selected="true"],
.sidebar-item[data-parent-id][data-nodetype="story"][data-selected="true"] {
  background-color: transparent !important;
}

.sidebar-item[data-nodetype="document"] > a,
.sidebar-item[data-nodetype="story"] > button {
  /* Text Color */
  color: #5e6278 !important;
  background-color: transparent !important;

  /* Layout & Spacing */
  padding: 6px 12px !important;
  margin-left: 58px !important;
  margin-top: 4px !important;
  margin-bottom: 4px !important;
  font-weight: 400 !important;
  gap: 8px;
  align-items: center;

  /* Reset button defaults */
  border: 1px solid transparent !important;
  cursor: pointer;
  text-align: left;
}

.sidebar-item[data-nodetype="document"][data-selected="true"] > a,
.sidebar-item[data-nodetype="story"][data-selected="true"] > button {
  flex: none !important;
  width: fit-content !important;
  display: inline-flex !important;
  align-items: center !important;

  background-color: #f1faff !important;
  border: 1px solid #009ef7 !important;
  border-radius: 8px !important;
  color: #009ef7 !important;
}

.sidebar-item[data-nodetype="document"][data-selected="true"] > a svg,
.sidebar-item[data-nodetype="story"][data-selected="true"] > button svg {
  color: currentColor !important;
  fill: currentColor !important;
}

.sidebar-item[data-selected="true"] button[data-testid="context-menu"],
.sidebar-item[data-selected="true"]
  button[aria-label="Open context menu"]:hover {
  box-shadow: none !important;
}

/* ======================================================
Custom Icon 
=========================================================
*/

.sidebar-item[data-nodetype="document"] > a::before,
.sidebar-item[data-nodetype="story"] > button::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;

  background-color: currentColor;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* DOCS ICON */
.sidebar-item[data-nodetype="document"] > a::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g clip-path="url(%23clip0_391_501)"><path d="M5 4C4.86739 4 4.74021 4.05268 4.64645 4.14645C4.55268 4.24021 4.5 4.36739 4.5 4.5C4.5 4.63261 4.55268 4.75979 4.64645 4.85355C4.74021 4.94732 4.86739 5 5 5H11C11.1326 5 11.2598 4.94732 11.3536 4.85355C11.4473 4.75979 11.5 4.63261 11.5 4.5C11.5 4.36739 11.4473 4.24021 11.3536 4.14645C11.2598 4.05268 11.1326 4 11 4H5ZM4.5 6.5C4.5 6.36739 4.55268 6.24021 4.64645 6.14645C4.74021 6.05268 4.86739 6 5 6H11C11.1326 6 11.2598 6.05268 11.3536 6.14645C11.4473 6.24021 11.5 6.36739 11.5 6.5C11.5 6.63261 11.4473 6.75979 11.3536 6.85355C11.2598 6.94732 11.1326 7 11 7H5C4.86739 7 4.74021 6.94732 4.64645 6.85355C4.55268 6.75979 4.5 6.63261 4.5 6.5ZM5 8C4.86739 8 4.74021 8.05268 4.64645 8.14645C4.55268 8.24021 4.5 8.36739 4.5 8.5C4.5 8.63261 4.55268 8.75979 4.64645 8.85355C4.74021 8.94732 4.86739 9 5 9H11C11.1326 9 11.2598 8.94732 11.3536 8.85355C11.4473 8.75979 11.5 8.63261 11.5 8.5C11.5 8.36739 11.4473 8.24021 11.3536 8.14645C11.2598 8.05268 11.1326 8 11 8H5ZM5 10C4.86739 10 4.74021 10.0527 4.64645 10.1464C4.55268 10.2402 4.5 10.3674 4.5 10.5C4.5 10.6326 4.55268 10.7598 4.64645 10.8536C4.74021 10.9473 4.86739 11 5 11H8C8.13261 11 8.25979 10.9473 8.35355 10.8536C8.44732 10.7598 8.5 10.6326 8.5 10.5C8.5 10.3674 8.44732 10.2402 8.35355 10.1464C8.25979 10.0527 8.13261 10 8 10H5Z" fill="black"/><path d="M2 2C2 1.46957 2.21071 0.960859 2.58579 0.585786C2.96086 0.210714 3.46957 0 4 0L12 0C12.5304 0 13.0391 0.210714 13.4142 0.585786C13.7893 0.960859 14 1.46957 14 2V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16H4C3.46957 16 2.96086 15.7893 2.58579 15.4142C2.21071 15.0391 2 14.5304 2 14V2ZM12 1H4C3.73478 1 3.48043 1.10536 3.29289 1.29289C3.10536 1.48043 3 1.73478 3 2V14C3 14.2652 3.10536 14.5196 3.29289 14.7071C3.48043 14.8946 3.73478 15 4 15H12C12.2652 15 12.5196 14.8946 12.7071 14.7071C12.8946 14.5196 13 14.2652 13 14V2C13 1.73478 12.8946 1.48043 12.7071 1.29289C12.5196 1.10536 12.2652 1 12 1Z" fill="black"/></g><defs><clipPath id="clip0_391_501"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g clip-path="url(%23clip0_391_501)"><path d="M5 4C4.86739 4 4.74021 4.05268 4.64645 4.14645C4.55268 4.24021 4.5 4.36739 4.5 4.5C4.5 4.63261 4.55268 4.75979 4.64645 4.85355C4.74021 4.94732 4.86739 5 5 5H11C11.1326 5 11.2598 4.94732 11.3536 4.85355C11.4473 4.75979 11.5 4.63261 11.5 4.5C11.5 4.36739 11.4473 4.24021 11.3536 4.14645C11.2598 4.05268 11.1326 4 11 4H5ZM4.5 6.5C4.5 6.36739 4.55268 6.24021 4.64645 6.14645C4.74021 6.05268 4.86739 6 5 6H11C11.1326 6 11.2598 6.05268 11.3536 6.14645C11.4473 6.24021 11.5 6.36739 11.5 6.5C11.5 6.63261 11.4473 6.75979 11.3536 6.85355C11.2598 6.94732 11.1326 7 11 7H5C4.86739 7 4.74021 6.94732 4.64645 6.85355C4.55268 6.75979 4.5 6.63261 4.5 6.5ZM5 8C4.86739 8 4.74021 8.05268 4.64645 8.14645C4.55268 8.24021 4.5 8.36739 4.5 8.5C4.5 8.63261 4.55268 8.75979 4.64645 8.85355C4.74021 8.94732 4.86739 9 5 9H11C11.1326 9 11.2598 8.94732 11.3536 8.85355C11.4473 8.75979 11.5 8.63261 11.5 8.5C11.5 8.36739 11.4473 8.24021 11.3536 8.14645C11.2598 8.05268 11.1326 8 11 8H5ZM5 10C4.86739 10 4.74021 10.0527 4.64645 10.1464C4.55268 10.2402 4.5 10.3674 4.5 10.5C4.5 10.6326 4.55268 10.7598 4.64645 10.8536C4.74021 10.9473 4.86739 11 5 11H8C8.13261 11 8.25979 10.9473 8.35355 10.8536C8.44732 10.7598 8.5 10.6326 8.5 10.5C8.5 10.3674 8.44732 10.2402 8.35355 10.1464C8.25979 10.0527 8.13261 10 8 10H5Z" fill="black"/><path d="M2 2C2 1.46957 2.21071 0.960859 2.58579 0.585786C2.96086 0.210714 3.46957 0 4 0L12 0C12.5304 0 13.0391 0.210714 13.4142 0.585786C13.7893 0.960859 14 1.46957 14 2V14C14 14.5304 13.7893 15.0391 13.4142 15.4142C13.0391 15.7893 12.5304 16 12 16H4C3.46957 16 2.96086 15.7893 2.58579 15.4142C2.21071 15.0391 2 14.5304 2 14V2ZM12 1H4C3.73478 1 3.48043 1.10536 3.29289 1.29289C3.10536 1.48043 3 1.73478 3 2V14C3 14.2652 3.10536 14.5196 3.29289 14.7071C3.48043 14.8946 3.73478 15 4 15H12C12.2652 15 12.5196 14.8946 12.7071 14.7071C12.8946 14.5196 13 14.2652 13 14V2C13 1.73478 12.8946 1.48043 12.7071 1.29289C12.5196 1.10536 12.2652 1 12 1Z" fill="black"/></g><defs><clipPath id="clip0_391_501"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>');
}

/* STORY ICON */
.sidebar-item[data-nodetype="story"] > button::before {
  -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g clip-path="url(%23clip0_391_519)"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.752 0.0659608C7.82753 0.0228156 7.91301 0.00012207 8 0.00012207C8.08699 0.00012207 8.17247 0.0228156 8.248 0.0659608L11.998 2.20896C12.0745 2.25267 12.1381 2.31584 12.1824 2.39205C12.2266 2.46827 12.25 2.55483 12.25 2.64296V6.63796L15.748 8.63796C15.8242 8.6815 15.8877 8.74436 15.9319 8.82019C15.9761 8.89602 15.9996 8.98217 16 9.06996V13.356C16 13.4441 15.9766 13.5307 15.9324 13.6069C15.8881 13.6831 15.8245 13.7462 15.748 13.79L11.998 15.933C11.9225 15.9761 11.837 15.9988 11.75 15.9988C11.663 15.9988 11.5775 15.9761 11.502 15.933L8 13.933L4.498 15.934C4.42247 15.9771 4.33699 15.9998 4.25 15.9998C4.16301 15.9998 4.07753 15.9771 4.002 15.934L0.252 13.791C0.175473 13.7472 0.11186 13.6841 0.0676055 13.6079C0.0233513 13.5317 2.8427e-05 13.4451 0 13.357L0 9.07096C2.8427e-05 8.98283 0.0233513 8.89627 0.0676055 8.82005C0.11186 8.74384 0.175473 8.68067 0.252 8.63696L3.75 6.63796V2.64296C3.75003 2.55483 3.77335 2.46827 3.81761 2.39205C3.86186 2.31584 3.92547 2.25267 4.002 2.20896L7.752 0.0659608ZM4.25 7.50396L1.508 9.07096L4.25 10.638L6.992 9.07096L4.25 7.50396ZM7.5 9.93296L4.75 11.504V14.638L7.5 13.067V9.93296ZM8.5 13.067L11.25 14.638V11.504L8.5 9.93296V13.067ZM9.008 9.07096L11.75 10.638L14.492 9.07096L11.75 7.50396L9.008 9.07096ZM11.25 6.63796V3.50396L8.5 5.07596V8.20996L11.25 6.63796ZM7.5 8.20996V5.07596L4.75 3.50396V6.63796L7.5 8.20996ZM5.258 2.64296L8 4.20996L10.742 2.64296L8 1.07596L5.258 2.64296ZM15 9.93296L12.25 11.504V14.638L15 13.067V9.93296ZM3.75 14.638V11.504L1 9.93296V13.067L3.75 14.638Z" fill="black"/></g><defs><clipPath id="clip0_391_519"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>');
  mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none"><g clip-path="url(%23clip0_391_519)"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.752 0.0659608C7.82753 0.0228156 7.91301 0.00012207 8 0.00012207C8.08699 0.00012207 8.17247 0.0228156 8.248 0.0659608L11.998 2.20896C12.0745 2.25267 12.1381 2.31584 12.1824 2.39205C12.2266 2.46827 12.25 2.55483 12.25 2.64296V6.63796L15.748 8.63796C15.8242 8.6815 15.8877 8.74436 15.9319 8.82019C15.9761 8.89602 15.9996 8.98217 16 9.06996V13.356C16 13.4441 15.9766 13.5307 15.9324 13.6069C15.8881 13.6831 15.8245 13.7462 15.748 13.79L11.998 15.933C11.9225 15.9761 11.837 15.9988 11.75 15.9988C11.663 15.9988 11.5775 15.9761 11.502 15.933L8 13.933L4.498 15.934C4.42247 15.9771 4.33699 15.9998 4.25 15.9998C4.16301 15.9998 4.07753 15.9771 4.002 15.934L0.252 13.791C0.175473 13.7472 0.11186 13.6841 0.0676055 13.6079C0.0233513 13.5317 2.8427e-05 13.4451 0 13.357L0 9.07096C2.8427e-05 8.98283 0.0233513 8.89627 0.0676055 8.82005C0.11186 8.74384 0.175473 8.68067 0.252 8.63696L3.75 6.63796V2.64296C3.75003 2.55483 3.77335 2.46827 3.81761 2.39205C3.86186 2.31584 3.92547 2.25267 4.002 2.20896L7.752 0.0659608ZM4.25 7.50396L1.508 9.07096L4.25 10.638L6.992 9.07096L4.25 7.50396ZM7.5 9.93296L4.75 11.504V14.638L7.5 13.067V9.93296ZM8.5 13.067L11.25 14.638V11.504L8.5 9.93296V13.067ZM9.008 9.07096L11.75 10.638L14.492 9.07096L11.75 7.50396L9.008 9.07096ZM11.25 6.63796V3.50396L8.5 5.07596V8.20996L11.25 6.63796ZM7.5 8.20996V5.07596L4.75 3.50396V6.63796L7.5 8.20996ZM5.258 2.64296L8 4.20996L10.742 2.64296L8 1.07596L5.258 2.64296ZM15 9.93296L12.25 11.504V14.638L15 13.067V9.93296ZM3.75 14.638V11.504L1 9.93296V13.067L3.75 14.638Z" fill="black"/></g><defs><clipPath id="clip0_391_519"><rect width="16" height="16" fill="white"/></clipPath></defs></svg>');
}

/* RESET GAP (For Icon) */
.sidebar-item:not([data-nodetype="component"]):not([data-nodetype="group"]) > a,
.sidebar-item:not([data-nodetype="component"]):not([data-nodetype="group"])
  > button {
  gap: 0 !important;
}

/* ======================================================
Icon Behavior
=========================================================
*/

.sidebar-item[data-nodetype="document"]:not([data-selected="true"]) > a:hover,
.sidebar-item[data-nodetype="story"]:not([data-selected="true"])
  > button:hover {
  color: #009ef7 !important;

  background-color: transparent !important;
  border: 1px solid transparent !important;
}

.sidebar-item[data-nodetype="document"]:not([data-selected="true"])
  > a:hover::before,
.sidebar-item[data-nodetype="story"]:not([data-selected="true"])
  > button:hover::before {
  background-color: #009ef7 !important;
}

.sidebar-item[data-nodetype="document"]:hover,
.sidebar-item[data-nodetype="story"]:hover {
  background-color: transparent !important;
}

/* ======================================================== */

.sidebar-item[data-nodetype="document"],
.sidebar-item[data-nodetype="story"] {
  background-color: transparent !important;
  background: transparent !important;

  transition: none !important;
  transition-property: none !important;
}

.sidebar-item[data-nodetype="document"] > a:focus,
.sidebar-item[data-nodetype="story"] > button:focus,
.sidebar-item[data-nodetype="document"] > a:active,
.sidebar-item[data-nodetype="story"] > button:active {
  box-shadow: none !important;
}

.sidebar-item[data-nodetype="document"]:not([data-selected="true"]) > a:hover,
.sidebar-item[data-nodetype="story"]:not([data-selected="true"])
  > button:hover {
  color: #009ef7 !important;
}

/* Remove skip to canvas */
.sidebar-item[data-nodetype="document"] > a[href="#storybook-preview-wrapper"],
.sidebar-item[data-nodetype="document"]
  > a[href="#storybook-preview-wrapper"]:focus {
  display: none !important;
}

#storybook-explorer-menu .sidebar-item[data-parent-id] > button > div {
  align-self: center;
  margin-top: 0;
  margin-bottom: 1px;
}

/* Background Side menu div */
[data-ref-id="storybook_internal"][data-item-id]:not(
    [data-selected="true"]
  )[data-nodetype="component"],
[data-ref-id="storybook_internal"][data-item-id]:not(
    [data-selected="true"]
  )[data-nodetype="group"] {
  background-color: transparent !important;
  padding-top: 4px;
  padding-bottom: 4px;
}

/* Background root behavior */
.sidebar-subheading > button[data-action="collapse-root"]:hover,
.sidebar-subheading > button[data-action="expand-all"]:hover {
  background-color: transparent !important;
  color: #5e6278;
}
