@use "mixins";
@use "variables";

// sass-lint:disable class-name-format no-qualifying-elements id-name-format

// Settings form table.

.cmb2-options-page {

  &[class*="option-ctct_options_settings_"] {

    .cmb2-metabox > .cmb-row {
      background: transparent;
      border: none;
      box-shadow: none;
    }
    // Text input

    .regular-text {
      width: 500px;
    }
  }

  #ctct_option_metabox_settings_optin {
	.button-ctct-not-connected {
	  display: none;
	}
  }

  p.cmb2-metabox-description,
  span.cmb2-metabox-description {
    color: inherit;
  }
}

// Global admin styles.

.wp-admin {

  // Settings/Debug/About Page.

  .wrap.ctct-page-wrap{
    max-width: 1000px;
    margin: 0;
    padding: 20px 10px 0 2px;
    @include mixins.wider-than('small') {
      padding-right: 20px;
    }

    > h2{
      font-size: 24px;
      font-weight: 700;
      margin: 0 0 20px;
      padding: 0;
    }

    p, li{
      font-size: 14px;
      line-height: 1.65;

      &.small-text{
        font-size: 12px;
      }

      &.large-text{
        font-size: 16px;
      }

      &.xlarge-text{
        font-size: 18px;
      }
    }

    .text-centered{
      text-align: center;
    }

    .iframe-wrap{
      position: relative;
      padding-bottom: 56.25%; /* 16:9 */
      height: 0;

      iframe{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: variables.$radius;
      }

    }
  }

  // Align elements in settings form tables.

  form.cmb-form{

    h2{
      margin: 0;
      padding: 14px;
    }

    .description,
    p.submit{
      padding: 0 14px;
      margin-bottom: 10px;
    }

    .cmb-th,
    .cmb-th label{
      font-weight: 600;
    }

  }

  // Align buttons in flex row

  .ctct-button-actions{
    display: flex;
    justify-content: flex-start;

    a {
      align-self: flex-start;
      margin: 0 10px 0 0;
    }
  }

  // Copy shortcode on form listing.

  .ctct-shortcode-wrap{
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    background-color: variables.$color-white;
    border: 1px solid variables.$color-silver;
    border-radius: variables.$radius;
    padding: 3px;
    position: relative;

    &:focus-within{
      border-color: variables.$color-light-silver;
    }

    input, button{
      min-height: auto;
      height: 30px;
      font-size: 12px;
    }

    input{
      background-color: transparent;
      border: none;
      font-size: 12px;
      padding: 0 10px 0 5px;
      margin: 0;
      flex: 1;
      box-shadow: none;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;

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

    button{
      z-index: 1;
    }
  }

}
