$admin-color: #0073aa;
$admin-color-red: #aa0000;
$admin-color-black: #23282d;
$admin-color-text: #444444;
$admin-border-color: #ccd0d4;
$admin-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.04);

@import "dashboard";

.neuron-admin {
  color: $admin-color-black;
  font-size: 13px;
  line-height: 18px;

  &:not(.neuron-admin--metabox-wrapper) {
    margin-left: -20px;
  }

  button,
  .button {
    color: #fff;
    background-color: $admin-color;

    font-size: 13px;
    line-height: 28px;

    padding: 2px 10px;
    border-radius: 3px;

    &.invert,
    &:hover {
      color: $admin-color;
      border: 1px solid $admin-color;
      background-color: transparent;
    }
  }

  &__header {
    width: 100%;
    background-color: #fff;
    display: flex;
    align-items: center;
  }

  &__logo {
    padding: 20px 30px;
    display: flex;
    justify-content: center;
    flex-direction: column;

    img {
      display: block;
      max-width: 85px;
    }

    a:focus {
      box-shadow: none;
    }
  }

  &__nav {
    display: flex;
    justify-content: space-between;
    flex: 1;
    align-items: center;
  }

  &__menu {
    font-weight: 600;

    ul {
      padding: 0;
      margin: 0;

      li {
        padding: 0;
        margin: 0;
        position: relative;
        display: flex;
        align-items: center;

        border-left: 1px solid #f1f1f1;
        border-right: 1px solid #f1f1f1;

        &:hover {
          background-color: #f9f9f9;

          .settings:after {
            transform: rotate(90deg);
          }

          .sub-menu {
            opacity: 1;
            visibility: visible;
          }
        }

        .sub-menu {
          position: absolute;
          background-color: #fff;
          top: 100%;
          width: 170px;
          margin-left: -1px;
          opacity: 0;
          visibility: hidden;
          transition: cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s;
          z-index: 1000;

          li {
            border-bottom: 1px solid #f1f1f1;

            &:first-child {
              border-top: 1px solid #f1f1f1;
            }

            a {
              padding: 15px 40px 15px 30px;
              width: 100%;
            }
          }
        }

        a {
          padding: 20px 40px 20px 30px;

          &.settings {
            position: relative;

            &:after {
              content: "\f345";
              opacity: 0.7;
              top: 50%;
              margin-top: -7px;
              font-family: dashicons;
              position: absolute;
              right: 14px;
              transform: rotate(0deg);
              transform-origin: 50% 50%;
              transition: transform 0.1s ease;
            }
          }

          color: inherit;
          text-decoration: none;
        }
      }
    }

    &--center {
      display: flex;
      align-items: center;
    }

    &--right {
      display: flex;
      align-items: center;

      .settings-cog {
        padding: 0 30px;
        width: 17px;
        position: relative;
        height: 59px;
        display: flex;
        margin-left: 10px;

        &.active {
          background-color: #f0f2f4;
          box-shadow: inset 0 -1px 0 0 #0073aa;
        }

        &:focus {
          box-shadow: none;
        }
      }
    }
  }

  &__content {
    display: flex;
    justify-content: center;
    margin: 30px;
    align-items: center;
    flex-direction: column;
  }

  &__system-info {
    table:not(:last-child) {
      margin-bottom: 20px;
    }

    th {
      font-weight: 600;
    }

    .tooltip {
      position: relative;
      display: inline-block;

      &:hover {
        .tooltip__text {
          visibility: visible;
          opacity: 1;
        }
      }

      &__text {
        visibility: hidden;
        width: 150px;
        background-color: #555;
        color: #fff;
        text-align: center;
        padding: 5px 10px;
        border-radius: 2px;
        position: absolute;
        z-index: 1;
        bottom: 125%;
        left: 50%;
        margin-left: -85px;
        opacity: 0;
        transition: opacity 1s;

        &:after {
          content: "";
          position: absolute;
          top: 100%;
          left: 50%;
          margin-left: -5px;
          border-width: 5px;
          border-style: solid;
          border-color: #555 transparent transparent;
        }
      }
    }
  }

  &__card {
    background-color: #fff;
    max-width: 600px;
    padding: 25px;

    border: 1px solid $admin-border-color;
    box-shadow: $admin-box-shadow;

    &:not(:last-child) {
      margin-bottom: 20px;
    }

    h2 {
      margin: 0;
      margin-bottom: 15px;

      font-size: 17px;
      line-height: 18px;
      font-weight: 600;
    }

    &--description {
      color: #72777c;
      font-size: 15px;
      line-height: 22px;
      margin-bottom: 20px;
    }

    &--getting-started {
      padding: 50px 80px;
      text-align: center;

      h2 {
        color: $admin-color-black;
        font-size: 23px;
        line-height: 30px;
      }

      p {
        color: $admin-color-text;
        margin: 0;
      }

      iframe {
        margin: 40px 0 40px 0;
      }
    }

    &--inline-buttons {
      .button {
        padding: 0 25px;
        line-height: 40px;

        &:not(:last-child) {
          margin-right: 20px;
        }
      }
    }

    th {
      display: none;
    }

    td {
      margin: 0;
      padding: 0;

      input {
        margin: 0;
        width: 100%;

        border: 1px solid $admin-border-color;
        border-radius: 4px;
        background-color: #fff;

        padding-left: 10px;
        padding-right: 10px;

        line-height: 30px;
      }
    }

    tr {
      &:not(:last-child) {
        input {
          margin-bottom: 10px;
        }
      }
    }

    &--license {
      h4 {
        color: #72777c;
        font-size: 15px;
        line-height: 22px;
        font-weight: 400;
      }

      .h-bold {
        font-weight: 600;
      }

      input[type="submit"] {
        margin: 0;
        padding: 0;

        max-width: 20%;
        margin-left: 10px;
      }

      .form-table {
        td {
          display: flex;
          margin-bottom: 15px;
        }
      }

      .generate-url {
        margin: 0;
      }
    }
  }

  &__demo-importer {
    margin: 40px;

    &--nav {
      select {
        line-height: 30px;
        font-size: 13px;
        color: #72777c;
        padding-left: 10px;
        padding-right: 40px;
        border-radius: 4px 0px 0px 4px;
        border: 1px solid $admin-border-color;
        margin-right: 0;
      }
    }

    &--search {
      input {
        border-radius: 0 4px 4px 0;
        border: 1px solid $admin-border-color;
        line-height: 30px;
        margin-top: 0;
        border-left: 0;
        margin-left: 0;

        padding-left: 12px;
        width: 250px;
      }
    }

    .ocdi {
      &__gl-item-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);

        @media (min-width: 1400px) {
          grid-template-columns: repeat(3, 1fr);
        }

        @media (min-width: 2000px) {
          grid-template-columns: repeat(4, 1fr);
        }

        grid-column-gap: 40px;
        grid-row-gap: 40px;

        &--single {
          // grid-template-columns: repeat(3, 1fr);
        }

        img {
          max-width: 100%;
          display: block;
        }
      }

      &__gl-item {
        border: 1px solid $admin-border-color;
        box-shadow: $admin-box-shadow;

        &.active {
          order: -1;

          .ocdi__gl-item-footer {
            display: none;

            &--active {
              display: flex;
            }
          }
        }
      }

      &__gl-item-footer {
        bottom: 0;
        width: 100%;
        height: 60px;
        padding-left: 15px;
        padding-right: 15px;

        background-color: #fff;
        box-sizing: border-box;

        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid $admin-border-color;
        position: relative;

        &--active {
          border: none;
          background-color: #2a2e36;
          color: #fff;

          display: none;

          .ocdi__gl-item-footer--title {
            span {
              margin-right: 4px;
              font-weight: bold;
            }
          }

          .ocdi__gl-item-footer--category {
            color: #fff;
          }

          button {
            background-color: #e2383b;
            border-color: #e2383b;

            &:hover {
              background-color: #e2383b;
              color: #fff;
              border-color: #e2383b;
            }
          }
        }
      }

      &__gl-item-footer--title {
        display: flex;
        align-items: center;
        // max-width: 40%;
        // flex: 0 0 40%;
      }

      &__gl-item-title {
        margin: 0;
      }

      &__gl-item-footer--category {
        color: #72777c;

        &:before {
          content: "|";
          margin: 0 5px;
        }
      }

      &__gl-item-footer--buttons {
        position: relative;

        a {
          margin-left: 6px;
        }

        .js-ocdi-gl-import-data {
          .ab-icon {
            position: relative;
            float: left;
            font: normal 20px/1 dashicons;
            speak: never;
            padding: 4px 0;
            background-image: none !important;
            margin-right: 6px;
            display: none;

            animation-name: spin;
            animation-duration: 1000ms;
            animation-iteration-count: infinite;
            animation-timing-function: linear;

            &:before {
              content: "\f463";
              top: 2px;
            }
          }

          &.loading {
            .ab-icon {
              display: block;
            }
          }
        }
      }
    }
  }

  &__metabox {
    .repeater-block {
      background: #ffffff;
      color: #6d7882;
      padding: 20px;
      border: 1px solid $admin-border-color;
      border-top: 0;

      &:first-of-type {
        border-top: 1px solid $admin-border-color;
      }

      .repeater-title {
        cursor: pointer;
      }

      .row-font-label {
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-transform: capitalize;

        li {
          box-sizing: border-box;
          flex-grow: 1;
          width: 100%;
          margin: 0;

          span {
            margin-right: 10px;

            &.label {
              font-weight: 500;
              padding-right: 10px;
              color: #444444;
            }
          }
        }

        .row-font-weight,
        .row-font-style {
          max-width: 180px;
        }

        .row-font-actions {
          max-width: 200px;
          text-align: right;
        }
      }

      span {
        &.elementor-repeater-tool-btn.close-repeater-row {
          display: none;
        }
      }

      &.block-visible {
        padding-bottom: 0;
        margin-bottom: 0;

        span {
          &.elementor-repeater-tool-btn.toggle-repeater-row {
            display: none;
          }

          &.elementor-repeater-tool-btn.close-repeater-row {
            display: inline-block;
          }
        }
      }

      &:not(.block-visible) {
        .close-repeater-row {
          display: none;
        }
      }
    }

    .repeater-content {
      margin: 0;

      .repeater-content-top {
        display: flex;
        margin-bottom: 20px;
        line-height: 28px;

        > div {
          box-sizing: border-box;
          flex-grow: 1;
        }

        p {
          margin: 0;
          display: inline-block;

          label {
            font-weight: 500;
            padding-right: 10px;
            color: #444444;
          }
        }

        .elementor-field-select {
          max-width: 180px;
        }

        .elementor-field-toolbar {
          max-width: 200px;
          text-align: right;
        }
      }

      .repeater-content-bottom {
        padding: 5px 0;
        margin: 0 -20px;
        border-top: 1px solid $admin-border-color;
        background-color: #f5f5f5;

        .elementor-field {
          display: flex;
          align-items: center;
          padding: 20px 40px;

          &:not(:last-child) {
            border-bottom: 1px solid $admin-border-color;
          }

          p,
          input {
            box-sizing: border-box;
            flex-grow: 1;
            width: 100%;
            margin: 0;
          }

          p {
            &.elementor-field-label {
              font-weight: 500;
              max-width: 120px;
              color: #23282d;
            }
          }

          .elementor-field-input {
            padding: 5px 8px;
            margin: 0 15px;
            border-radius: 4px;
            font-size: 12px;
            width: 100%;
            background: none;
            box-shadow: none;
            color: #495157;
            border: 1px solid;
            outline: none;
            background-color: #fff;

            &:not(:focus) {
              border-color: #d5dadf;
            }

            &:focus {
              border-color: #a4afb7;
            }
          }

          .elementor-upload-btn,
          .elementor-upload-clear-btn {
            max-width: 100px;
            font-size: 13px;
            line-height: 28px;
            text-transform: none;
          }

          .elementor-upload-btn {
            color: $admin-color;
            border: 1px solid $admin-color;
            background-color: transparent;
          }

          .elementor-upload-clear-btn {
            background-color: transparent;
            color: $admin-color;

            &:hover {
              background-color: $admin-color-red;
              border-color: $admin-color-red;
              color: white;
            }
          }
        }
      }

      select {
        color: #72777c;
        border: 1px solid #ccd0d4;
        background-color: #ffffff;
        border-radius: 4px;
        line-height: 30px;
        padding-left: 10px;
      }
    }

    input.add-repeater-row {
      margin-top: 20px;

      color: #fff;
      background-color: $admin-color;
      text-transform: none;
      font-weight: 400;

      font-size: 13px;
      line-height: 28px;

      padding: 2px 10px;
      border-radius: 3px;

      &:hover {
        color: $admin-color;
        border: 1px solid $admin-color;
        background-color: transparent;
      }

      &:not([disabled]) {
        cursor: pointer;
      }
    }
  }

  .row-font-preview,
  .inline-preview {
    font-size: 16px;
    text-transform: capitalize;
  }

  .elementor-repeater-tool-btn {
    color: #444444;
    cursor: pointer;
    padding: 0 10px;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 13px;

    i {
      padding-right: 5px;
    }

    &.remove-repeater-row {
      color: $admin-color-red;
    }
  }
}

span.font-variations-count {
  display: inline-block;
  vertical-align: top;
  margin: 1px 0 0 5px;
  padding: 0 5px;
  min-width: 7px;
  height: 17px;
  border-radius: 11px;
  background-color: $admin-color;
  color: #fff;
  font-size: 9px;
  line-height: 17px;
  text-align: center;
  z-index: 26;
}

.post-type-neuron_font {
  div#neuron-font-custommetabox {
    background: none;
    border: 0;

    button.handlediv {
      display: none;
    }

    #poststuff .inside {
      margin: 0;
      padding: 0;
    }

    h2.hndle {
      padding: 0;
    }
  }

  #tagsdiv-neuron_font_type,
  #minor-publishing-actions,
  #misc-publishing-actions {
    display: none;
  }
}

body.wp-admin {
  &.toplevel_page_neuron,
  &.neuron_page_settings,
  &.neuron_page_system-info,
  &.neuron_page_demo-importer,
  &.neuron_page_license,
  &.post-type-neuron_font {
    .notice {
      display: none;
    }
  }
}

div.notice[data-notice_id="woocommerce_promote"] {
  display: none;
}

#adminmenu #toplevel_page_neuron img {
  padding: 7px 0 7px 0;
  max-width: 20px;
}

/* Grid animations */
@keyframes ocdi-fade {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.ocdi-is-fadeout {
  animation: ocdi-fade linear 200ms 1 forwards;
}

.ocdi-is-fadein {
  animation: ocdi-fade linear 200ms 1 reverse forwards;
}

#adminmenu .wp-submenu li.elementor-app-link {
  display: none !important;
}

@-moz-keyframes spin {
  from {
    -moz-transform: rotate(0deg);
  }
  to {
    -moz-transform: rotate(360deg);
  }
}
@-webkit-keyframes spin {
  from {
    -webkit-transform: rotate(0deg);
  }
  to {
    -webkit-transform: rotate(360deg);
  }
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
