/**
 * Settings Pages Styles
 * Styles for all settings pages (General, Checkout, Renewals, etc.)
 *
 * @package ArraySubs
 */

// Settings form actions
.arraysubs-settings-actions > div {
  display: flex;
  gap: 12px;

  &__reset {
    margin-left: auto;
  }
}

// Email Templates Settings
.arraysubs-email-templates {
  &__variables-toggle {
    margin-bottom: 20px;

    .button {
      display: flex;
      align-items: center;
      gap: 6px;
    }
  }

  &__variables-panel {
    margin-top: 12px;
    padding: 16px;
    background-color: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    overflow: hidden;

    h4 {
      margin: 0 0 12px 0;
    }
  }

  &__variables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 12px 16px;
  }

  &__variable-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.6;
    padding: 4px 0;
    flex-direction: row;
    justify-content: flex-start;

    code {
      padding: 2px 6px;
      background-color: #d8f5d0;
      border: 1px solid #76b166;
      border-radius: 3px;
      font-family: monospace;
      font-size: 12px;
      white-space: nowrap;
    }

    span {
      color: #646970;
    }
  }

  &__section {
    margin-bottom: 32px;

    h3 {
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid #c3c4c7;
    }
  }
}

// Email Template Editor
.arraysubs-email-template {
  overflow: hidden;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  margin-bottom: 12px;
  background-color: #fff;

  &__header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    background-color: #fff;
    border-bottom: none;

    &--expanded {
      background-color: #f6f7f7;
      border-bottom: 1px solid #c3c4c7;
    }
  }

  &__header-content {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  &__header-icon {
    color: #646970;
  }

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

  &__header-description {
    font-size: 12px;
    color: #646970;
    margin-top: 2px;
  }

  &__header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  &__enable-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;

    input[type="checkbox"] {
      margin-top: 0;
    }
  }

  &__content {
    padding: 16px;
  }

  &__field {
    margin-bottom: 16px;
  }

  &__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
  }

  &__input {
    width: 100%;
    padding: 1px 8px;
  }

  &__input--number {
    width: 80px;
    padding: 1px 8px;
  }

  &__textarea {
    width: 100%;
    min-height: 300px;
    font-size: 13px;
    padding: 12px;
    border: 1px solid #8c8f94;
    border-radius: 3px;

    &--monospace {
      font-family: monospace;
    }
  }

  &__help-text {
    font-size: 12px;
    color: #646970;
    margin-top: 4px;
  }

  &__error {
    padding: 1px 8px;
    background-color: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 3px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #8a2424;
  }

  &__reset-button {
    margin-top: 8px;
  }
}

// Category Badges
.arraysubs-email-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  color: #fff;
  margin-left: 8px;
  min-width: 70px;
  text-align: center;

  &--customer {
    background-color: #2271b1;
  }

  &--reminder {
    background-color: #d63638;
  }

  &--trial {
    background-color: #00a32a;
  }

  &--admin {
    background-color: #646970;
  }

  &--credit {
    background-color: #9b59b6;
  }
}
