@import "src/style/vars_mixins";

.deck {
  height: 100vh;
  height: 100dvh;
  width: 400px;
  position: relative;
  border-left: 2px solid $border-color;
  border-right: 2px solid $border-color;
  overflow: hidden;

  @include transition(0.4s);

  @include themify(day) {
    @apply bg-white;
  }

  @include themify(night) {
    @apply bg-dark-200;
  }

  &.native-scroll {
    overflow-y: auto;
  }

  &.expanded {
    width: 600px;
  }

  ::-webkit-scrollbar {
    display: none;
  }

  .ecency-accordion .deck-header {
    padding: 0.69rem;
    display: grid;
    grid-template-areas:
      "prefix drag-icon title empty dropdown";
    grid-template-columns: min-content min-content 1fr min-content min-content;
    border-bottom: 1px solid $border-color;
    min-height: 67px;
    line-height: 1.2;

    .deck-index {
      grid-area: drag-icon;
      opacity: 0.35;
      cursor: grab;

      @include transition(.3s);
      @include margin-right(1rem);

      &:hover {
        opacity: 0.5;
      }
    }

    .empty {
      grid-area: empty;
    }

    .prefix {
      grid-area: prefix;
    }

    .header-title {
      grid-area: title;

      .username {
        min-height: 16px;
      }
    }

    .accordion-toggle {
      grid-area: dropdown;
      height: 24px;
    }

    .icon {
      grid-area: icon;
    }

    .username {
      grid-area: username;
    }
  }

  > .deck-header {
    backdrop-filter: blur(1rem);

    &.expanded {
      backdrop-filter: blur(3rem);
    }

    @include themify(day) {
      @apply bg-white-075;
    }

    @include themify(night) {
      @apply bg-dark-200-075;
    }

    &.header-sticky.primary {
      position: sticky;
    }

    &.header-sticky {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      z-index: 9;
    }

    &.primary {
      .header-title {
        > .title {
          font-weight: bold;

          @include font-size(2rem);
          @include margin-top(2rem);
        }
      }

      .ecency-accordion .deck-header {
        align-items: center;
        grid-template-areas:
          "prefix drag-icon empty dropdown"
          "title title title title";
        grid-template-columns: min-content min-content 1fr min-content;
      }
    }
  }

  .ReactVirtualized__List, .msf-container, .wb-container, .wn-container, .deck-faq-container {
    padding-top: 67px;
  }

  .msf-container {
    height: 100vh;
    overflow-y: auto;
  }

  .native-scroll-content {
    overflow-y: auto;
    height: 100%;
    padding-top: 67px;
  }

  @include media-breakpoint-down(sm) {
    &, &.expanded {
      width: calc(100vw - 72px);
    }
  }

  .cog-icon {
    width: 16px;
  }

  .icon {
    width: 20px;
    height: 20px;
  }

  .icon svg {
    width: 100%;
    height: 100%;
  }

  .icon path {
    @apply fill-blue-dark-sky;
  }

  .header-title {
    > .title {
      font-weight: 600;

      @include font-size(1.25rem);
    }
  }

  .hot-item-index {
    opacity: 0.5;

    @include font-size(0.875rem);
  }

  .hot-item-link {
    font-weight: 500;
    word-break: break-word;

    @include font-size(0.875rem);
  }

  .hot-item-post-count {
    @include font-size(0.875rem);
  }

  .virtual-list-spacer {
    height: 67px;
  }

  .search-item-avatar {
    width: 35px;
    height: 35px;
    border: 1px solid $border-color;
  }

  .search-post-image {
    width: 100%;
    height: 146px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position-x: center;
  }

  .footer-icons svg {
    width: 18px;
    height: 18px;
  }

  .footer-icons {
    flex: 0.8;
  }

  .deck-item-body {
    max-width: 370px;
    word-break: break-word;
    line-height: 1.4;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 120px;
    display: -webkit-box;
  }

  .deck-body {
    .tooltiptext {
      max-width: 388px !important;
    }
  }

  .deck-body .item-controls {
    max-width: 80%;
    gap: 1rem;

    > * {
      padding: 0;
      margin: 0;
    }

    .btn, .entry-votes, .entry-vote-btn, .comments, .entry-payout, .entry-reblog-btn {
      color: $secondary;

      @include padding(0);
      @include font-size(0.75rem);
      @include margin(0);

      &:hover, &:active {
        color: $primary;
      }
    }

    .entry-payout {
      white-space: nowrap;
    }

    .entry-votes svg, .comments svg {
      opacity: 1;

      @include margin(0);
      @include margin-right(0.25rem);
    }

    svg {
      width: 1rem;
      height: 1rem;
    }
  }

  .deck-pinned {
    @apply text-red-040;
    transform: rotate(45deg);

    svg {
      width: 14px !important;
    }
  }

  .deck-header-settings-item {
    font-size: 14px;

    .toggle {
      padding: .68rem;
      font-size: 14px;
    }

    button {
      box-shadow: none;
    }

    .label {
      max-width: 100px;
      min-width: 100px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }

  .skeleton-list {
    overflow: hidden;
    height: 100%;
    padding-top: 67px;

    .list-item-skeleton {
      display: grid;
      grid-template-columns: min-content 1fr min-content;
      grid-template-areas:
      "avatar username date"
      "title title title"
      "media-image media-image media-image"
      "description description description"
      "actions actions actions";
      grid-gap: 1rem;
      align-items: center;

      &.thread-item-skeleton {
        grid-template-areas:
      "avatar username date"
      "title title title"
      "description description description"
      "actions actions actions";
      }

      &.wn-item-skeleton {
        grid-template-areas: "title title title";
      }

      > * {
        animation: skeleton-loader 1s infinite;

        @include themify(day) {
          @apply bg-gray-200;
        }

        @include themify(night) {
          @apply bg-dark-200;
        }
      }

      &.wallet-list-item-skeleton {
        grid-template-areas:
          "avatar username date"
          "title title title";
      }

      .avatar {
        grid-area: avatar;
        width: 32px;
        height: 32px;
        border-radius: 16px;
      }

      .username {
        grid-area: username;
        height: 16px;
      }

      .date {
        grid-area: date;
        width: 30px;
        height: 16px;
      }

      .title {
        grid-area: title;
        height: 16px;
      }

      .media-image {
        grid-area: media-image;
        height: 146px;
      }

      .description {
        grid-area: description;
        height: 117px;
      }

      .actions {
        grid-area: actions;
        height: 18px;
      }
    }

    @include themify(day) {
      @keyframes skeleton-loader {
        0% {
          background-color: $pagination-border-color;
        }

        50% {
          background-color: $pagination-hover-bg;
        }

        100% {
          background-color: $pagination-border-color;
        }
      }
    }
  }

  .transaction-list-item {
    display: grid;
    grid-template-columns: min-content min-content 1fr;
    grid-gap: 1rem;
    grid-template-areas:
        "icon title numbers"
        "details details details";
    align-items: center;
    border-bottom: 1px solid $border-color;

    @include padding(1rem);

    .transaction-icon {
      grid-area: icon;
      margin: 0 auto;
      @apply text-blue-dusky-2;
      min-width: 16px;
      opacity: 0.75;
    }

    .transaction-title {
      grid-area: title;
      white-space: nowrap;

      .transaction-name {
        font-weight: bold;

        @include font-size(0.875rem);
      }

      .transaction-date {
        opacity: 0.5;

        @include font-size(0.75rem);
      }
    }

    .transaction-numbers {
      grid-area: numbers;
      font-weight: bold;
      color: $primary;

      @include margin-left(auto);
    }

    .transaction-details {
      grid-area: details;

      @include font-size(0.875rem);
    }
  }

  .virtual-list-item > .notification-list-item {
    border-bottom: 1px solid $border-color;
    line-height: 1.2;

    @include padding-top(1rem);
    @include padding-bottom(1rem);
    @include padding-right(1rem);

    &:hover {
      background-image: none;
      background-color: transparent;
      border-radius: 0;
    }

    .item-inner {
      display: flex;
      align-items: flex-start;
      gap: 1rem;

      .first-line {
        margin-bottom: 0.5rem;

        @include font-size(0.875rem);

        > span {
          opacity: 0.5;

          @include margin-left(0.25rem);
        }
      }

      .second-line {
        @include font-size(0.875rem);
      }

      .transfer-memo {
        border-left: 4px solid $border-color;
        line-height: 1.25;

        @include padding-left(0.5rem);
      }
    }

    .post-link, .markdown-view {
      color: $secondary;
      cursor: pointer;

      &:hover {
        color: $primary;
      }
    }
  }

  .new-coming-data {
    position: absolute;
    z-index: 1;
    top: 5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;

    @include transition(0.3s);

    &.active {
      transform: translateY(0);
      opacity: 1;
      visibility: visible;
    }
  }

  .deck-faq-container {
    overflow-y: auto;

    .faq-content {
      overflow-y: auto;
      height: calc(100vh - 117px);
      height: calc(100dvh - 117px);
      display: flex;
      flex-direction: column;
      gap: 1rem;
    }

    .suggest-label {
      opacity: 0.5;
      font-weight: 500;

      @include font-size(0.875rem);
    }

    .faq-article {
      display: flex;
      align-items: center;
      gap: 1rem;
      border: 1px solid $border-color;

      @include font-size(0.875rem);
      @include border-radius(1rem);
      @include padding(0.75rem);

      &::after {
        content: none;
      }
    }
  }

  .no-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    flex-direction: column;
    gap: 1rem;

    svg {
      width: 4rem;
      height: 4rem;
      color: $secondary;
      opacity: 0.5;
    }

    p {
      opacity: 0.5;
      color: $secondary;
      font-weight: 500;
      margin-bottom: 0;
    }
  }
}

.decks.toolbar-collapsed .deck {
  @include media-breakpoint-down(sm) {
    &, &.expanded {
      width: 100vw;
    }
  }
}