/**
 * Profile Fields Settings Page
 *
 * @package ArraySubs
 */

// Card wrapper
.arraysubs-card {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 20px;

  &__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
  }

  &__description {
    color: #646970;
    margin: 0 0 20px;
  }
}

// Field editor
.arraysubs-field-editor {
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #fff;
  transition: border-color 0.15s ease;

  &:hover {
    border-color: #8c8f94;
  }

  &--disabled {
    opacity: 0.6;
  }

  &__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
  }

  &__drag {
    color: #c3c4c7;
    cursor: grab;
    flex-shrink: 0;
    display: flex;
    align-items: center;
  }

  &__label {
    flex: 1;
    font-weight: 500;
  }

  &__type-badge {
    font-size: 11px;
    background: #f0f0f1;
    color: #646970;
    border-radius: 3px;
    padding: 2px 8px;
    flex-shrink: 0;
  }

  &__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  &__toggle-btn,
  &__move-btn,
  &__expand-btn,
  &__remove-btn {
    padding: 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: #646970;
    display: flex;
    align-items: center;
    border-radius: 3px;

    &:hover {
      color: #2271b1;
      background: #f0f0f1;
    }

    &:disabled {
      opacity: 0.3;
      cursor: not-allowed;

      &:hover {
        color: #646970;
        background: none;
      }
    }
  }

  &__remove-btn:hover {
    color: #d63638;
  }

  // Expanded body
  &__body {
    border-top: 1px solid #f0f0f1;
    padding: 16px;
  }

  &__row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;

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

  &__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;

    label {
      font-weight: 500;
      font-size: 13px;
    }

    input[type="text"],
    input[type="number"],
    select {
      width: 100%;
      max-width: 100%;
    }

    &--checkbox {
      flex-direction: row;
      align-items: center;
      padding-top: 22px;

      label {
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 400;
      }
    }
  }

  &__hint {
    font-size: 12px;
    color: #8c8f94;
    font-style: italic;
  }

  // Select options editor
  &__options {
    margin-top: 4px;

    > label {
      display: block;
      font-weight: 500;
      font-size: 13px;
      margin-bottom: 8px;
    }
  }

  &__option-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;

    input[type="text"] {
      flex: 1;
    }
  }

  &__option-remove {
    flex-shrink: 0;
    padding: 4px 6px !important;
    display: flex !important;
    align-items: center;
  }
}

// Avatar settings
.arraysubs-pf-avatar-settings {
  &__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    margin-bottom: 20px;
  }

  &__options {
    margin-top: 16px;
    padding-left: 26px;
  }

  &__row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;

    label {
      font-weight: 500;
      font-size: 13px;
    }

    input[type="number"] {
      width: 80px;
    }

    .regular-text {
      width: 100%;
      max-width: 400px;
    }
  }
}

// Fields list
.arraysubs-pf-fields-list {
  margin-bottom: 16px;
}

// Empty state
.arraysubs-pf-empty {
  padding: 24px;
  text-align: center;
  color: #646970;
  background: #f6f7f7;
  border: 1px dashed #c3c4c7;
  border-radius: 4px;
  margin-bottom: 16px;

  p {
    margin: 0;
  }
}

// Add field button
.arraysubs-pf-add-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}

// Responsive
@media (max-width: 782px) {
  .arraysubs-field-editor {
    &__row {
      flex-direction: column;
      gap: 12px;
    }

    &__col--checkbox {
      padding-top: 0;
    }

    &__header {
      flex-wrap: wrap;
    }

    &__actions {
      width: 100%;
      justify-content: flex-end;
    }
  }
}
