@import "scss/variables";

@mixin start-menu-button {
  align-items: center;
  display: flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.StartButton {
  @include start-menu-button;
  color: white !important;
  cursor: pointer;
  font-size: 24px;

  &:hover,
  &.active {
    background: $taskbar-item-hover;
  }
}

.StartMenu {
  background: change-color($start-menu-background, $alpha: 0.9);
  backdrop-filter: blur(3px);
  display: flex;
  height: 432px;
  max-width: 600px;
  user-select: none;
  width: calc(100vw * 0.75);

  &.read-only {
    width: 200px;
  }

  .toolbar {
    height: 432px;
    position: relative;
    width: 48px;

    .toolbar-inner {
      bottom: 0px;
      display: flex;
      flex-direction: column;
      left: 0px;
      position: absolute;
      top: 0px;
      width: 48px;

      .toolbar-extend {
        margin-top: auto;
      }

      .toolbar-item {
        align-items: center;
        color: white;
        display: flex;
        cursor: pointer;
        flex-wrap: nowrap;
        font-size: 16px;
        height: 48px;
        overflow: hidden;
        padding-right: 16px;
        white-space: nowrap;

        .toolbar-item-icon {
          @include start-menu-button;
          min-width: 48px;
        }

        &:hover {
          background: change-color($start-menu-toolbar-item-hover, $alpha: 0.95);
        }
      }
    }

    &.expanded {
      .toolbar-inner {
        background: change-color($start-menu-expanded-toolbar-background, $alpha: 0.6);
        backdrop-filter: blur(3px);
        transition: background 0.5s;
        transition: width 0.5s;
        width: 200px;

        .toolbar-item:hover {
          background: change-color($start-menu-expanded-toolbar-item-hover, $alpha: 0.6);
        }
      }
    }
  }

  .widgets {
    flex: 1;
    height: 432px;
    padding-bottom: 1rem;

    .widget {
      background: $start-menu-widget-background;
      color: $white;
      cursor: pointer;
      display: inline-block;
      height: 118px;
      margin-left: 1rem;
      margin-top: 1rem;
      padding: 0.5rem;
      text-align: center;
      vertical-align: top;
      width: 118px;

      &.disabled {
        background: $gray-600;
        color: $gray-500;
        cursor: not-allowed;
      }

      &:not([class~="disabled"]):hover {
        box-shadow: inset 0px 0px 0px 3px $gray-400;
      }

      p {
        margin-top: 12px;
        margin-bottom: 0px;
      }
    }
  }

  @media screen and (max-width: 767px) {
    flex-direction: column;
    width: 100vw !important;

    &.read-only {
      height: 48px;
    }

    .toolbar {
      height: 48px;
      width: 100%;

      .toolbar-inner {
        bottom: unset;
        flex-direction: row;
        height: 48px;
        position: relative;
        right: unset;
        top: unset;
        width: 100% !important;

        .toolbar-extend {
          display: flex;
          margin-top: 0px;
          margin-left: auto;
        }

        .toolbar-item {
          height: 48px;
          overflow: hidden;
          width: 48px;
        }
      }
    }
  }
}
