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

.classifieds-container {
  margin: 24px 0;
  text-align: left;
  max-width: 100%;
  min-height: 100vh;
  .classified-filters {
    padding: 0 16px;
    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 {
      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: 0 8px 8px 0;
          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;
        color: var(--body-color);
        @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: 24px;
    padding: 0 16px;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    grid-auto-rows: 0;
  }
  form {
    margin: 60px auto 0px;
    width: 100%;
    max-width: 580px;
    background: var(--card-bg);
    box-sizing: border-box;
    border: 1px solid var(--card-color-tertiary);
    @media screen and (min-width: 580px) {
      border-radius: 8px;
      margin: 20px auto 20px;
    }
    * {
      box-sizing: border-box;
    }
    header {
      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;
      color: var(--accent-brand);
      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 var(--form-border);
      background: var(--form-bg);
      color: var(--body-color);
      &[type='checkbox'] {
        width: 100px;
      }
    }
    textarea {
      width: 100%;
      height: 300px;
      padding: 5px;
      font-size: 17px;
      border-radius: 3px;
      background: var(--form-bg);
      color: var(--body-color);
      border: 1px solid var(--form-border);
    }
    select {
      width: 100%;
      font-size: 20px;
    }
    details {
      cursor: pointer;
      font-size: 0.8em;
      padding: 8px 0px;
      color: var(--card-color-tertiary);
    }
    .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%)
      );
      &.cta-draft {
        color: $black;
        background: $yellow;
      }
    }
    .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;
        color: var(--link-brand-color);
      }
      @media screen and (min-width: 580px) {
        font-size: 1.1em;
      }
    }
    .classified-listings-unpublish {
      background: $red;
    }
    p {
      font-size: 0.8em;
      color: var(--card-color-tertiary);
    }
  }
  .classifieds-load-more-button {
    text-align: center;
    button {
      color: var(--body-color);
      border: 1px solid var(--card-color-tertiary);
      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;
  background: var(--card-bg);
  margin-top: 10px;
  color: var(--body-color);
  border: 1px solid $light-medium-gray;
}

.listingform__tagsoptions {
  border: 1px solid var(--card-color-tertiary);
  border-bottom-left-radius: 3px;
  border-bottom-right-radius: 3px;
}

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

.listingform__tagsoptionsbottomrow,
.listingform__tagsoptionrulesbutton,
.listingform__tagrules--inactive {
  display: none; //not yet fully functional or relevant
}

.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 {
    display: none;
  }
}

.single-classified-listing {
  width: 100%;
  display: inline-block;
  border: 1px solid $light-medium-gray;
  box-sizing: border-box;
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9em;
  break-inside: avoid;
  background: var(--card-bg);
  h3 {
    display: flex;
    justify-content: space-between;
    margin: 0px;
    padding: 9px 3px 9px 12px;
    position: relative;
    @include themeable(
      background,
      theme-container-accent-background,
      lighten($light-medium-gray, 8%)
    );
    border-bottom: 1px solid $light-medium-gray;
    font-size: 16px;
    a {
      color: var(--body-color);
    }
  }
  .dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;

    .dropdown-icon {
      max-width: 15px;
      max-height: 15px;
    }
  }

  .dropdown {
    position: absolute;
    bottom: 0;
    right: 0;
    display: inline-block;

    .dropdown-content {
      display: none;
      position: absolute;
      right: 0;
      border: 1px solid $light-medium-gray;
      border-radius: 3px;
      background: white;
      z-index: 20;
      width: 130px;
      box-shadow: $shadow;
      &.showing {
        display: block;
      }
    }

    .dropdown-content a {
      color: black;
      padding: 12px 16px;
      width: 98px;
      height: 14px;
      font-weight: bold;
      display: block;
      font-size: 14px;
      white-space: nowrap;
    }

    .dropdown-content a:hover {
      background-color: #f1f1f1;
    }
  }
  .single-classified-listing-body {
    padding: 10px 12px;
    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 {
      color: var(--card-color-tertiary);
      @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;
    color: var(--card-color-tertiary);
    padding: 0px 15px 4px;
    a {
      color: var(--card-color-tertiary);
      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;
    max-width: 800px;
    margin: auto;
    @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;
  color: var(--body-color);
  border: 3px solid var(--body-color);
  background: var(--card-bg);
}

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: 800px;
  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 {
  width: 800px;
  max-width: 96%;
  margin: 24px 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;
    cursor: pointer;
    margin-bottom: 10px;
    user-select: none;
    color: var(--body-color);
    @include themeable(
      background,
      theme-container-background,
      lighten($light-medium-gray, 5%)
    );
    &:hover {
      @include themeable(
        background,
        theme-container-background-hover,
        $light-medium-gray
      );
    }

    &.active {
      background: var(--card-color-tertiary);
      color: var(--body-color-inverted);
    }
  }

  .dashboard-listings-header-wrapper {
    display: flex;
    flex-direction: row;
    text-align: center;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: $dark-gray;
    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-actions {
    padding-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    .listings-dashboard-filter-buttons {
      margin-bottom: -10px;
    }

    @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: 1px solid var(--card-color-tertiary);
      padding: 5px 15px;
      margin-bottom: 13px;
      border-radius: 3px;
      position: relative;
      background: var(--card-bg);

      &.draft {
        background: var(--theme-container-accent-background, #fffeec);
      }

      &.expired {
        opacity: 0.7;
      }

      .listing-org {
        background: var(--card-color-secondary);
        color: var(--body-color-inverted);
        margin-right: 5px;
        padding: 3px 10px;
        border-radius: 100px;
        margin-top: 10px;
        display: inline-block;
        font-size: 0.9em;
      }

      h2 {
        color: var(--card-color);
        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(--card-color-tertiary);
      }

      .dashboard-listing-category {
        padding: 10px 15px;
        a {
          color: var(--card-color-tertiary);
          background: var(--card-bg);
          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(--card-color);
        }
      }

      .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;
          }

          &.yellow {
            background: $yellow;
            color: $black;
          }

          &.red {
            background: $red;
          }

          &.black {
            background: $dark-gray;
          }
        }
      }
    }
  }
}
