// Project breakpoints.
$breakpoints: (
  "small": (
    min-width: 0,
  ),
  "medium": (
    min-width: 782px,
  ),
  "large": (
    min-width: 960px,
  ),
);

/// Mixin to manage responsive breakpoints
///
/// @author Kitty Giraudel
/// @param {String} $breakpoint - Breakpoint name
/// @require $breakpoints
@mixin breakpoint($breakpoint) {
  // If the key exists in the map
  @if map-has-key($breakpoints, $breakpoint) {
    // Prints a media query based on the value
    @media #{inspect(map-get($breakpoints, $breakpoint))} {
      @content;
    }
  }

  // If the key doesn't exist in the map
  @else {
    @warn 'Unfortunately, no value could be retrieved from `#{$breakpoint}`. '
      + 'Available breakpoints are: #{map-keys($breakpoints)}.';
  }
}

:root {
  --zerospam-primary: #3f0008;
  --zerospam-secondary: #840012;
  --zerospam-accent: #ff2929;
  --zerospam-trinary: #be0000;
  --zerospam-success: #69b86b;
}

%default-text {
  color: var(--zerospam-primary);
  display: block;
  font-size: 0.8125rem;
  line-height: 1.384615385rem;
  margin: 0 0 0.5625rem 0;
}

%button {
  backface-visibility: hidden;
  background: var(--zerospam-trinary);
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: 0 2px 1px rgb(28 31 63 / 6%);
  color: #fff;
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  min-height: 0;
  outline: none;
  padding: 0.875rem 2rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    background-color 0.3s ease;

  &:active,
  &:focus {
    background-color: var(--zerospam-accent);
    box-shadow: 0 4px 6px rgb(28 31 63 / 8%);
    border-color: var(--zerospam-accent);
    color: #fff;
  }

  &:hover {
    background-color: var(--zerospam-trinary);
    border: 1px solid transparent;
    box-shadow: 0 4px 6px rgb(28 31 63 / 8%);
    color: #fff;
    transform: translate(0, -2px);
  }

  &.button-primary {
    background: var(--zerospam-accent);

    &:focus {
      color: #fff;
    }
  }
}

%button-small {
  font-size: 11px;
  padding: 0.4rem 0.5rem;
}

#wpcontent {
  padding-left: 0 !important;
}

.wrap {
  margin-left: 12px;
}

.zerospam-small-icon {
  height: 18px;
  vertical-align: sub;
  width: auto;
}

.zerospam-header {
  background-color: var(--zerospam-secondary);
  background-image: url("../img/logo-flat.svg");
  background-position: 0.5rem 0.5rem;
  background-repeat: no-repeat;
  background-size: 100px;
  padding: 1.5rem 1.5rem 1.5rem 8rem;

  @include breakpoint(medium) {
    align-items: center;
    display: flex;
    justify-content: space-between;
  }

  a {
    color: var(--zerospam-accent);
  }

  &__status {
    align-items: center;
    background-color: #fff;
    border-radius: 3px;
    column-gap: 8px;
    display: flex;
    padding: 10px 15px;
  }
}

.zerospam-dashboard {
  @include breakpoint(medium) {
    column-gap: 3rem;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  a {
    color: var(--zerospam-accent);
  }

  &__sections {
    margin-bottom: 40px;
  }
}

a.zerospam-dashboard__menu-link {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--zerospam-primary);
  column-gap: 8px;
  display: flex;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: normal;
  margin: 0;
  padding: 0.6875rem 0.5rem 0.6875rem 1rem;
  text-decoration: none;

  &:hover {
    color: var(--zerospam-primary);
  }

  &--active,
  &:focus {
    background-color: #fff;
    font-weight: 500;
  }

  &--active {
    border-color: #e3e6ef;
    box-shadow: 0 1px 4px rgb(18 25 97 / 8%);
    margin-top: 0.125rem;
  }
}

.zerospam-dashboard__menu-icon {
  width: 18px;
}

.zerospam-block__grid {
  align-items: center;
  column-gap: 30px;
  row-gap: 30px;
  display: grid;
  grid-template-columns: 1fr;

  @include breakpoint(medium) {
    grid-template-columns: 65% 1fr;
  }
}

.zerospam-block {
  background: #fff;
  border: 1px solid #e3e6ef;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgb(18 25 97 / 8%);
  box-sizing: border-box;
  width: 100%;

  .button {
    @extend %button;
  }

  &__content {
    @extend %default-text;
    border-top: 1px solid #ebebf2;
    display: block;
    margin: 0;
    padding: 1rem 1rem 1.25rem;

    code {
      font-size: 0.85em;
    }

    &--supports {
      align-items: center;
      column-gap: 8px;
      display: flex;
      flex-wrap: wrap;
    }
  }

  &__headline {
    box-sizing: border-box;
    color: var(--zerospam-primary);
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 2.875rem;
    margin: 0;
    padding: 0 0 0 1.0625rem;
    width: 100%;
  }

  &--callout {
    .zerospam-block__content {
      padding: 2rem 3rem;

      h3 {
        font-size: 24px;
        font-weight: bold;
        line-height: 1.2;
      }

      .button {
        margin-top: 0.7rem;
      }
    }
  }

  &--success,
  &--error,
  &--notice {
    .zerospam-block__content {
      position: relative;
      color: #fff;
      font-size: 13px;
      padding: 1.3rem 2rem;
    }
  }

  &--notice {
    background: var(--zerospam-success);
  }

  &--success,
  &--error {
    margin-bottom: 1rem;

    .zerospam-block__content {
      padding-left: 60px;

      &::before {
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        border: 1px solid #fff;
        border-radius: 100%;
        content: "";
        display: inline-block;
        height: 25px;
        left: 1.5rem;
        position: absolute;
        top: 18px;
        width: 25px;
      }
    }
  }

  &--success {
    .zerospam-block__content {
      &::before {
        background-color: #fff;
        background-image: url("../img/icon-success.svg");
      }
    }
  }

  &--error {
    .zerospam-block__content {
      background-color: var(--zerospam-accent);
      color: #fff;

      &::before {
        background-color: var(--zerospam-accent);
        background-image: url("../img/icon-x.svg?sd");
      }
    }
  }

  &--map {
    @include breakpoint(medium) {
      width: calc(65% - var(--zerospam-block-gap));
    }
  }

  &--list {
    @include breakpoint(medium) {
      width: calc(35% - var(--zerospam-block-gap));
    }
  }

  &--line-chart {
    @include breakpoint(medium) {
      width: calc(65% - var(--zerospam-block-gap));
    }
  }

  &--pie-chart {
    @include breakpoint(medium) {
      width: calc(35% - var(--zerospam-block-gap));
    }
  }

  &--review {
    .zerospam-block__content {
      @include breakpoint(medium) {
        column-gap: 40px;
        display: flex;
      }
    }

    .zerospam-block__content-col {
      &:first-child {
        flex-grow: 1;
      }

      &:last-child {
        @include breakpoint(medium) {
          flex-shrink: 0;
          width: 32%;
        }
      }
    }
  }
}

.zerospam-blocks {
  --zerospam-block-gap: 0.875rem;

  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--zerospam-block-gap) / 2 * -1);
  margin-right: calc(var(--zerospam-block-gap) / 2 * -1);

  .zerospam-block {
    margin: calc(var(--zerospam-block-gap) / 2);
  }
}

.zerospam-table-form {
  .column-actions {
    column-gap: 5px;
    display: flex;

    .button {
      @extend %button-small;
    }
  }

  .tablenav-pages {
    .current-page {
      width: auto;
    }
  }

  .tablenav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    height: auto;
    margin: 0 0 1rem 0;
    padding-top: 0;

    .actions {
      align-items: center;
      column-gap: 5px;
      display: flex;
      padding: 0;

      select {
        float: none;
        margin-right: 0;
      }
    }

    .tablenav-pages {
      flex-grow: 1;
      float: none;
      margin: 0;
      text-align: right;
    }

    &.bottom {
      margin: 1rem 0 0 0;
    }
  }

  p.search-box {
    align-items: center;
    column-gap: 5px;
    display: flex;
    margin-bottom: 5px;
    float: none;
  }

  .search-box {
    input[name="s"] {
      float: none;
      margin: 0;
    }
  }
}

.zerospam-table-form,
.zerospam-form {
  .regular-text {
    width: 100%;
  }

  .code {
    font-size: 0.8rem;
  }

  select,
  input[type="text"],
  input[type="url"],
  input[type="number"],
  input[type="search"],
  input[type="datetime-local"],
  textarea {
    border: 1px solid var(--zerospam-trinary);
    color: var(--zerospam-primary);
    max-width: none;
    padding: 0.45rem 1rem;
    width: 100%;

    &:hover {
      color: var(--zerospam-primary);
    }

    &:focus {
      border: 1px solid var(--zerospam-trinary);
      box-shadow: none;
    }
  }

  select {
    padding-right: 33px;
  }

  .button {
    @extend %button;
  }

  input[type="radio"],
  input[type="checkbox"] {
    display: none;

    + label {
      display: inline-block;
      margin-bottom: 0.2rem;
      position: relative;

      &::before,
      &::after {
        content: "";
        cursor: pointer;
      }

      &::before {
        background: var(--zerospam-trinary);
        border: 2px solid transparent;
        border-radius: 15px;
        box-shadow: inset 0 1px 2px rgb(90 97 105 / 15%);
        display: inline-block;
        height: 1.125rem;
        margin-right: 0.5rem;
        padding: 0.1275rem;
        position: relative;
        vertical-align: middle;
        transition: all 0.25s ease;
        transition-duration: 0.2s;
        transition-property: background-color, border-color, color, fill, stroke;
        transition-timing-function: cubic-bezier(0.4, 0, 0.1, 1);
        width: 2.625rem;
      }

      &::after {
        background: #fff center no-repeat
          url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iMTAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yLjQ3NDkgMi41MjUxYS41ODMzLjU4MzMgMCAwMDAgLjgyNUw0LjEyNDggNWwtMS42NSAxLjY1YS41ODMzLjU4MzMgMCAxMC44MjUuODI0OWwxLjY1LTEuNjUgMS42NDk5IDEuNjVhLjU4MzMuNTgzMyAwIDEwLjgyNS0uODI1TDUuNzc0NiA1bDEuNjUtMS42NWEuNTgzMy41ODMzIDAgMTAtLjgyNS0uODI0OWwtMS42NSAxLjY1LTEuNjQ5OS0xLjY1YS41ODMzLjU4MzMgMCAwMC0uODI1IDB6IiBmaWxsPSIjOTA5MkIyIi8+PC9zdmc+);
        background-size: 0.625rem;
        border-radius: 50%;
        box-shadow: 0 1px 4px rgb(24 24 72 / 12%);
        display: block;
        height: 1.125rem;
        left: 4px;
        position: absolute;
        top: 4px;
        transition: all 0.25s ease;
        transition-duration: 0.2s;
        transition-property: background, left;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        width: 1.125rem;
        z-index: 1;
      }
    }

    &:checked {
      + label {
        &::before {
          background: var(--zerospam-accent);
        }

        &::after {
          background-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI3IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik0yLjY2NjcgNC4zOTA1TDYuODYxOS4xOTUzYS42NjY3LjY2NjcgMCAwMS45NDI4Ljk0MjhsLTUuMTM4IDUuMTM4TC4xOTUzIDMuODA0N2EuNjY2Ny42NjY3IDAgMDEuOTQyOC0uOTQyOGwxLjUyODYgMS41Mjg2eiIgZmlsbD0iIzNFN0RBNiIvPjwvc3ZnPg==);
          background-size: 0.5rem;
          left: 1.7rem;
        }
      }
    }
  }
}

.check-column {
  input[type="checkbox"] {
    display: block;
  }
}

.zerospam-form-field-container {
  align-items: center;
  column-gap: 10px;
  display: flex;
}

.zerospam-form-field {
  margin-bottom: 0.6875rem;

  > label {
    color: var(--zerospam-primary);
    display: block;
    font-size: 0.8125rem;
    line-height: 1.384615385rem;
    margin: 0 0 5px 0;
  }
}

.zerospam-form-fields {
  --zerospam-block-gap: 0.875rem;

  display: flex;
  flex-wrap: wrap;
  margin-left: calc(var(--zerospam-block-gap) / 2 * -1);
  margin-right: calc(var(--zerospam-block-gap) / 2 * -1);

  .zerospam-form-field {
    margin: calc(var(--zerospam-block-gap) / 2);
    width: calc(100% - var(--zerospam-block-gap));

    &--half {
      width: calc(50% - var(--zerospam-block-gap));
    }
  }
}

.zerospam-form {
  > h2 {
    display: none;
  }

  .description {
    @extend %default-text;
  }

  tbody {
    display: grid;
    grid-column-gap: 0.875rem;
    grid-row-gap: 0.875rem;
    grid-template-columns: 1fr;

    @include breakpoint(medium) {
      grid-template-columns: 1fr 1fr;
    }
  }

  tr {
    box-sizing: border-box;
    display: block;
    position: relative;

    @extend .zerospam-block;
  }

  th {
    @extend .zerospam-block__headline;
  }

  td {
    @extend .zerospam-block__content;
  }
}

.zerospam-modal {
  box-shadow: 0 0 4rem 100vw rgb(0 0 0 / 50%);
  box-sizing: border-box;
  left: 50%;
  max-width: 600px;
  opacity: 0;
  position: fixed;
  max-height: calc(90vh - 60px);
  overflow: auto;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s;
  visibility: hidden;
  width: 100%;
  z-index: 1;

  &.is-active {
    opacity: 1;
    visibility: visible;
  }
}

.zerospam-close-modal {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: block;
  height: 16px;
  padding: 0;
  position: absolute;
  right: 15px;
  top: 15px;
  width: 15px;

  &::before,
  &::after {
    background: #23282d;
    content: "";
    display: block;
    height: 16px;
    left: 6px;
    position: absolute;
    top: 0;
    width: 3px;
  }

  &::before {
    transform: rotate(45deg);
  }

  &::after {
    transform: rotate(-45deg);
  }
}

.zerospam-type- {
  &blocked,
  &login,
  &registration,
  &comment,
  &fluent_form,
  &wpforms,
  &contactform7,
  &givewp,
  &mailchimp4wp,
  &woocommerce_registration,
  &gravityforms,
  &formidable,
  &wp_user_avatar {
    &::before {
      background-position: center;
      background-repeat: no-repeat;
      background-size: contain;
      content: "";
      display: inline-block;
      height: 16px;
      margin-right: 5px;
      vertical-align: sub;
      width: 16px;
    }
  }

  &blocked {
    color: var(--zerospam-primary);

    &::before {
      background-image: url("../img/icon.svg");
    }
  }

  &login,
  &registration,
  &comment {
    &::before {
      background-image: url("../img/icon-wordpress.svg");
    }
  }

  &wp_user_avatar {
    &::before {
      background-image: url("../../modules/wpuseravatar/icon-profilepress.png");
    }
  }

  &fluent_form {
    &::before {
      background-image: url("../img/icon-fluent-forms.svg");
    }
  }

  &formidable {
    &::before {
      background-image: url("../../modules/formidable/icon-formidable.png");
    }
  }

  &wpforms {
    &::before {
      background-image: url("../../modules/wpforms/icon-wpforms.svg");
    }
  }

  &contactform7 {
    &::before {
      background-image: url("../../modules/contactform7/icon-cf7.png");
    }
  }

  &givewp {
    &::before {
      background-image: url("../../modules/give/icon-givewp.png");
    }
  }

  &mailchimp4wp {
    &::before {
      background-image: url("../img/icon-mc4wp.svg");
    }
  }

  &woocommerce_registration {
    &::before {
      background-image: url("../../modules/woocommerce/icon-woocommerce.svg");
    }
  }

  &gravityforms {
    &::before {
      background-image: url("../../modules/gravityforms/icon-gravity-forms.svg");
    }
  }
}

@for $i from 1 through 10 {
  @keyframes row#{$i} {
    0% {
      background-position: 0% 0%;
    }
    50% {
      background-position: #{(($i * 5) + 45%)} 0%;
    }
    100% {
      background-position: 0% 0%;
    }
  }
}

.zerospam-tag {
  background-color: var(--zerospam-accent);
  border-radius: 2px;
  color: #fff;
  display: inline-block;
  padding: 3px;
  font-size: 10px;
  line-height: 1;
  margin: 3px;
  vertical-align: middle;
}

.zerospam-list__item--blocked {
  background: rgba(255, 41, 41, 0.25) !important;
}

.zerospam-list {
  list-style: none;
  margin: 0;
  padding: 0;

  &--top {
    font-size: 12px;
    line-height: 1;

    li {
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
      align-items: center;
      display: flex;
      margin: 0;
      padding: 6px;

      @for $i from 1 through 10 {
        &:nth-child(#{$i}) {
          animation: row#{$i} 5s ease infinite;
          animation-delay: #{$i * 0.1}s;
          background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 1) 0%,
            #fff #{(($i * 5) + 30%)},
            rgba(255, 41, 41, calc(0.6 / #{$i})) 100%
          );
          background-size: 200%;
        }
      }
    }

    .button {
      @extend %button-small;
    }

    .zerospam-list__value {
      &--label {
        flex-grow: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      &--count {
        font-size: 0.95em;
        font-weight: bold;
        margin: 0 20px;
        text-align: right;
        width: 35px;
      }

      &--actions,
      &--count {
        flex-grow: 0;
        flex-shrink: 0;
      }

      &--actions {
        text-align: right;
        width: 85px;
      }

      img {
        vertical-align: sub;
      }
    }
  }

  &--data-actions,
  &--data {
    li {
      align-items: center;
      column-gap: 15px;
      display: flex;
    }
  }

  &--data-actions {
    font-size: 12px;
    line-height: 1.2;

    .button {
      @extend %button-small;
    }

    .zerospam-list__value {
      img {
        vertical-align: sub;
      }

      &:first-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }

      &:nth-child(2) {
        flex-grow: 1;
        text-align: right;
        width: 25%;
      }

      &:nth-child(3) {
        flex-shrink: 0;
        text-align: right;
        width: 30px;
      }

      &:last-child {
        flex-shrink: 0;
        text-align: right;
        width: 40px;
      }
    }
  }

  &--data {
    .zerospam-list__label,
    .zerospam-list__value {
      font-size: 12px;
    }

    .zerospam-list__label {
      font-weight: bold;
      flex-shrink: 0;
      width: 170px;
    }

    .zerospam-list__value {
      flex-grow: 1;
    }
  }

  &--checks {
    font-size: 15px;
    line-height: 1.3;

    li {
      margin-bottom: 20px;
      padding-left: 30px;
      position: relative;

      &:last-child {
        margin-bottom: 0;
      }

      &::before {
        background-image: url("../img/icon-success.svg");
        background-position: center;
        background-repeat: no-repeat;
        background-size: contain;
        content: "";
        display: inline-block;
        height: 22px;
        left: 0;
        position: absolute;
        top: -2px;
        width: 22px;
      }
    }
  }
}

.zerospam-flag {
  margin-right: 5px;
  vertical-align: sub;
}

/* */
.zerospam-dashboard__section-link,
.zerospam-new-window-link::after {
  background-image: url("../img/icon-new-window.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  content: "";
  display: inline-block;
  height: 11px;
  margin-left: 3px;
  vertical-align: middle;
  width: 11px;
}

.zerospam-notice {
  background: #fff;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.zerospam-notice {
  box-sizing: border-box;
  padding: 30px;
}

.zerospam-notice {
  margin: 20px 0;
}

/* Tabs */
.zerospam-settings-tabs .form-table,
.zerospam-tab {
  display: none;
}

.zerospam-settings-tabs h2 {
  background: #fff;
  border: 1px solid #ccd0d4;
  box-shadow: 0 1px 1px rgb(0 0 0 / 4%);
  display: block;
  cursor: pointer;
  margin: 15px 0 0 0;
  padding: 15px 20px;
}

.zerospam-settings-tabs .form-table {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-top: 0;
  margin: 0;
  padding: 20px;
}

.zerospam-settings-tabs .form-table.is-active,
.zerospam-tab.is-active {
  display: block;
}

.zerospam-export-import-block {
  column-gap: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
