@import 'variables';
@import 'mixins';

.item-list-container {
  a {
    display: block;
  }

  .filters {
    position: relative;

    input {
      width: 100%;
      border: 0px;
      padding: 5px;
      @include themeable(
        border,
        theme-container-border,
        1px solid $light-medium-gray
      );
      border-radius: 3px;
      font-size: 1em;
      box-sizing: border-box;
      margin-bottom: 4px;
      @include themeable(
        background,
        theme-container-accent-background,
        lighten($light-gray, 2%)
      );
      color: var(--body-color);
    }

    .filters-header {
      display: flex;
      justify-content: space-between;
      padding: 10px 5px;
      .filters-header-text {
        font-size: 0.9em;
        font-family: $monospace;
        text-decoration: underline;
        color: var(--card-color-tertiary);
      }
      .filters-header-action {
        font-size: 0.8em;
        background: none;
        border: none;
        text-decoration: underline;
        @include themeable(color, theme-color, $blue);
      }
    }

    .tags {
      .tag {
        padding: 5px 0px;
        position: relative;
        padding-left: 5px;
        color: var(--body-color);

        &:hover {
          @include themeable(
            background,
            theme-container-background-hover,
            $light-gray
          );
        }

        &.selected {
          background: $purple;
        }
      }
    }

    .status-view-toggle {
      font-size: 0.8em;
    }
  }

  .items-container {
    padding: 16px;
    box-sizing: border-box;
    width: 100%;
    float: left;

    @media screen and (min-width: 950px) {
      width: calc(100% - 280px);
    }

    .results {
      @include dev-card;
      border-radius: 3px;
      display: none;
      text-align: left;
      font-size: 14px;

      @media screen and (min-width: 950px) {
        font-size: 17px;
      }

      &.results--loaded {
        display: block;
      }

      .results-header {
        @include themeable(
          background,
          theme-container-accent-background,
          darken($light-gray, 2%)
        );
        padding: 17px;
        font-size: 1.8em;
        font-weight: bold;
      }

      .item-wrapper {
        position: relative;

        .archive-button {
          padding-left: 0.8em;
          padding-right: 0.8em;
          position: absolute;
          bottom: 6px;
          right: 5px;
          font-size: 11px;
          font-weight: bold;
          border-radius: 3px;
          background: transparent;
          border: 1px solid $black;
          color: var(--card-color-tertiary);
          @include themeable(border-color, theme-secondary-color, $medium-gray);
        }
      }

      .item {
        color: var(--body-color);
        font-size: 0.8em;
        padding: 17px 17px 25px;
        @include themeable(
          border-bottom,
          theme-container-border,
          1px solid $light-medium-gray
        );

        .item-title {
          font-weight: bold;
          font-size: 1.7em;
          margin-bottom: 10px;
        }

        .item-details {
          a {
            display: inline-block;
            color: var(--card-color-tertiary);

            &.item-user {
              margin-right: 5px;

              img {
                height: 22px;
                width: 22px;
                border-radius: 100px;
                vertical-align: -5px;
                margin-right: 5px;
              }
            }

            .item-tags {
              display: inline-block;
            }
            &.item-tag {
              margin-left: 1px;
              padding: 1px 2px;
              border-radius: 3px;
            }
          }
        }
        &:hover {
          @include themeable(
            background,
            theme-container-background-hover,
            $light-gray
          );
        }
      }

      .items-empty {
        text-align: center;
        padding: 100px 0px;

        span.highlight {
          background: $bold-blue;
          border-radius: 3px;
          padding: 3px 8px;
          margin: 0px 8px;
          color: white;
          display: inline-block;

          span[role='img'] {
            margin-left: 8px;
          }
        }
      }
    }

    .load-more-wrapper {
      @include load-more;
    }
  }
}

@media screen and (max-width: 949px) {
  .home.item-list {
    .side-bar {
      display: block;
      position: relative;
      width: calc(100% - 15px);
      margin: 10px auto;
      margin-left: 10px;
      margin-bottom: -15px;

      .filters {
        min-height: 85px;

        .tags {
          height: 40px;
          overflow: hidden;
          width: 100%;
          overflow-x: scroll;
          overflow-y: hidden;
          white-space: nowrap;

          .tag {
            display: inline-block;
            padding: 1px 6px;
            border-radius: 3px;
            margin-right: 3px;
          }
        }
      }
    }
  }
}
