/*
*********************************************************************************************************
* Styles the vertical pane bar (header, tool buttons, responsive states) including collapsed-mode tweaks.
*********************************************************************************************************
*/
.pane {
  .pane-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    z-index: 2;
    @media (min-width: 768px) {
      gap: 16px;
      width: 160px;
      flex-direction: column;
    }
    @media (max-width: 767.5px) {
      gap: 20px;
      flex-direction: row;
      height: 28px;
      align-items: center;
      padding: 0 10px;
      width: 100vw;
      overflow-x: auto;
      overflow-y: hidden;
      border-bottom: 1px solid var(--grey-200);
    }

    .bar-header {
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: transform 0.2s;
      flex-direction: column;
      @media (min-width: 768px) {
        flex-direction: column;
        width: 100%;
        padding: 28px 16px 8px;
      }
      @media (max-width: 767.5px) {
        flex-direction: row;
        gap: 5px;
      }

      &:hover {
        transform: scale(1.05);
      }

      .fas {
        color: var(--grey-800);
        @media (max-width: 767.5px) {
          font-size: 12px;
        }
      }

      .dssc-logo-mark {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
      }

      .dssc-logo-mark img {
        width: 100%;
        height: 100%;
        display: block;
      }

      .label {
        text-align: center;
        width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        @media (min-width: 768px) {
          font-size: 20px;
          font-weight: 600;
        }
        @media (max-width: 767.5px) {
          font-size: 14px;
          font-weight: 900;
        }
      }
    }

    .bar-items {
      display: flex;
      flex: 1;
      @media (min-width: 768px) {
        flex-direction: column;
        gap: 16px;
        overflow-y: auto;
        overflow-x: hidden;
        align-items: center;
        padding: 0 8px;
        scrollbar-width: none;
      }
      @media (max-width: 767.5px) {
        gap: 10px;
      }

      @media (min-width: 768px) {
        &::-webkit-scrollbar {
          display: none;
        }
      }

      .bar-item-md {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        cursor: pointer;
        transition:
          transform 0.4s,
          opacity 0.2s;
        @media (min-width: 768px) {
          gap: 8px;
          padding: 14px 16px;
          border-radius: 16px;
          border: 1px solid color-mix(in srgb, var(--primary-color-300) 60%, transparent 40%);
          background: transparent;
          box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
        }
        @media (max-width: 767.5px) {
          max-width: 100px;
          flex-direction: row;
          gap: 5px;
        }

        .icon {
          @media (max-width: 767.5px) {
            display: flex;
          }
        }

        .fas {
          color: var(--grey-500);
          @media (max-width: 767.5px) {
            font-size: 12px;
          }
        }

        .label {
          font-size: 14px;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          text-align: center;
          width: 100%;
          @media (min-width: 768px) {
            white-space: normal;
            overflow: visible;
            text-overflow: initial;
            text-wrap: balance;
          }
          @media (max-width: 767.5px) {
            font-size: 12px;
          }
        }

        &:hover {
          transform: scale(1.1);
          color: black;
          .fas {
            color: black;
          }
        }

        &.active {
          transform: none;
          background: var(--primary-color-100);
          border-radius: 12px;
          padding: 12px 20px;
          color: var(--primary-color-800);
          font-weight: 600;

          .fas {
            color: var(--primary-color-700);
          }

          @media (min-width: 768px) {
            background: color-mix(in srgb, var(--primary-color-100) 70%, #ffffff 30%);
            border-radius: 16px;
            padding: 14px 16px;
            border-width: 2px;
            border-color: color-mix(in srgb, var(--primary-color-400) 85%, transparent 15%);
            box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
          }
        }
      }
    }
  }

  /* Collapsed pane tweaks (desktop) */
  @media (min-width: 768px) {
    &:not(.active) {
      .pane-bar {
        background: var(--collapsed-color, var(--primary-color));
        color: var(--collapsed-text-color, white);
        width: var(--collapsed-width);
        padding: 16px 0 12px;
        align-items: center;
        justify-content: flex-start;
      }

      .pane-bar .bar-header {
        gap: 12px;
        padding: 12px 10px 0;
        align-items: center;
        width: 100%;
        flex-direction: column;
        transform-origin: top center;
        transition: transform 0.2s;
      }

      .pane-bar .bar-header:hover {
        transform: translateY(-4px);
      }

      .pane-bar .bar-header .fas {
        display: block;
        font-size: 18px;
      }

      .pane-bar .bar-header .dssc-logo-mark {
        width: 24px;
        height: 24px;
      }

      .pane-bar .bar-header .label {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        text-align: center;
        font-size: 16px;
        font-weight: 600;
        color: inherit;
        line-height: 1.1;
        width: auto;
        max-width: 100%;
      }

      .pane-bar .bar-items,
      .pane-bar .bar-tools {
        display: none !important;
      }
    }
  }

  &.active {
    .pane-bar {
      background: color-mix(in srgb, var(--collapsed-color, transparent) 25%, #ffffff 75%);
      color: var(--collapsed-text-color, inherit);
    }
  }
}

.pane .pane-bar .bar-item-md[data-breadcrumb-depth] {
  --bar-depth-accent: var(--primary-color-600);
  background: color-mix(in srgb, var(--bar-depth-accent) 28%, #ffffff 72%);
  border-color: color-mix(in srgb, var(--bar-depth-accent) 70%, transparent 30%);
}

.pane .pane-bar .bar-item-md[data-breadcrumb-depth] .label {
  color: color-mix(in srgb, var(--bar-depth-accent) 92%, #000000 8%);
}

.pane .pane-bar .bar-item-md[data-breadcrumb-depth] .icon,
.pane .pane-bar .bar-item-md[data-breadcrumb-depth] .fas {
  color: color-mix(in srgb, var(--bar-depth-accent) 90%, #000000 10%);
}

.pane .pane-bar .bar-item-md[data-breadcrumb-depth='1'] {
  --bar-depth-accent: color-mix(in srgb, var(--primary-color-800) 70%, #1f2937 30%);
}

.pane .pane-bar .bar-item-md[data-breadcrumb-depth='2'] {
  --bar-depth-accent: var(--primary-color-600);
}

.pane .pane-bar .bar-item-md[data-breadcrumb-depth='3'] {
  --bar-depth-accent: var(--primary-color-400);
}

.pane .pane-bar .bar-item-md.active[data-breadcrumb-depth] {
  background: color-mix(in srgb, var(--bar-depth-accent) 40%, #ffffff 60%);
  border-color: color-mix(in srgb, var(--bar-depth-accent) 85%, transparent 15%);
}

.connection-part {
  transition: opacity 0.2s;

  &.faded-connection {
    opacity: 0.4;
  }
}
