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

.classifieds-container {
  margin: 60px auto 150px;
  text-align: left;
  max-width: 100%;
  min-height: 100vh;
  @media screen and (min-width: 950px) {
    margin: 40px auto;
  }
  .classified-filters {
    padding: 20px 0px 10px;
    a {
      padding: 3px 16px;
      border-radius: 100px;
      display: inline-block;
      font-size: 15px;
      &.selected {
        background: $bold-blue;
        color: white;
      }
      &.new-listing-button {
        color: $black;
        background: $green;
        margin: 0px 4px;
      }
    }
    .classified-filters-categories {
      border: 1px solid $light-medium-gray;
      padding: 10px;
      border-radius: 8px;
      a {
        display: block;
        padding: 7px 16px;
        &.classified-create-link {
          border: 2px solid darken($green, 14%);
          color: darken($green, 19%);
          padding: 6px 16px;
          margin-top: 6px;
        }
      }
      @media screen and (min-width: 550px) {
        a {
          display: inline-block;
          margin: 6px 3px;
          border: 1px solid $bold-blue;
          min-width: 50px;
          text-align: center;
          padding: 3px 16px;
          &.classified-create-link {
            padding: 2px 16px;
          }
        }
      }
    }
    .classified-filters-tags {
      padding: 20px 0px;
      position: relative;
      input {
        font-size: 0.8em;
        @include themeable(
          color,
          theme-color,
          $black
        );
        @include themeable(
          background,
          theme-container-accent-background,
          $light-gray
        );
        border-radius: 100px;
        padding: 3px 14px;
        border: 1px solid $light-medium-gray;
        width: calc(100% - 26px);
        margin-bottom: 4px;
        @media screen and (min-width: 550px) {
          width: 280px;
          margin-right: 8px;
        }
      }
      .classified-search-clear {
        background: $light-gray;
        border: 1px solid $light-medium-gray;
        position: absolute;
        left: calc(100% - 25px);
        top: 24px;
        border-radius: 8px;
        @media screen and (min-width: 550px) {
          left: 282px;
        }
      }
      .classified-tag {
        font-size: 0.7em;
        color: $black;
        border-radius: 100px;
        display: inline-block;
        background: $dark-gray;
        margin-right: 5px;
        a {
          padding: 0px 8px;
        }
        &.clear-all {
          background: $light-medium-gray;
          a { color: $black }
        }
        span {
          color: white;
          padding: 3px 2px;
          display: inline-block;
          &.tag-name {
            padding-right: 0px;
          }
        }
      }
    }
  }
  .classifieds-columns {
    display: grid;
    grid-gap: 1em;
    grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
    grid-auto-rows: 0;
  }
  form {
    margin: 60px auto 0px;
    width: 100%;
    max-width: 580px;
    @include themeable(
      background,
      theme-container-background,
      white
    );
    box-sizing: border-box;
    @include themeable(
      border,
      theme-border,
      1px solid $light-medium-gray
    );
    @include themeable(
      box-shadow,
      theme-container-box-shadow,
      2px 2px 8px darken($light-medium-gray, 5%)
    );
    @media screen and (min-width: 580px) {
      border-radius: 8px;
      margin: 100px auto 20px;
    }
    * {
      box-sizing: border-box;
    }
    header {
      @include themeable(
        background,
        theme-container-accent-background,
      #f2f7fc
      );
      padding: 25px 22px;
      border-top-left-radius: 8px;
      border-top-right-radius: 8px;

    }
    .classified-form-inner {
      padding: 0px 15px 40px;
      @media screen and (min-width: 580px) {
        padding: 0px 15px 18px;
      }
    }
    .listings-back-button {
      font-size: 0.8em;
      margin: 2px 0px 8px;
      display: block;
    }
    h2 {
      font-size: 1.45em;
      @include themeable(
        color,
        theme-color,
      #32325d
      );
      margin: 0px;
    }
    .classified-errors {
      background: $red;
      color: $black;
      padding: 20px;
      border-radius: 3px;
      h2 {
        color: $black;
      }
    }
    label {
      display: inline-block;
      font-size: 0.7em;
      margin: 12px 0px 3px;
      border-radius: 3px;
      padding: 6px 0px;
      font-weight: bold;
    }
    input {
      width: 100%;
      font-size: 18px;
      padding: 10px 7px;
      border-radius: 3px;
      border: 1px solid $light-medium-gray;
      @include themeable(
        background,
        theme-container-accent-background,
        $light-gray
      );
      @include themeable(
        color,
        theme-color,
        $black
      );
      &[type="checkbox"] {
        width: 100px;
      }
    }
    textarea {
      width: 100%;
      height: 300px;
      padding: 5px;
      font-size: 17px;
      border-radius: 3px;
      @include themeable(
        background,
        theme-container-accent-background,
        $light-gray
      );
      @include themeable(
        color,
        theme-color,
        $black
      );
      border: 1px solid $light-medium-gray;
    }
    select {
      width: 100%;
      font-size:20px;
    }
    details {
      cursor: pointer;
      font-size: 0.8em;
      padding: 8px 0px;
      @include themeable(
        color,
        theme-secondary-color,
        $medium-gray
      );
    }
    .cta-main-listing-form {
      border: 0px;
      padding: 12px 0px;
      border-radius: 3px;
      background-color: $dark-purple;
      background-image: linear-gradient(141deg, $dark-purple 0%, #1f89db 51%, #2981e5 75%);
      border-radius: 100px;
      font-size: 1.4em;
      color: white;
      margin-top: 20px;
      width: 380px;
      max-width: 90%;
      margin: 35px auto;
      display: block;
      text-align: center;
      @include themeable(
        box-shadow,
        theme-container-box-shadow,
        2px 2px 8px darken($light-medium-gray, 5%)
      );
    }
    .listings-current-credits {
      position: fixed;
      bottom: 0px;
      left: 0px;
      right: 0px;
      padding: 18px 0px;
      background-color: #aecfef;
      background-image: linear-gradient(141deg, #aecfef 0%, #ddeeff 51%, #c8ebf1 75%);
      color: #32325d;
      text-align: center;
      z-index: 20;
      font-size: 0.85em;
      .listings-current-credits-inner {
        display: inline-block;
        margin: 20px;
        select {
          width: initial;
        }
      }
      a {
        text-decoration: underline;
        display: inline-block;
        @include themeable(
          color,
          theme-anchor-color,
          $bold-blue
        );
      }
      @media screen and (min-width: 580px) {
        font-size: 1.1em;
      }
    }
    .classified-listings-unpublish {
      background: $red;
    }
    p {
      font-size: 0.8em;
      @include themeable(
        color,
        theme-secondary-color,
        $medium-gray
      );
    }
  }
  .classifieds-load-more-button {
    text-align: center;
    button {
      background: transparent;
      @include themeable(
        border,
        theme-border,
        1px solid $light-medium-gray
      );
      font-size: 17px;
      padding: 14px 5px;
      margin: 40px auto 70px;
      width: 320px;
      max-width: 80%;
      border-radius: 100px;
      font-weight: bold;
    }
  }
  .field {
    font-size: 18px;
  }
}

.listingform__bodymarkdown {
  width: 100%;
  height: 300px;
  padding: 5px;
  font-size: 17px;
  border-radius: 3px;
  @include themeable(
    background,
    theme-container-background,
    white
  );
  margin-top: 10px;
  @include themeable(
    color,
    theme-color,
    $black
  );
  border: 1px solid $light-medium-gray;
}

.listingform__tagsoptions {
  @include themeable(
    border,
    theme-border,
    1px solid $light-medium-gray
  );
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}

.listingform__tagoptionrow {
  padding: 10px;
  cursor: pointer;
  &:hover {
    background: lighten($green, 27%);
    color: $black;
  }
}

.listingform__tagoptionrow--active {
  background: $green;
  color: $black;
  &:hover {
    background: darken($green, 10%);
  }
}

.listingform__label {
  width: 100%;
  display: inline-block;
  font-size: 0.7em;
  margin: 8px 0px 3px 0px;
  border-radius: 3px;
  padding: 6px 0px;
  font-weight: bold;
}

.single-classified-listing-container {
  width: 100%;
  z-index: 20;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0px;
  margin: 12px auto 0px;
  overflow: hidden;
  .single-classified-listing-container__inner {
    position: absolute;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    box-sizing: content-box;
    padding-right: 17px;
    -webkit-overflow-scrolling: touch;
    padding-top: 95px;
    margin-bottom: 150px;
    @media screen and (min-width: 950px) {
      left: 0;
      right: 0;
      box-sizing: border-box;  
    }
    .single-classified-listing-container__spacer {
      height: 150px;
      margin-bottom: 150px;
    }
  }
  .single-classified-listing-container__inner::-webkit-scrollbar {
    // width: 0 !important;
    display: none;
  }
}

.single-classified-listing {
  width: 94%;
  max-width: 600px;
  display: inline-block;
  border: 1px solid $light-medium-gray;
  margin: 0px auto;
  box-sizing: border-box;
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9em;
  break-inside: avoid;
  @include themeable(
    background,
    theme-container-background,
    white
  );
  h3 {
    margin: 0px;
    padding: 9px 15px;
    @include themeable(
      background,
      theme-container-accent-background,
      lighten($light-medium-gray, 8%)
    );
    border-bottom: 1px solid $light-medium-gray;
    font-size: 16px;
    a { @include themeable(color, theme-color, $black); }
  }
  .single-classified-listing-body {
    padding: 10px 15px;
    font-size: 15px;
    .classified-listing-contact-cta {
      border: 2px solid $black;
      color: $black;
      padding: 8px 10px;
      text-align: center;
      display: block;
      border-radius: 200px;
      margin: 4px auto;
      width: 80%;
    }
  }
  .single-classified-listing-tags {
    padding: 10px 15px;
    a {
      @include themeable(
        color,
        theme-secondary-color,
        $dark-medium-gray
      );
      @include themeable(
        background,
        theme-container-accent-background,
        $light-medium-gray
      );
      display: inline-block;
      margin: 2px;
      padding: 2px 7px;
      font-size: 0.77em;
      border-radius: 3px;
      font-weight: bold;
    }
  }
  .single-classified-listing-author-info {
    font-size: 0.69em;
    @include themeable(
      color,
      theme-secondary-color,
      $medium-gray
    );
    padding: 0px 15px 4px;
    a {
      @include themeable(
        color,
        theme-secondary-color,
        $medium-gray
      );
      display: inline-block;
      &.classified-listing-edit-button {
        margin-left: 4px;
      }
    }
  }
  &.single-classified-listing--opened {
    z-index: 20;
    display: block;
    position: relative;
    left: 0px;
    right: 0px;
    padding-bottom: 12px;
    @media screen and (min-width: 950px) {
      h3 { font-size: calc(20px + 0.05vw);}
      .single-classified-listing-body {
        font-size: calc(18px + 0.05vw);
      }
    }
  }
}
.single-classified-listing-info-link {
  display: block;
  width: 320px;
  max-width: 92%;
  margin: auto;
  padding: 14px 0px;
  text-align: center;
  border-radius: 100px;
  font-weight: bold;
  margin: 40px auto 10px;
  @include themeable(
    color,
    theme-color,
    $white
  );
  border: 3px solid white;
  @include themeable(
    border-color,
    theme-color,
    $white
  );
}


form.listings-contact-via-connect {
  border-radius: 3px;
  z-index: 20;
  position: relative;
  padding: 10px 15px;
  margin: 12px auto;
  width: 100%;
  padding-bottom: 12px;
  box-shadow: none;
  max-width: 100%;
  text-align: right;
  p {text-align: left}
  width: 94%;
  max-width: 600px;
  textarea#new-message {
    height: 100px;
    margin: 5px auto 10px auto;
    font-size: 15px;
    @media screen and (min-width: 950px) {
      font-size: calc(18px + 0.05vw);
    }
  }
  .submit-button {
    margin: none 10px;
    padding: 0.5em;
    height: 2em;
    width: 4em;
    font-size: 1em;
    line-height: 1em;
    text-align: center;
    border-radius: 3px;
    border: 0px;
  }
}

.classified-listings-modal-background {
  z-index: 15;
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  user-select: none;
}

.dashboard-listings-container {
  padding-top: 80px;
  padding-bottom: 80px;
  width: 800px;
  max-width: 96%;
  margin: auto;

  .rounded-btn {
    font-size: calc(15px + 0.2vw);
    font-family: $helvetica-condensed;
    font-stretch: condensed;
    padding: 4px 20px;
    border-radius: 100px;
    margin-right: 5px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 10px;
    @include themeable(
      color,
      theme-color,
      $black
    );
    @include themeable(
      background,
      theme-container-background,
      lighten($light-medium-gray, 5%)
    );
    &:hover {
      @include themeable(
        background,
        theme-container-background-hover,
        $light-medium-gray
      );
    }

    &.active {
      @include themeable(
        background,
        theme-secondary-color,
        $dark-gray
      );
      @include themeable(
        color,
        theme-container-background,
        white
      );
    }
  }

  .dashboard-listings-header-wrapper {
    display: flex;
    flex-direction: row;
    text-align: center;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: $dark-gray;
    @include themeable(box-shadow, theme-container-box-shadow, $bold-shadow);
    padding: 15px 0px;

    @media screen and (max-width: 768px) {
      flex-direction: column;
    }

    .dashboard-listings-header {
      width: 43%;
      text-align: center;
      color: white;
      margin: 5px auto;
      font-size: calc(1.1em + 0.1vw);
      padding: 18px 0px 7px;
      padding-left: 10px;
      font-family: $monospace;
      border: 1px solid $light-gray;
      display: block;
      text-align: center;
      margin: 1.2%;
      padding: 1.2%;
      padding-bottom: 30px;

      @media screen and (max-width: 768px) {
        width: 90%; 
      }
      a {
        font-size: 0.9em;
        border: 2px solid #2ad7c5;
        color: #25c2b2;
        padding: 6px 16px;
        margin-top: 6px;
        border-radius: 100px;
      }
    }
  }

  .dashboard-listings-sorting {
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    @media screen and (max-width: 426px) {
      flex-direction: column;
      align-items: stretch;
    }

    select {
      display: block;
      font-size: 19px;
      padding: 12px;
      border: 1px solid rgb(222, 230, 233);
      border-radius: 3px;
      background-color: white;
      outline: none;
      font-weight: bold;
      color: #333333;
      font-family: 'HelveticaNeue-CondensedBold', 'HelveticaNeueBoldCondensed',
        'HelveticaNeue-Bold-Condensed', 'Helvetica Neue Bold Condensed',
        'HelveticaNeueBold', 'HelveticaNeue-Bold', 'Helvetica Neue Bold',
        'HelveticaNeue', 'Helvetica Neue', 'TeXGyreHerosCnBold', 'Helvetica',
        'Tahoma', 'Geneva', 'Arial Narrow', 'Arial', sans-serif;

      @media screen and (max-width: 426px) {
        text-align-last: center;
        text-align: center;
        -ms-text-align-last: center;
        -moz-text-align-last: center;
        text-align-last: center;
      }
    }
  }
  
  .dashboard-listings-view {

    .dashboard-listing-row {
      border: var(--theme-container-border, 1px solid #dbdbdb);
      box-shadow: var(--theme-container-box-shadow, 1px 1px 0px #c2c2c2);
      padding: 5px 15px;
      margin-bottom: 13px;
      border-radius: 3px;
      position: relative;
      background: var(--theme-container-background, #fff);

      .listing-org {
        @include themeable(
          background,
          theme-secondary-color,
          darken($light-gray, 6%)
        );
        @include themeable(color, theme-container-background, #fff);
        margin-right: 5px;
        padding: 3px 10px;
        border-radius: 100px;
        margin-top: 10px;
        display: inline-block;
        font-size: 0.9em;
      }

      h2 {
        color: var(--theme-container-color, #0a0a0a);
        font-weight: 500;
        margin-bottom: 10px;
        margin-top: 8px;
        font-size: 22px;
        width: 100%;
        @media screen and (min-width: 800px) {
          font-size: 34px;
        }
      }

      .dashboard-listing-date {
        font-size: 0.85em;
        padding: 3px 0px 6px;
        color: var(--theme-secondary-color, #666666);
      }

      .dashboard-listing-category {
        padding: 10px 15px;
        a {
          @include themeable(
            color,
            theme-secondary-color,
            $dark-medium-gray
          );
          @include themeable(
            background,
            theme-container-accent-background,
            $light-medium-gray
          );
          display: inline-block;
          margin: 2px;
          padding: 2px 7px;
          font-size: 0.77em;
          border-radius: 3px;
          font-weight: bold;
        }
      }

      .dashboard-listing-tags {
        font-size: 0.85em;
        padding: 3px 0px 6px;
        a {
          color: var(--theme-container-color, #0a0a0a);
        }
      }

      .listing-row-actions {
        padding: 7px 0px 10px;

        .pill {
          background: $bold-blue;
          padding: 4px 20px;
          border-radius: 100px;
          color: white;
          margin-right: 5px;
          font-size: 14px;
          border: 2px solid transparent;
          margin-top: 6px;
          display: inline-block;
    
          &.green {
            background: $green;
            color: $black;
          }
    
          &.red {
            background: $red;
          }
    
          &.black {
            background: $dark-gray;
          }
        }
      }

    }


  }
}
