:root {
  --oxy-prefetch-color-purple: #6751a4;

  --oxy-prefetch-color-red-dark: #cc1818;

  --oxy-prefetch-color-green: #0f7a65;
  --oxy-prefetch-color-green-dark: #0c6150;
  --oxy-prefetch-color-green-lighter: #adf0d6;

  --oxy-prefetch-color-gray-darker: #2d2d2dff;
  --oxy-prefetch-color-gray-dark: #616161;
  --oxy-prefetch-color-gray: #aaaaaa;
  --oxy-prefetch-color-gray-light: #dddddd;
  --oxy-prefetch-color-gray-lighter: #f7f7f7;

  --oxy-prefetch-color-cream: #f8f3e7;

  --md-outlined-text-field-outline-color: var(--oxy-prefetch-color-gray);
  --md-outlined-select-text-field-outline-color: var(--oxy-prefetch-color-gray);
  --md-outlined-text-field-container-shape: 8px;

  --_label-text-font: Oxygen;
  --md-icon-font: "Material Icons";
  --_content-font: Oxygen;
  --md-sys-typescale-body-large-font: Oxygen;
  --md-list-item-label-text-font: Oxygen;
  --md-menu-item-label-text-font: Oxygen;
  --md-sys-typescale-headline-small-font: Oxygen;
  --md-ref-typeface-brand: Oxygen;
  --md-dialog-headline-font: Oxygen;
  --md-ref-typeface-plain: Oxygen;

  --md-switch-track-color: var(--oxy-prefetch-color-gray-lighter);
  --md-switch-track-outline-color: var(--oxy-prefetch-color-gray-dark);
  --md-switch-handle-color: var(--oxy-prefetch-color-gray-dark);
  --md-switch-selected-handle-color: white;
  --md-switch-selected-track-color: var(--oxy-prefetch-color-purple);
  --md-switch-selected-focus-handle-color: white;

  --md-outlined-button-outline-color: var(--oxy-prefetch-color-gray);
}

/* General Starts Here */
:is(.tools_page_oxy-prefetch-settings) #wpcontent {
  padding-left: 0;

  & .notice ~ .oxy-prefetch-admin-page {
    margin-top: 15px;
  }
}

small.oxy-prefetch-smaller {
  font-size: 0.5em;
}

.oxy-prefetch-note {
  width: fit-content;
  padding: 15px 15px 15px 35px;
  border-radius: 8px;
  color: var(--oxy-prefetch-color-gray-darker);
  background: var(--oxy-prefetch-color-gray-lighter) url('../images/info.svg') no-repeat 10px center / 15px 15px;

  span {
    display: block;
  }
}

ul.oxy-prefetch-note {
  list-style: disc;
  padding: 15px 15px 15px 45px;
}

html[dir="rtl"] {
  .oxy-prefetch-note {
    padding: 15px 35px 15px 15px;
    background-position-x: calc(100% - 10px);
  }

  ul.oxy-prefetch-note {
    padding: 15px 45px 15px 15px;
  }
}

.oxy-prefetch-in-row {
  display: flex;
  gap: 30px;
  flex-direction: column;
  @media (min-width: 1565px) {
    flex-direction: row;
  }

  > div:last-of-type {
    margin-bottom: 45px;
    @media (min-width: 1565px) {
      margin-bottom: 15px;
    }
  }

  &.oxy-prefetch-fifty > div {
    border: 1px solid var(--oxy-prefetch-color-gray-light);
    border-radius: 28px;
    padding: 20px 32px 45px;
    @media (min-width: 1565px) {
      width: calc(50% - 46px);
    }

    &.oxy-prefetch-switch {
      margin-bottom: 0;
    }
  }
}

.oxy-prefetch-has-tooltip {
  position: relative;
  color: var(--oxy-prefetch-color-gray);
  font-size: 24px;
  vertical-align: text-top;
}

.oxy-prefetch-tooltip {
  position: absolute;
  color: white;
  background: var(--oxy-prefetch-color-gray-darker);
  box-shadow: black 0 7px 10px -5px;
  border: 1px solid black;
  border-radius: 5px;
  padding: 10px;
  top: 20px;
  left: calc(-170px / 2);
  z-index: 10;
  width: 300px;
  line-height: 1.3;
  font-size: 16px;

  a {
    color: white;
  }
}

/* General Ends Here */

/* Buttons Starts Here */
#oxy_prefetch_metabox .oxy-prefetch-delete-parent,
.oxy-prefetch-remove-exclusion {
  --_hover-icon-color: var(--oxy-prefetch-color-red-dark);
}

#oxy_prefetch_metabox .oxy-prefetch-add-more-static-urls {
  font-weight: 700;
  margin-top: 10px;

  .dashicons-plus {
    width: 0;
    vertical-align: middle;
    margin-left: -6px;
    margin-right: 18px;
    font-size: 18px;
    line-height: 1;
  }
}

html[dir="rtl"] #oxy_prefetch_metabox .oxy-prefetch-add-more-static-urls .dashicons-plus {
  vertical-align: text-top;
  margin-left: 18px;
  margin-right: -6px;
}

/* Buttons Ends Here */

/* Spinner Starts Here */
.oxy-prefetch-spinner-wrap {
  display: none;
  gap: 6px;
  align-items: center;

  &.show {
    display: inline-flex;
  }

  & .oxy-prefetch-spinner {
    background: url('../images/spinner.svg') no-repeat;
    width: 20px;
    height: 20px;
  }
}

/* Spinner Ends Here */

/* Metabox Starts Here */
#oxy_prefetch_metabox > .inside {
  padding: 10px;
  margin: 0;
  background: var(--oxy-prefetch-color-cream);
  @media (min-width: 1501px) {
    padding: 30px 70px;
  }

  .oxy-prefetch-statics-wrap {
    padding: 10px;
    background: white;
    border-radius: 28px;
    max-width: 900px;
    margin-inline: auto;

    @media (min-width: 1501px) {
      padding: 15px 70px 15px;
    }

    &:first-of-type {
      margin-bottom: 15px;
    }

    .dashicons-editor-help .oxy-prefetch-tooltip {
      padding: 5px 10px 10px 10px;
    }

    > strong {
      margin-bottom: 15px;
      display: inline-block;
      font-size: 1.5em;
      font-weight: 400;
      vertical-align: top;
    }

    > h2 {
      padding: 0;
    }

    > .oxy-prefetch-switcher {
      float: right;

      > md-switch {
        vertical-align: middle;
      }
    }

  }

  .oxy-prefetch-each-static-url {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 10px;

    .oxy-prefetch-delete-parent {
      position: absolute;
      right: -45px;
    }
  }

  h3 {
    padding: 0;
    line-height: 1.3;
    margin-bottom: 15px;
    font-weight: 400;
  }

  md-outlined-text-field {
    width: 100%;
    text-align: left;
    direction: ltr;
    vertical-align: super;
  }
}

/* Metabox Ends Here */

/*** Snackbar Start ***/
#oxy-prefetch-snackbar {
  box-sizing: border-box;
  position: fixed;
  right: -365px;
  bottom: 30px;
  z-index: 10000;
  transition: right 0.3s ease-in-out;
  width: calc(100% - 20px);
  padding: 16px;
  border-radius: 18px;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;

  .second-part a {
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    display: block;
    width: 100%;
    color: white;
    padding: 8px;
    margin-top: 10px;
  }

  &.show {
    right: 10px;
  }

  @media (min-width: 768px) {
    width: 332px;

    &.show {
      right: 30px;
    }
  }

  & .first-part {
    height: 100%;

    & > span {
      display: inline-block;
      width: 42px;
      height: 50px;
    }
  }

  &.oxy-prefetch-error {
    background: var(--oxy-prefetch-color-red-dark);

    & .first-part > span {
      background: url('../images/snackbar-icon-error.svg') no-repeat;
    }
  }

  &.oxy-prefetch-success {
    background: var(--oxy-prefetch-color-green);

    .first-part > span {
      background: url('../images/snackbar-icon-success.svg') no-repeat;
    }

    .second-part a {
      background: var(--oxy-prefetch-color-green-dark);
    }
  }

  & .second-part {
    flex-grow: 1;
    height: 100%;
    max-width: 73%;

    & h3 {
      display: none;
      color: white;
      margin: 0 0 5px 0;
      font-weight: 500;
      font-size: 22px;
      line-height: 1;
    }

    & p {
      margin: 0;
      font-size: 16px;
      line-height: 1.3;
    }
  }

  & .third-part {
    height: 100%;
    align-self: flex-start;

    & .oxy-prefetch-close {
      background: url('../images/cross.svg') no-repeat;
      width: 16px;
      height: 16px;
      display: block;
      cursor: pointer;
    }
  }
}

/*** Snackbar End ***/

/*** Settings Start ***/
.oxy-prefetch-admin-page {
  background: var(--oxy-prefetch-color-cream);
  margin: auto;
  max-width: 1500px;
  color: var(--oxy-prefetch-color-gray-dark);
  font-family: "Oxygen", sans-serif;
  font-weight: 400;
  font-style: normal;
  line-height: 1.3;
  padding: 25px 15px;

  @media (min-width: 1101px) {
    padding: 25px 45px;
  }

  .oxy-prefetch-max-width {
    max-width: 671px;
    width: 100%;
    direction: ltr;
  }

  .oxy-prefetch-card {
    background-color: white;
    position: relative;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border-radius: 28px;
    width: 100%;
    break-inside: avoid;
    margin-bottom: 15px;
    padding: 20px 32px 45px;

    & > h2 {
      font-weight: 400;
      margin: 0 0 30px 0;
      @media (max-width: 767px) {
        margin: 0 0 15px 0;
      }
    }
  }

  .oxy-prefetch-admin-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    @media (max-width: 480px) {
      flex-direction: column;
    }
  }

  .oxy-prefetch-head-title {
    font-weight: 500;
    margin: 6px 0;

    & > .oxy-prefetch-brand-highlight {
      color: var(--oxy-prefetch-color-purple);
    }
  }

  .oxy-prefetch-need-help {
    border: 2px solid var(--oxy-prefetch-color-green-lighter);
    border-radius: 8px;
    display: flex;
    align-items: center;
    width: 340px;
    padding: 15px 0;
    box-sizing: border-box;
    @media (max-width: 767px) {
      width: 100%;
    }

    & svg {
      display: flex;
      flex: 1;
    }

    & > div {
      display: flex;
      flex-direction: column;
      flex: 4;

      & > span {
        font-weight: 400;
        font-size: 12px;
      }

      & > a {
        font-weight: 700;
        font-size: 12px;
      }
    }
  }

  .oxy-prefetch-switch {
    gap: 20px;
    display: flex;
    flex-direction: column;

    &:not(:last-of-type) {
      margin-bottom: 30px;
    }
  }

  .oxy-prefetch-switch-wrap {
    display: flex;
    align-items: center;
    column-gap: 15px;
    @media (max-width: 767px) {
      row-gap: 15px;
    }

    &.text-color-changer span {
      font-size: 16px;

      &.active {
        color: var(--oxy-prefetch-color-purple);
      }
    }
  }
}

.oxy-prefetch-add-exclusion {
  width: fit-content;
}

.oxy-prefetch-each-exclusion-url md-outlined-text-field {
  vertical-align: super;
}

/*** Settings End ***/

/*** Notice Start ***/
.oxy-prefetch-notice {
  margin-left: 0 !important;
}

/*** Notice End ***/