// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@use "common/refactor/common-refactor.scss" as *;
@use "common/refactor/common-dashboard";

.dashboard-container {
  flex: 1 0 0;
  width: 100%;
  margin-right: $s-16;
  border-top: $s-1 solid var(--panel-border-color);
  overflow-y: auto;
}

.dashboard-projects {
  user-select: none;
  height: calc(100vh - $s-64);
}

.with-team-hero {
  height: calc(100vh - $s-280);
}

.dashboard-shared {
  width: calc(100vw - $s-320);
  margin-right: $s-52;
}

.search {
  margin-top: $s-12;
}

.dashboard-project-row {
  --actions-opacity: 0;
  margin-bottom: $s-24;
  position: relative;

  &:hover,
  &:focus,
  &:focus-within {
    --actions-opacity: 1;
  }
}

.pinned-project {
  --actions-opacity: 1;
}

.projects-container {
  display: grid;
  grid-auto-rows: min-content;
}

.project {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: $s-8;
  width: 99%;
  max-height: $s-40;
  padding: $s-8 $s-8 $s-8 $s-16;
  margin-top: $s-16;
  border-radius: $br-4;
}

.project-name-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: $s-32;
  margin-left: $s-8;
}

.project-name {
  @include bodyLargeTypography;
  @include textEllipsis;
  width: fit-content;
  margin-right: $s-12;
  line-height: 0.8;
  color: var(--title-foreground-color-hover);
  cursor: pointer;
  height: $s-16;
}

.info-wrapper {
  display: flex;
  align-items: center;
  gap: $s-8;
}

.info,
.recent-files-row-title-info {
  @include bodyMediumTypography;
  color: var(--title-foreground-color);
  @media (max-width: 760px) {
    display: none;
  }
}

.project-actions {
  display: flex;
  opacity: var(--actions-opacity);
  margin-left: $s-32;
}

.add-file-btn,
.options-btn {
  @extend .button-tertiary;
  height: $s-32;
  width: $s-32;
  margin: 0 $s-8;
  padding: $s-8;
}

.add-icon,
.menu-icon {
  @extend .button-icon;
  stroke: var(--icon-foreground);
}

.grid-container {
  width: 100%;
  padding: 0 $s-4;
}

.show-more {
  --show-more-color: var(--button-secondary-foreground-color-rest);
  @include buttonStyle;
  @include bodyMediumTypography;
  position: absolute;
  top: $s-8;
  right: $s-52;
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: $s-12;
  color: var(--show-more-color);

  &:hover {
    --show-more-color: var(--button-secondary-foreground-color-active);
  }
}

.show-more-icon {
  height: $s-16;
  width: $s-16;
  fill: none;
  stroke: var(--show-more-color);
}

// Team hero
.team-hero {
  background-color: $db-tertiary;
  border-radius: $br-8;
  border: none;
  display: flex;
  margin: $s-16;
  padding: $s-8;
  position: relative;

  img {
    border-radius: $br-4;
    height: $s-200;
    width: auto;

    @media (max-width: 1200px) {
      display: none;
      width: 0;
    }
  }
}

.text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-grow: 1;
  padding: $s-20 $s-20;
}

.title {
  font-size: $fs-24;
  color: $df-primary;
  font-weight: $fw400;
}

.info {
  flex: 1;
  font-size: $fs-16;
  span {
    color: $df-secondary;
    display: block;
  }
  a {
    color: $da-primary;
  }
  padding: $s-8 0;
}

.close {
  --close-icon-foreground-color: var(--icon-foreground);
  position: absolute;
  top: $s-20;
  right: $s-24;
  width: $s-24;
  background-color: transparent;
  border: none;
  cursor: pointer;
  &:hover {
    --close-icon-foreground-color: var(--button-icon-foreground-color-selected);
  }
}

.close-icon {
  @extend .button-icon;
  stroke: var(--close-icon-foreground-color);
}

.invite {
  height: $s-32;
  width: $s-180;
}

.img-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: $s-200;
  height: $s-200;
  overflow: hidden;
  border-radius: $br-4;
  @media (max-width: 1200px) {
    display: none;
    width: 0;
  }
}
